🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #17239

Re: ALT+TAB Detection

#17239
From: Stephane Baillargeon
Date: Mon, 31 Mar 2003 12:39
43 lines
2536 bytes
Thanks alot. Really appreciated.

"Early Ehlinger" <early@respower.com> wrote in message
news:3e86159e@newsgroups.borland.com...
> "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: <3e883764@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!peernews-us.colt.net!newsfeed.news2me.com!ken-transit.news.telstra.net!news.telstra.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <3e81c096@newsgroups.borland.com> <3e86159e@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-31 04:44:17 PST
From: "Stephane Baillargeon" <sbaillargeon@microids.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3e81c096@newsgroups.borland.com> <3e86159e@newsgroups.borland.com>
Subject: Re: ALT+TAB Detection
Date: Mon, 31 Mar 2003 07:39:29 -0500
Lines: 45
Organization: Microids Canada
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: 65.94.161.19
Message-ID: <3e883764@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1049114468 65.94.161.19 (31 Mar 2003 04:41:08 -0800)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!peernews-us.colt.net!newsfeed.news2me.com!ken-transit.news.telstra.net!news.telstra.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail