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 7857821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T21:09:48+00:00 2026-06-02T21:09:48+00:00

I have been trying to get my program to display different modeless dialog boxes

  • 0

I have been trying to get my program to display different modeless dialog boxes when different menu items are selected. So far I am only working on displaying 1 but I am unable to get this working.

When I run my code I can see the main window losing focus but the about dialog box is not being displayed.

HWND g_hToolbar = NULL;
HWND hDlgCurrent = NULL;

int APIENTRY _tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR    lpCmdLine,
int       nCmdShow)
{
UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(lpCmdLine);

MSG msg;
HACCEL hAccelTable;

LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
LoadString(hInstance, IDC_GUIAPP, szWindowClass, MAX_LOADSTRING);
MyRegisterClass(hInstance);

// Perform application initialization:
if (!InitInstance (hInstance, nCmdShow))
{
    return FALSE;
}

while(GetMessage(&msg, NULL, 0, 0) > 0)
{
    if(!IsDialogMessage(g_hToolbar, &msg))
    {
        TranslateMessage(&msg);
        DispatchMessage(&msg);
    }
}
return (int) msg.wParam;
}

Here is the code for my about box:

INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{

UNREFERENCED_PARAMETER(lParam);
switch (message)
{
case WM_CREATE:
    g_hToolbar = CreateDialog(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_ABOUTBOX),
        hDlg, ToolDlgProc
        );
    if(g_hToolbar != NULL)
    {
        ShowWindow(g_hToolbar, SW_SHOW);
    }
case WM_INITDIALOG:
    return (INT_PTR)TRUE;

case WM_ACTIVATE:
    if (0 == wParam)             // becoming inactive
        hDlgCurrent = NULL;
    else                         // becoming active
        hDlgCurrent = hDlg;
    return FALSE;

case WM_COMMAND:
    if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDOK)
    {
        EndDialog(hDlg, LOWORD(wParam));
        return (INT_PTR)TRUE;
    }
    break;
}
return (INT_PTR)FALSE;
}

Then my Call in WndProc

    case IDM_ABOUT:
        CreateDialog(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About);        
        break;

I apologize for pasting such large sections of code in but I am unaware as to where exactly the problem is.

Any help on this would be great!

  • 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-06-02T21:09:50+00:00Added an answer on June 2, 2026 at 9:09 pm

    This issue has been solved.

    The solution is contained in the comments.

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

Sidebar

Related Questions

I have been trying to get this program to work but so far having
I have been trying to get my C# program to insert records directly into
I have been trying to get getch to work in another program with no
I am using QDial in my program and have been trying to get the
I have been trying to get a simple networking test program to run with
I have been trying to get around this error for a day now and
I have been trying to get more in to TDD. Currently keeping it simple
I have been trying to get yui-css grid system to make a three column
I have been trying to get nServiceBus to work with Ninject 2.0 as the
I have been trying to get LastBootUpTime using Win32_OperatingSystem class (WMI). HRESULT hr =

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.