Advertisement Jump to content


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


Activating windows

This topic is 5825 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 bring some window to the top of the Windows Z-Order, so that it is visible. I tried the standard Minesweeper window to test that. All I want to do is to make the window visible if it is (for example) hidden behind the Windows Explorer or something. Also it needs to have the focus. BringWindowToTop() does not do anything ( at least it seems so ) thx in advance

Share this post

Link to post
Share on other sites
Funny you should mention this, I was working on the exact same problem a few days ago. Basically, I use the FindWindow() function to get a handle, then use BringToForeground() to bring it up. There's various other functions realted to this - take a look at the MSDN.

Note: This code searches for a window by its window class. In this case, I was looking for an MS PowerPoint window, and using Spy++ I found that it uses window class "PP9FrameClass".

//Get handle to window

CWnd* ppoint_win;
ppoint_win = FindWindow("PP9FrameClass",NULL);

//Set it to foreground


Edit: Oh yeah, sorry - from your post, not sure if you're talking bout your own window or another app - that's what my code was for - pulling up someone else's window. If it's one of your own windows, you obviously don't need to search for a handle.

[edited by - NeverSayDie on February 9, 2003 3:39:29 PM]

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. 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!