Jump to content
  • Advertisement
Sign in to follow this  
ajm113

Self Closing Dialog (C++ \ Win32)

This topic is 3071 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

Is it possible too make a self closing dialog box using pure one threaded Win32 and C++? I'm using the good old "DialogBox" func in Win32, but it will wait until the user clicks close/ok/etc.. Is there a way just too keep it open for 5 seconds and close the dialog after it displays?

I was thinking of a easy way too do it if there is a display message with Win32 when an dialog appears, but I don't know what the message is called or if there is one.

Thanks, Andrew.

Share this post


Link to post
Share on other sites
Advertisement
You could install a custom wndproc, inside the WM_CREATE handler, set a timer running. Almost all messages (including the WM_CREATE) in your wndproc are simply deferred to the dialog's normal wndproc. When the timer kicks you set the return value of the window and call enddialog().

Apart from one change in the call to dialogbox() the rest of your app just doesn't notice anything happening.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!