Jump to content
  • Advertisement
Sign in to follow this  
safe

How to make a Dialog based program always on Top?

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

Hello, could you please let me know : how to make a Dialog based program always on Top? Thanks a lot in advance.

Share this post


Link to post
Share on other sites
Advertisement
Are you using windows? If so, are you using MFC, or the .NET framework, or straight-up Win32 SDK?

For .NET, the form has a TopMost property you can set to True. For Win32 (or MFC) you can call SetWindowstyle, passing in the HWND for your window and WS_EX_TOPMOST for the style.



~BenDilts( void );

Share this post


Link to post
Share on other sites
HI BeanDog, sorry to bother you.

I tried, but it doesn't work:

// ModifystyleEx(0, WS_EX_TOPMOST);
HWND hWnd = GetSafeHwnd ();
SetWindowLong(m_hWnd, GWL_EXstyle, WS_EX_TOPMOST);

if it is possible to let me know why?

Share this post


Link to post
Share on other sites
Thank you Dave Hunt!

But the SetWindowPos doesn't work either:

::SetWindowPos(m_hWnd, HWND_TOPMOST,
0, 0, 800, 605, SWP_NOZORDER);

Share this post


Link to post
Share on other sites
Thank you so much Dave Hunt!
it is correct. I should read the parameters carefully.
Have a good day!

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.

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

Sign me up!