Thread: RE: [GD-Windows] os version
Brought to you by:
vexxed72
From: Brian S. <bs...@mi...> - 2002-02-12 01:43:17
|
GetVersionEx(). Obligatory warning: You should ask yourself why you're looking for this = information. Logging the info to a file is fine. Making assumptions = based on the installed version of the OS is really bad, and will break = later. Remember how all those games that should have worked with = Windows 2000 didn't, because people checked for (NT =3D=3D true) instead = of just seeing if they could create their Direct3D devices? --brian > -----Original Message----- > From: Ignacio Casta=F1o [mailto:cas...@ya...] > Sent: Monday, February 11, 2002 5:36 PM > To: gam...@li... > Subject: [GD-Windows] os version >=20 > Hi, > I want to obtain the windows version my app is running on. I just want = to > distinguish between win9x, nt4 sp2 or previous, and nt4 sp3 or win2k = and > next. Could somebody point out how to do that? >=20 > Thanks in advance, >=20 > Ignacio Casta=F1o > ca...@as... |
From: Nathan R. <Nat...@te...> - 2002-02-12 01:44:58
|
Use GetVersionEx() The szCSDVersion member will tell you what service pack, OSR, etc. A = search on MSDN should be able to tell you the rest of what you need to know. -----Original Message----- From: Ignacio Casta=F1o [mailto:cas...@ya...] Sent: Monday, February 11, 2002 7:36 PM To: gam...@li... Subject: [GD-Windows] os version Hi, I want to obtain the windows version my app is running on. I just want = to distinguish between win9x, nt4 sp2 or previous, and nt4 sp3 or win2k = and next. Could somebody point out how to do that? Thanks in advance, Ignacio Casta=F1o ca...@as... _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com _______________________________________________ Gamedevlists-windows mailing list Gam...@li... https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows Archives: http://sourceforge.net/mailarchive/forum.php?forum_id=3D555 |
From: Brian S. <bs...@mi...> - 2002-02-12 02:04:54
|
The official stance is you can't disable it, so don't even try. = Unofficially, I know you can block it in some cases, but I still don't = think you can disable it in all cases on 2000/XP. And your users don't = really want you to disable it anyway. They want you to deactivate the = windows key so they don't hit that in a game, but people like to be able = to alt-tab away if they need to. Possibly Quake tears down everything when it loses focus - releases all = textures and shuts down GL - and then starts everything back up when it = gets focus back. That seems like a safe approach, at least. =20 They released the source to Quake 1, so you could look there... http://www.idsoftware.com/archives/sourcearc.html --brian > -----Original Message----- > From: Ignacio Casta=F1o [mailto:cas...@ya...] > Sent: Monday, February 11, 2002 5:55 PM > To: gam...@li... > Subject: Re: [GD-Windows] os version >=20 > Brian Sharon wrote: > > GetVersionEx(). > > > > Obligatory warning: You should ask yourself why you're looking for = this > > information. Logging the info to a file is fine. Making = assumptions > based > > on the installed version of the OS is really bad, and will break = later. > > Remember how all those games that should have worked with Windows = 2000 > > didn't, because people checked for (NT =3D=3D true) instead of just = seeing > if > > they could create their Direct3D devices? >=20 > Hmm... I just want to disable Alt+tab and other task switching keys, > according to the msdn there are three different methods depending on = the > windows version. Task switching is broken with some opengl drivers and = we > want to disable it if possible. Is there any other method that works = on > multiple windows versions? Quake3 and derivates seem to handle that > without > problems... |
From: Brian H. <bri...@py...> - 2002-02-12 02:10:40
|
> The official stance is you can't disable it, so don't even > try. Unofficially, I know you can block it in some cases, > but I still don't think you can disable it in all cases on > 2000/XP. Something to do with setting the screensaver system property. I actually wrote that code in Q2, but that was a long ass time ago. > And your users don't really want you to disable it > anyway. Yes, they do -- when they remap left alt to strafe left and "tab" to switch weapons, it gets old. Quickly. In a fullscreen game, you're not alt-tabbing away. Also, I was under the impression that D3D exclusive mode disabled alt-tab? Brian |
From: Jon W. <hp...@mi...> - 2002-02-12 02:17:06
|
I really hate it when I can't tab out to check a web page or something. EverQuest just made it impossible to lose focus. In camelot, it's possible to lose focus (say, if Outlook is being helpful and reminding you about something) but when you try to get back in, you just get a "lost surface" error message and it shuts down. Even playing UT or Q3 I might want to do this -- especially when waiting to respawn :-) Getting switch-out to work is not so very hard -- I really think any Windows program (game or not) should support it. If the user wants to alt-tab to strafe/select then provide an optional check-box to disable switching. Cheers, / h+ > -----Original Message----- > From: gam...@li... > [mailto:gam...@li...]On Behalf Of > Brian Hook > Sent: Monday, February 11, 2002 6:11 PM > To: gam...@li... > Subject: RE: [GD-Windows] os version > > > > The official stance is you can't disable it, so don't even > > try. Unofficially, I know you can block it in some cases, > > but I still don't think you can disable it in all cases on > > 2000/XP. > > Something to do with setting the screensaver system property. I > actually wrote that code in Q2, but that was a long ass time ago. > > > And your users don't really want you to disable it > > anyway. > > Yes, they do -- when they remap left alt to strafe left and "tab" to > switch weapons, it gets old. Quickly. > > In a fullscreen game, you're not alt-tabbing away. Also, I was under > the impression that D3D exclusive mode disabled alt-tab? > > Brian > > > _______________________________________________ > Gamedevlists-windows mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=555 > |
From: <cas...@ya...> - 2002-02-12 02:35:06
|
Jon Watte wrote: > I really hate it when I can't tab out to check a web page or something. > EverQuest just made it impossible to lose focus. In camelot, it's possible > to lose focus (say, if Outlook is being helpful and reminding you about > something) but when you try to get back in, you just get a "lost surface" > error message and it shuts down. > Even playing UT or Q3 I might want to do this -- especially when waiting > to respawn :-) I agree with you, however some ogl drivers go mad when task switching, and others work fine, I will have to doublecheck that but in other mailing list ;-) Anyway shuting down and restoring, as Brian Sharon mentioned should always be safe, and I still prefer a menu option or a customized key to do that, than an easy combination like alt+tab that you can mis press while playing. Ignacio Castaño ca...@as... _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com |
From: <cas...@ya...> - 2002-02-12 02:35:34
|
Jon Watte wrote: > I really hate it when I can't tab out to check a web page or something. > EverQuest just made it impossible to lose focus. In camelot, it's possible > to lose focus (say, if Outlook is being helpful and reminding you about > something) but when you try to get back in, you just get a "lost surface" > error message and it shuts down. > Even playing UT or Q3 I might want to do this -- especially when waiting > to respawn :-) I agree with you, however some ogl drivers go mad when task switching, and others work fine, I will have to doublecheck that but in other mailing list ;-) Anyway shuting down and restoring, as Brian Sharon mentioned should always be safe, and I still prefer a menu option or a customized key to do that, than an easy combination like alt+tab that you can mis press while playing. Ignacio Castaño ca...@as... _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com |
From: <cas...@ya...> - 2002-02-12 02:34:41
|
Brian Hook wrote: > Something to do with setting the screensaver system property. I > actually wrote that code in Q2, but that was a long ass time ago. hey! WIN_DisableAltTab and WIN_EnableAltTab do all the job. You used SystemParametersInfo with SPI_SCREENSAVERRUNNING on win9x and RegisterHotKey on winnt, I've just tested that and seems to work fine. Ignacio Castaño ca...@as... _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com |
From: Tom H. <to...@3d...> - 2002-02-12 02:15:48
|
At 06:04 PM 2/11/2002, Brian Sharon wrote: >The official stance is you can't disable it, so don't even >try. Unofficially, I know you can block it in some cases, but I still >don't think you can disable it in all cases on 2000/XP. And your users >don't really want you to disable it anyway. They want you to deactivate >the windows key so they don't hit that in a game, but people like to be >able to alt-tab away if they need to. Correct. Don't disable these things, but make your game handle them properly. Everquest (for example) goes to great lengths to prevent you from tabbing out because they don't want you to be able to run things like SoftIce, but the end result is that if you hit the Windows key on 2k (something you _can't_ block) or some other window like AIM or ICQ pops up in front then the game crashes. >Possibly Quake tears down everything when it loses focus - releases all >textures and shuts down GL - and then starts everything back up when it >gets focus back. That seems like a safe approach, at least. When you're in full screen and lose focus the "right" thing to do is restore the display mode and minimize the app. Doing this screws up your context so you have to release all the textures and any AGP/Vidmem vertex buffers and recreate them when you restore the context. It isn't pleasant, but it's the only thing you can do and still get reliable behavior. Tom |
From: Philip T. <pt...@mi...> - 2002-02-12 02:23:51
|
> -----Original Message----- > From: Brian Hook [mailto:bri...@py...] > Sent: Monday, February 11, 2002 6:11 PM > To: gam...@li... > Subject: RE: [GD-Windows] os version >=20 >=20 > > The official stance is you can't disable it, so don't even=20 > > try. Unofficially, I know you can block it in some cases,=20 > > but I still don't think you can disable it in all cases on=20 > > 2000/XP. >=20 > Something to do with setting the screensaver system property. I > actually wrote that code in Q2, but that was a long ass time ago. >=20 > > And your users don't really want you to disable it=20 > > anyway. >=20 > Yes, they do -- when they remap left alt to strafe left and "tab" to > switch weapons, it gets old. Quickly. >=20 > In a fullscreen game, you're not alt-tabbing away. Also, I was under > the impression that D3D exclusive mode disabled alt-tab? no, the D3D runtime does not disable alt-tab when in fullscreen. >=20 > Brian >=20 >=20 > _______________________________________________ > Gamedevlists-windows mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=3D555 >=20 |
From: Rich <leg...@xm...> - 2002-02-12 02:49:12
|
In article <001c01c1b368$4aab5e40$7f55533e@aurora>, =?iso-8859-1?Q?Ignacio_Casta=F1o?= <cas...@ya...> writes: > Hmm... I just want to disable Alt+tab and other task switching keys, Windows is not a Console system. You don't own the OS, the user owns the OS. Just deal with task switching and don't bother coding all kinds of buggy OS version code. If the user wants to task switch away from your application, who are you to defy the user? -- Ask me about my upcoming book on Direct3D from Addison-Wesley! Direct3D Book <http://www.xmission.com/~legalize/book/> Don't Support Spammers! Boycott Fractal Painter 7! <http://www.xmission.com/~legalize/spammers.html> |
From: Matt D. <ma...@co...> - 2002-02-12 10:32:23
|
I must say I completely agree with Rich. I am so tired of games that crash when I try to Alt-TAB to another application like my mail client. Well done to games like System Shock 2 and Diablo II that pause the game automatically and handle it properly. In Diablo II I occasionally press TAB (for the map) and ALT (for seeing items) at the same time and switch out, but since the game is paused its harmless and much more preferable to not being able to task switch or, even worse, to crashing. If I really didn't like it, I could redefine the controls so I didn't have to use TAB anyway. Matt Davies Programmer, Confounding Factor ma...@co... www.confounding-factor.com > -----Original Message----- > From: gam...@li... > [mailto:gam...@li...]On Behalf Of > Rich > Sent: 12 February 2002 02:49 > To: gam...@li... > Subject: Re: [GD-Windows] os version > > > > In article <001c01c1b368$4aab5e40$7f55533e@aurora>, > =?iso-8859-1?Q?Ignacio_Casta=F1o?= <cas...@ya...> writes: > > > Hmm... I just want to disable Alt+tab and other task switching keys, > > Windows is not a Console system. You don't own the OS, the user owns > the OS. Just deal with task switching and don't bother coding all > kinds of buggy OS version code. If the user wants to task switch away > from your application, who are you to defy the user? > -- > Ask me about my upcoming book on Direct3D from Addison-Wesley! > Direct3D Book <http://www.xmission.com/~legalize/book/> > Don't Support Spammers! Boycott Fractal Painter 7! > <http://www.xmission.com/~legalize/spammers.html> > > _______________________________________________ > Gamedevlists-windows mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=555 |
From: Rich <leg...@xm...> - 2002-02-12 02:49:34
|
In article <002401c1b36a$7614e270$0101a8c0@HOOKDELL220>, Brian Hook <bri...@py...> writes: > In a fullscreen game, you're not alt-tabbing away. Yes, I am. -- Ask me about my upcoming book on Direct3D from Addison-Wesley! Direct3D Book <http://www.xmission.com/~legalize/book/> Don't Support Spammers! Boycott Fractal Painter 7! <http://www.xmission.com/~legalize/spammers.html> |
From: Brian H. <bri...@py...> - 2002-02-12 02:57:28
|
Oh, hey, that sounds familiar! =) Can you post that code, by any chance? I'm actually working on a game for infants/toddlers that needs to have "button mash" mode enabled, i.e. they have to be able to hit ANYTHING except ctrl-alt-delete. The Win key completely screws up this kind of "game". A code snippet to disable all keys on all Windows variants would actually be something very useful for the archives. > hey! > WIN_DisableAltTab and WIN_EnableAltTab do all the job. You > used SystemParametersInfo with SPI_SCREENSAVERRUNNING on > win9x and RegisterHotKey on winnt, I've just tested that and > seems to work fine. |
From: <cas...@ya...> - 2002-02-12 17:53:06
Attachments:
Win32TaskSwitch.cpp
|
Brian Hook wrote: > Oh, hey, that sounds familiar! =) > > Can you post that code, by any chance? I'm actually working on a game > for infants/toddlers that needs to have "button mash" mode enabled, i.e. > they have to be able to hit ANYTHING except ctrl-alt-delete. The Win > key completely screws up this kind of "game". Do you want me to post your code?? The os detection is in quake2/win32/sys_win.c function Sys_Init, line 234 The mentioned functions are in quake2/win32/vid_dll.c lines 68 & 87 I've attached my own version that includes other key variants and a different method mentioned in the msdn. > A code snippet to disable all keys on all Windows variants would > actually be something very useful for the archives. I agree, but it seems that you cannot do that with windows keys under win2k :-( Ignacio Castaño ca...@as... |
From: Tom F. <to...@mu...> - 2002-02-12 11:09:00
|
Agreed. Make it a user-selectable option to disable Windows keys (I think I've seen maybe two games with this - far too low a number), and _even if it's selected_, handle loss of focus properly. I've lost count of the number of games that have died because they gently prodded the internet, at which point ZoneAlarm pops up and says "this program wants to talk to the net - do you want it to let it?", forcing an Alt+Tab type behaviour which for most apps toasts the machine (on Win98 - Win2k is much better at recovering without a BSOD). -Allow Alt+Tab, Ctrl+Alt+Delete, Windows key, etc. -Give users an option to tick to disable the keys. -Always handle loss of focus even if they tick the option. This topic always causes flame wars. :-) Tom Forsyth - Muckyfoot bloke. What's he up to now (and can I have a go)? http://www.eidosinteractive.com/downloads/search.html?gmid=86 > -----Original Message----- > From: Matt Davies [mailto:ma...@co...] > Sent: 12 February 2002 10:29 > To: Rich; gam...@li... > Subject: RE: [GD-Windows] os version > > > I must say I completely agree with Rich. I am so tired of > games that crash > when I try to Alt-TAB to another application like my mail > client. Well done > to games like System Shock 2 and Diablo II that pause the > game automatically > and handle it properly. In Diablo II I occasionally press > TAB (for the map) > and ALT (for seeing items) at the same time and switch out, > but since the > game is paused its harmless and much more preferable to not > being able to > task switch or, even worse, to crashing. If I really didn't > like it, I > could redefine the controls so I didn't have to use TAB anyway. > > > Matt Davies > Programmer, Confounding Factor > ma...@co... > www.confounding-factor.com > > > > > -----Original Message----- > > From: gam...@li... > > [mailto:gam...@li...]On > Behalf Of > > Rich > > Sent: 12 February 2002 02:49 > > To: gam...@li... > > Subject: Re: [GD-Windows] os version > > > > > > > > In article <001c01c1b368$4aab5e40$7f55533e@aurora>, > > =?iso-8859-1?Q?Ignacio_Casta=F1o?= <cas...@ya...> writes: > > > > > Hmm... I just want to disable Alt+tab and other task > switching keys, > > > > Windows is not a Console system. You don't own the OS, the > user owns > > the OS. Just deal with task switching and don't bother coding all > > kinds of buggy OS version code. If the user wants to task > switch away > > from your application, who are you to defy the user? > > -- > > Ask me about my upcoming book on Direct3D from Addison-Wesley! > > Direct3D Book <http://www.xmission.com/~legalize/book/> > > Don't Support Spammers! Boycott Fractal Painter 7! > > <http://www.xmission.com/~legalize/spammers.html> > > > > _______________________________________________ > > Gamedevlists-windows mailing list > > Gam...@li... > > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > > Archives: > > http://sourceforge.net/mailarchive/forum.php?forum_id=555 > > > _______________________________________________ > Gamedevlists-windows mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=555 > |
From: Pierre T. <p.t...@wa...> - 2002-02-12 13:30:56
|
> This topic always causes flame wars. :-) Yeah and it's boring. Someone cool should write the painful code once and for all, put it somewhere on the net, answer the question in some FAQ, end of story. Thinking about it, maybe R. Dunlop already has something related on his site. Else it would be a nice new article to write. Gonna check. |
From: Jon W. <hp...@mi...> - 2002-02-12 18:17:12
|
The problem is that the painful code is rather tightly integrated with your texture management and render target system. Restoring lost surfaces, re-loading texture image and whatnot is not exactly the kind of code that you can slap in an FAQ :-( Cheers, / h+ > > This topic always causes flame wars. :-) > > Yeah and it's boring. Someone cool should write the painful code once and > for all, put it somewhere on the net, answer the question in some FAQ, end > of story. |
From: Pierre T. <p.t...@wa...> - 2002-02-12 18:37:53
|
Sure but I was thinking of something more like pseudo-code for those parts. Exactly like what you wrote : "here, restore lost surfaces, re-load textures, etc". Oh, well. ----- Original Message ----- From: Jon Watte <hp...@mi...> To: <gam...@li...> Sent: Tuesday, February 12, 2002 7:17 PM Subject: RE: [GD-Windows] os version > > The problem is that the painful code is rather tightly integrated > with your texture management and render target system. Restoring > lost surfaces, re-loading texture image and whatnot is not exactly > the kind of code that you can slap in an FAQ :-( > > Cheers, > > / h+ > > > > This topic always causes flame wars. :-) > > > > Yeah and it's boring. Someone cool should write the painful code once and > > for all, put it somewhere on the net, answer the question in some FAQ, end > > of story. > > > > _______________________________________________ > Gamedevlists-windows mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=555 |
From: Tom F. <to...@mu...> - 2002-02-12 13:53:09
|
I suspect the DX FAQ's opinion on this this could be expanded slightly: Q: How do I disable ALT+TAB and other task switching? A: You don't. Really. (http://msdn.microsoft.com/library/techart/DirectX8faq.htm) It's absolutely correct of course. The fundamental problem is that the number of apps that don't handle loss of focus correctly is huge, and they really don't want to encourage people to continue this sort of lazy coding by letting them delude themselves that you can actually prevent loss of focus. You can see where they're coming from. Sounds like something suitable for a Games Programming Gem or a Gamasutra article to me. Tom Forsyth - purely hypothetical Muckyfoot bloke. This email is the product of your deranged imagination, and does not in any way imply existence of the author. > -----Original Message----- > From: Pierre Terdiman [mailto:p.t...@wa...] > Sent: 12 February 2002 13:27 > To: gam...@li... > Subject: Re: [GD-Windows] os version > > > > This topic always causes flame wars. :-) > > Yeah and it's boring. Someone cool should write the painful > code once and > for all, put it somewhere on the net, answer the question in > some FAQ, end > of story. > > Thinking about it, maybe R. Dunlop already has something > related on his > site. Else it would be a nice new article to write. Gonna check. > > > _______________________________________________ > Gamedevlists-windows mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=555 > |
From: <cas...@ya...> - 2002-02-12 17:27:40
|
Jon Watte wrote: > I am surprised by that. Well, as long as it isn't ATI drivers. > Many OGL programs (like Maya, or 3DSMax, or ...) will not work > well if you have those kinds of bugs. yes, it's with ATI drivers only. Ignacio Castaño ca...@as... _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com |
From: <cas...@ya...> - 2002-02-12 01:48:18
|
Brian Sharon wrote: > GetVersionEx(). > > Obligatory warning: You should ask yourself why you're looking for this > information. Logging the info to a file is fine. Making assumptions based > on the installed version of the OS is really bad, and will break later. > Remember how all those games that should have worked with Windows 2000 > didn't, because people checked for (NT == true) instead of just seeing if > they could create their Direct3D devices? Hmm... I just want to disable Alt+tab and other task switching keys, according to the msdn there are three different methods depending on the windows version. Task switching is broken with some opengl drivers and we want to disable it if possible. Is there any other method that works on multiple windows versions? Quake3 and derivates seem to handle that without problems... Ignacio Castaño ca...@as... _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com |