Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7558061
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T12:16:59+00:00 2026-05-30T12:16:59+00:00

Hello all I hope someone can help me I am working on a simple

  • 0

Hello all I hope someone can help me I am working on a simple application which uses tab controls I have set this up and working fine. My handlers for the second dialog tab is below and contains a pop up to confirm the button was clicked which works ok.

INT_PTR CALLBACK TabDialogTwo(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam) 
{ 
    switch (uMsg) 
    { 
   case WM_INITDIALOG: 
        break; 
        case WM_COMMAND:      
            { 

            switch (LOWORD(wParam)) 
            { 
            case IDC_CHECK_ACCOUNT: 
                // This doesnt work
                   HWND hwndStatic = GetDlgItem(hwndDlg, IDC_STATIC1);
   Static_SetText(hwndStatic, "Button Works");
   // This does as expected 
                MessageBox(hwndDlg,TEXT("User Account Selected"),TEXT("Button"),0); 
                break; 
            } 
            break; 
            } 

    } 
    return FALSE ; 
} 

My problem is the buttons which are on my tab controls wont update my static bar using this code

// This doesnt work from inside the tab window but does work in my intial dialog function
      HWND hwndStatic = GetDlgItem(hwndDlg, IDC_STATIC1);
      Static_SetText(hwndStatic, "Button Works???");

Do I need to change the handle to hwnd->hwndDlg ? this comes up undefined as its not.

All I want to do is be able to change my status bar from within the tab controls is this possible? I have searched for 8 days now non stop so thought I would ask the experts.

Many thanks

UPDATE FIXED : See Pezcode Example below. thanks to all helpers.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T12:16:59+00:00Added an answer on May 30, 2026 at 12:16 pm

    Replace

    HWND hwndStatic = GetDlgItem(hwndDlg, IDC_STATIC1);
    

    with

    HWND hwndStatic = GetDlgItem(GetParent(GetParent(hwndDlg)), IDC_STATIC1);
    

    GetDlgItem only gets controls inside the window you give to it. hwndDlg in that context is the dialog inside the tab. But to get the hwndStatic handle to the static bar of the main dialog, you have to get up two levels (via the GetParent API).
    Once up is the tab control, another one up is your main dialog.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello all I hope someone can help me resolve this issue.. I'm curious as
Hello all I hope you can help me understand why getopt used an int
hello all I have a small dialog which I created dynamically, which has a
Problem Hello all! I have this code which takes my jpg image loops through
hello all i am new to iphone development i am working on a application
Hello all I'm working on a little project where I'm adding controls to a
NOTE: Using .NET 2.0, and VS2005 as IDE Hello all, I'm working on logging
var doc = w.document; doc.open('application/CSV','replace'); doc.charset = utf-8; doc.write(all,hello); doc.close(); if(doc.execCommand(SaveAs,null,file.csv)) { window.alert(saved );
Hello guys first of all apologize for asking such a simple and yet redundant
Hello dearest community, First of all, I hope my intention is not missconcept. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.