Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

zacharya

why won't my dilaog box show up?

This topic is 5248 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I want to show a dialogbox but I still can''t make it visible somehow.... #include <windows.h> #include "resource.h" BOOL CALLBACK ToolDlgProc(HWND hWnd,UINT Msg,WPARAM wParam,LPARAM lParam); int APIENTRY WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nShowCmd) { HWND hDialog; MSG Msg; hDialog = CreateDialog(hInstance,MAKEINTRESOURCE(IDD_DLG),NULL,ToolDlgProc); ShowWindow(hDialog,SW_SHOW); while(GetMessage(&Msg,NULL,0,0)) { if(!IsDialogMessage(hDialog,&Msg)) { TranslateMessage(&Msg); DispatchMessage(&Msg); } } DestroyWindow(hDialog); return 0; } BOOL CALLBACK ToolDlgProc(HWND hWnd,UINT Msg,WPARAM wParam,LPARAM lParam) { switch(Msg) { case WM_INITDIALOG : break; case WM_CLOSE : PostQuitMessage(0); break; } return TRUE; } I tried may ways but it still won''t show up....

Share this post


Link to post
Share on other sites
Advertisement
At the end of your ToolDlgProc function return FALSE, not TRUE.
When you return TRUE you''re telling windows you took care of the message and windows doesn''t need to process it any further. Your version would have a lot of messages not be processed.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!