Article View: borland.public.cppbuilder.nativeapi
Article #8449Re: Enable or disable ALT+TAB fast task switching under XP
From: JF Jolin
Date: Mon, 25 Oct 2004 01:29
Date: Mon, 25 Oct 2004 01:29
92 lines
3084 bytes
3084 bytes
Your application can catch Alt+Tab with
RegisterHotKey( Handle, idAltTabKey, MOD_ALT, VK_TAB ) not
RegisterHotKey( Handle, idAltTabKey, MOD_ALT, VK_BACK )
under WM_HOTKEY you will have it with
UINT fuModifiers = (UINT) LOWORD(lParam); // key-modifier flags
UINT uVirtKey = (UINT) HIWORD(lParam); // virtual-key code
if (fuModifiers == MOD_ALT && uVirtKey == VK_TAB) // Alt+Tab
SystemParametersInfo(SPI_SCREENSAVERRUNNING... Windows 95 only not XP !!
--
JF Jolin
[Montreal, Canada]
22 Oct 2004 16:46:44 +0200, Paolo Borlandi a �crit:
> No, I exactly mean the SPI_SCREENSAVERRUNNING parameter which can disable
> also CTRL+ALT+DEL and CTRL+ESC.
>
> I tested what you have explained but with no success. I have declared the
> Hotkey and then I tried to catch it by the WM_HOTKEY message in WndProc
> function:
>
>
> RegisterHotKey( Handle, idAltTabKey, MOD_ALT, VK_BACK );
>
> ...
>
> void __fastcall TFMain::WndProc(Messages::TMessage &Message)
> {
> switch ( Message.Msg ) {
> case WM_HOTKEY:
>
> ....
> ....
>
> break;
> default:
> TForm::WndProc(Message);
> break;
> }
> }
>
> ...
>
>
> Is there anything wrong?
>
> Thank YOU!
>
>
>
> "JF Jolin" <jfj@nospam.com> ha scritto nel messaggio
> news:opsf6p1crtz6rw7b@newsgroups.borland.com...
>> Le Wed, 20 Oct 2004 17:25:42 +0200, Paolo Borlandi
>> <pborlandi@virgilio.it>
>> a �crit:
>>
>> > Hi All
>> >
>> > Is it possible to enable or disable ALT+TAB fast task switching under
>> > windows XP. I do it in Win98 by this function
>> >
>> > SystemParametersInfo( SPI_SCREENSAVERRUNNING,(WORD)!Enabled,&OldVal,0)
>> ;
>> >
>> >
>> > THANK YOU VERY MUCH!!!
>> >
>> > Paolo from Italy
>> >
>> >
>> >
>>
>> You probably meant SPI_SETFASTTASKSWITCH (obsolete) instead of
>> SPI_SCREENSAVERRUNNING.
>>
>> With RegisterHotKey(hWnd, idAltTabKey, MOD_ALT, VK_TAB )
>> you can attach behavior of ALt+Tab to current application.
>>
>> Do not forget UnregisterHotKey when leaving.
>>
>>
>> -- JF Jolin
>> [Montreal, Canada]
Technical Details
Message-ID:
<opsgejq9y7z6rw7b@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!news-out.visi.com!transit-1.news.visi.com!news-out1.nntp.be!propagator2-sterling!news-in-sterling.newsfeeds.com!in.nntp.be!caladan.arrakis.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<4176832d@newsgroups.borland.com> <opsf6p1crtz6rw7b@newsgroups.borland.com> <41791d14$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,505a9d8127706b03 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: Enable or disable ALT+TAB fast task switching under XP References: <4176832d@newsgroups.borland.com> <opsf6p1crtz6rw7b@newsgroups.borland.com> <41791d14$1@newsgroups.borland.com> Message-ID: <opsgejq9y7z6rw7b@newsgroups.borland.com> Content-Type: text/plain; charset=iso-8859-15; format=flowed From: JF Jolin <jfj@nospam.com> MIME-Version: 1.0 Date: Sun, 24 Oct 2004 21:29:23 -0400 User-Agent: Opera7.11/Win32 M2 build 2887 NNTP-Posting-Host: 66.158.141.151 X-Trace: newsgroups.borland.com 1098667762 66.158.141.151 (24 Oct 2004 18:29:22 -0700) Lines: 92 Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!news-out.visi.com!transit-1.news.visi.com!news-out1.nntp.be!propagator2-sterling!news-in-sterling.newsfeeds.com!in.nntp.be!caladan.arrakis.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail