Jump to content
  • Advertisement


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

original vesoljc

Win32 DialogBox problems

This topic is 6027 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''m having problems with setting up a simple dialog box under win with MSVC++6. you can download my "project" here http://vesoljc.tripod.com/Download/DialogBox.zip the problem is that my dialog box is not being drawn! only two default buttons (and other controls) are drawn, OK and CANCEL, no title, no borders, nothing. here''s the main code: #include "stdafx.h" BOOL CALLBACK MyDlgProc(HWND hwnd, UINT Msg,WPARAM wParam, LPARAM lParam) { switch(Msg) { case WM_INITDIALOG: Beep(1000,100); break; case WM_COMMAND: switch (LOWORD(wParam)) { case IDOK: Beep(500,100); break; case IDCANCEL: EndDialog(hwnd,FALSE); break; } } return 1; } int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { // TODO: Place code here. DialogBox(hInstance, MAKEINTRESOURCE(IDD_DIALOG1),NULL, MyDlgProc); return 0; } buttons work ok, but the dialog it self is not visible. Abnormal behavior of abnormal brain makes me normal...

Share this post

Link to post
Share on other sites
In your DlgProc, if you don''t handle a message you should be returning 0.
Your code currently returns 1 for *all* messages, it shoudln''t be!.

Simon O''Connor
Creative Asylum Ltd

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!