What do I need to do to make my Form always on top, even when a DirectX Application (Game) is running? When I use SetWindowPos then my Form flickers and is barely readable.
1) TSO doe not work via a GDI window. It works by directly overlaying the graphics surface'
2) TSDisp only works properly with OpenGL games. it suffers exactly the same problems with flickering as you describe when used with full-screen, exclusive mode DirectX applications (a very quick search on the home sites forums reveals this).
The basic reason is that GDI (normal windows) and exclusive mode DirectX do not get on with each other. Hence the existence of coop mode (and hence why I asked about this to start off with), but few games will full-screen mode DirectX apps will be in coop mode, since it is slower.
>So how can I directly overlay the graphics surface?
Step 1.
Learn how to use DirectX
Step 2.
From VB
Then what you have to do is be able to determine the active DirectX surface (the primary surface), and then render via DirectX what you want to appear onto that surface. Of course, if they are using backbuffers (which they almost certainly will be), you probably actually want to render to the backbuffer rather than the primary.
This was my mistake. I forgot that I was also using SetLayeredWindowAttributes for transparency. After I removed that, a single Call is all that was necessary:
SetWindowPos Me.hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE Or SWP_SHOWWINDOW Or SWP_NOMOVE Or SWP_NOSIZE
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.