Article View: borland.public.cppbuilder.nativeapi
Article #17222Re: ALT+TAB Detection
From: Early Ehlinger
Date: Sat, 29 Mar 2003 21:52
Date: Sat, 29 Mar 2003 21:52
34 lines
2209 bytes
2209 bytes
"Stephane Baillargeon" <sbaillargeon@microids.com> wrote:
> Is there a way to detect the ALT+TAB app switcher and control it?
>
> We want the user to be able to hit the ALT+TAB keys in order to
> change the current task. Is there a way to detect this combination
> of keys in a WinAPI point of view and stop the task switch
> momentarly to do some proccessing like stopping the
> game's threads?
I think the answer is no, but that's not to say you can't have the same
effect :)
From MSDN:
The WM_ACTIVATEAPP message is sent when a
window belonging to a different application
than the active window is about to be activated.
The message is sent to the application whose
window is being activated and to the application
whose window is being deactivated.
wParam
Specifies whether the window is being activated or
deactivated. This parameter is TRUE if the window
is being activated; it is FALSE if the window is
being deactivated.
So all you need to do is catch WM_ACTIVATEAPP. If wParam is TRUE, resume all
your threads. Otherwise, suspend them.
--
-- Early Ehlinger CEO, ResPower Inc - Toll-Free : 866-737-7697
-- www.respower.com -- 500+ GHz Supercomputer Starting At USD$0.50/GHz*Hour
Technical Details
Message-ID:
<3e86159e@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!priapus.visi.com!news-out.visi.com!petbe.visi.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mailReferences:
<3e81c096@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,ed76e0ba65fedfe4 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-03-29 13:57:45 PST From: "Early Ehlinger" <early@respower.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <3e81c096@newsgroups.borland.com> Subject: Re: ALT+TAB Detection Date: Sat, 29 Mar 2003 15:52:24 -0600 Lines: 37 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 NNTP-Posting-Host: 206.166.224.226 Message-ID: <3e86159e@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1048974750 206.166.224.226 (29 Mar 2003 13:52:30 -0800) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!priapus.visi.com!news-out.visi.com!petbe.visi.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail