Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


Alt-Tab working... just not perfectly


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
10 replies to this topic

#1 Blazeroni   Members   -  Reputation: 122

Like
Likes
Like

Posted 25 November 2001 - 03:11 PM

Hey everyone, I have ALT-TAB working for my program in a functional sense. You can alt-tab back and forth and everything works fine. My problem is that I''m not satisfied with the alt-tab sequence. I get the "alt-tab window" (the one where you get to choose what application you are going to) except that it doesn''t always appear above my application. Sometimes it does, other times not. I''ve noticed that when you press alt-tab in commercial games they don''t give you the "alt-tab window". Instead, they just minimize and go back to the whatever was last activated. But, I realize that most, if not all, the games I''ve tested for this are DX games. Is this functionality available to OGL? Or barring that, is there a way to make the "alt-tab window" always appear in on top. Or is it possible to set up DX and then use OGL on top of that to get the desired affect? Thanks all. Blazeroni

Sponsor:

#2 Obelix   Members   -  Reputation: 122

Like
Likes
Like

Posted 25 November 2001 - 05:32 PM

I think that the games is using win32 API calls for this and not DX. Without checking do I think that this can be done also if you are using GLUT.

#3 Blazeroni   Members   -  Reputation: 122

Like
Likes
Like

Posted 25 November 2001 - 07:59 PM

What Win32 API calls? As far as I know, the only call that affects ALT-TAB is SystemParametersInfo which can only disable ALT-TAB. Also, I''m not using GLUT, nor do I plan on doing so.

If anyone knows of any tutorials that show what I''m trying to do, please let me know. Thanks.

Blazeroni

#4 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 25 November 2001 - 10:02 PM

I haven''t tried this but I am sure it will work (does in non game-apps).

You want to call ShowWindow(HWND,nCmdShow). I would use it with either the SW_MINIMIZE or SW_SHOWMINIMIZED flag - I dont remember which was the better alternative. When you want to "alt-tab" back, you will need to call it again with SW_RESTORE or SW_SHOWNORMAL.

Look up the API on the MSDN site to get the other options available - with a little experimentation it should work well.

#dth-0

#5 Fruny   Moderators   -  Reputation: 1653

Like
Likes
Like

Posted 25 November 2001 - 10:16 PM

Look at the documentation on low-level hooks (and hooks in general).

#6 DigitalBlur   Members   -  Reputation: 122

Like
Likes
Like

Posted 25 November 2001 - 10:21 PM

Most DirectX games do not display the Alt-Tab dialog because they setup the screen resolution through direct draw using exclusive mode (via SetCooperativeMode function). This how ever disables all drawing on the screen with the exception of your program (hence exclusive).

This can can be done using OpenGL by setting the screen resolution using DirectDraw rather then win32 API calls. You can even use dynamic linking with the DirectDraw dll to do this and if it does not work then revert to the win32 calls at run time.

As for the Alt-Tab dialog appearing only now and then, the only thing I can think of is that you only have one other program running. If this is the case then windows will automatically switch to that program rather then displaying the dialog.

Hope this helps

-DigitalBlur

#7 Blazeroni   Members   -  Reputation: 122

Like
Likes
Like

Posted 26 November 2001 - 06:48 AM

Thanks DigitalBlur - that worked, and it was a lot less of a pain than I thought it would be.

As for the alt-tab window appearing sometimes with OGL, its not that it didn''t appear, its that the window was corrupted by what was under it - what was under it would draw on top of the window. But, it''s moot now, since it works fine when combined with DX.

Thanks again.

Blazeroni


#8 Obelix   Members   -  Reputation: 122

Like
Likes
Like

Posted 26 November 2001 - 03:07 PM

If you are going to distribute your program is it a bad idea to use DirectDraw since this will not work for all cards. See the OpenGL FAQ.
Does not Windows send any message before the "alt-tab window" is displayed? You can also try to search the MSDN web site.

#9 avianRR   Members   -  Reputation: 100

Like
Likes
Like

Posted 26 November 2001 - 03:36 PM

Just a thought, the windows message WM_SYSKEYDOWN is sent whenever the alt key is pressed or when alt-something is pressed. Why not check for alt-tab and then minimize your window before passing the message on to DefaultWindowProc()?
Haven''t tryed it but it might work.

#10 Mayrel   Members   -  Reputation: 348

Like
Likes
Like

Posted 27 November 2001 - 03:23 AM

quote:
Original post by avianRR
Just a thought, the windows message WM_SYSKEYDOWN is sent whenever the alt key is pressed or when alt-something is pressed. Why not check for alt-tab and then minimize your window before passing the message on to DefaultWindowProc()?
Haven''t tryed it but it might work.


I was just thinking that. You''d have to disable Windows'' alt-tab handling: I think that, normally, Windows wouldn''t send notification about alt-tab to a window because if it locked up, you wouldn''t be able to alt-tab away from it.


Just Plain Wrong

#11 wolfman8k   Members   -  Reputation: 140

Like
Likes
Like

Posted 29 November 2001 - 06:55 AM

This thread reminds me of how happy I am now that I''m not using windows.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS