Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Topmost Window - Advanced

Status
Not open for further replies.

Robse

Programmer
Apr 28, 2003
28
DE
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.
 
I'm not sure...how can I find out?
 
Ah - you didn't write it?

In which case you are probably out of luck
 
I think TSO may use DirectX, but TSDisplay isn't
 
No.

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.
 
Yes I read the forum. Well anyhow both DO _EXACTLY_ what I was planning on doing.

BTW You also get the effect with some other programs, the Trillian popup windows f.e., show through in some games.

There's also the Generic Proxy DLL approach but that doesn't seem to work for me, plus there's other issues.

So how can I directly overlay the graphics surface?
 
>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

working fine now.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top