Sign in to follow this  
JD_DX9

DX9 fullscreen window always on top?

Recommended Posts

Firstly, can I just add that this is a fantastic forum. Although I've only just signed up, I've searched through it many times during the last eight months during which I have been learning DirectX 9 and VB.NET (I would have rather used C++ or C#, but unfortunately have a lot of code already in VB6 so it's easier to translate). My application uses the Feb 2005 DirectX 9 SDK and VB.NET 2003. The application isn't really a game, but a promotional tool which displays graphics using DirectX on the PC screen in fullscreen mode. The PC is hooked up TV adapter and the images shown on TV screens throughout a venue. The problem I have is that I loose the DirectX screen (D3DERR_DEVICELOST) when my application runs a third-party application periodically to retrieve data to be displayed. I can catch the D3DERR_DEVICELOST and reset the device restoring my graphics, however I don't wish to display the Windows desktop at any point (it will always minimize my application), I want the third-party application to run in the background of my DirectX screen. I believe I have one of two possible options; 1) Force the DirectX fullscreen mode to be always on top in some way, this will probably stop things like Alt+Tab, which isn't a bad thing for what this application is doing. Can this be done? The obvious things like the topmost setting for the form don't help in fullscreen mode. 2) This one's not so relvant to this section of the forum, but somehow run the third-party application in a way that doesn't cause it to take focus or cause it to run completely silently. To complicate matters, the DLL that calls the third-party applications is written in VB6 presently (it's too big to translate to .NET quickly and easily), so a solution for this part would most probably have to be written in VB6. Sorry for the fairly lengthy post, I hope that someone can give me some idea's to this problem.

Share this post


Link to post
Share on other sites
Hi there JD_DX9,
How are you doing?

You might try a couple of things... some guys in here have a very extensive knowledge of how the window environment works.

[Possible suggestions]
1) If this 3rd party app isn't so difficult, maybe you can incorporate the functionality within your app. Rewrite the app in a sense
2) Call The app from within your DirectX App
3) Open the app in a minimized form.

Most of these suggestions really depends on what the app does. Maybe the user needs to click some buttons in this app or whatever. This all depends.

Share this post


Link to post
Share on other sites
Thanks for the replies.

The third party applications do not require any input and they are not DirectX applications, they just gather files, often in CSV format. I am starting the applications minimized, but they still get focus as they start and appear on the taskbar, thus causing my fullscreen DirectX application to minimize.

I have the DirectX 9 application (written in VB.NET) which calls (in a new thread) one of my DLL's (written in VB6) for communication with external hardware or databases. In some instances it communicates directly causing no problem, but some hardware systems use a third-party application to gather the data. It isn't possible for me to rewrite the third-party applications, the protocol information required is not available for me to communicate with the hardware directly. The third-party applications can also be either DOS or Windows based.

Rather than the code being in the DirectX application, it's a DLL due to it being shared by several applications. The DLL is also processing the data received from the third-party applications.

I've decided to go with DirectX in this application as previously the graphics were done using basic text and pictureboxes in VB6, which looked like it had been done using Powerpoint! With a standard VB6 form I was able to force it using some API calls to always stay on top, even if it didn't have focus. The same doesn't work for fullscreen DirectX.

Share this post


Link to post
Share on other sites
Since you control the pc that this is running on, I'd recommend this:

Set your desktop to be the resolution and depth that you want the app to run in. Run in Windowed mode, with a borderless window created with the TopMost flag set. This way you get the appearance of fullscreen but the additional flexibility of windowed mode.

I've done this for kiosk-like programs and it works very well.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this