Activating windows

Started by
0 comments, last by Schwammerl-Bob 21 years, 2 months ago
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
Advertisement
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 windowCWnd* ppoint_win; ppoint_win = FindWindow("PP9FrameClass",NULL);//Set it to foregroundppoint_win->SetForegroundWindow()    


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]

This topic is closed to new replies.

Advertisement