I feel like I'm commiting a cardinal sin by asking how to do this becuase in most instances it would be wrong and evil. But...
I have a winforms app that minimises to the systray when not being used I want to make it pop up and be the topmost window when it recieves a message from a server.
I can make it appear, but I can't get it to be the topmost window. (Setting topmost doesn't change it, but it does make it topmost once it's gained focus)
Does anyone know how to do this?, I wouldn't normally do this but a client has asked for this behavious so I have to implement it... :(
-
If .Net's 'topmost' thing is not working, you may try getting this service directly from the 'SetWindowPos()' API of Windows. See this page for details.
-
There is a post around this issue on Microsoft's forums.
Normally, if the window is in your app, calling its BringToFront method should do the trick.
So normal order of operations:
- make it visible
- call BringToFront()
- Set it TopMost
Omar Kooheji : That doesn't work if your whole app is minimised, it probably only works if one of your own windows currently has focus.
0 comments:
Post a Comment