Article View: borland.public.cppbuilder.nativeapi
Article #15947Re: It's a mistery??? WM_SYSCOMMAND & Screen Savers
From: Remy Lebeau (TeamB)
Date: Thu, 05 Jun 2003 01:10
Date: Thu, 05 Jun 2003 01:10
25 lines
1743 bytes
1743 bytes
"Mike Collins" <mikec@kr8.co.uk> wrote in message
news:3ede7c1b@newsgroups.borland.com...
> if (msg.wParam == SC_SCREENSAVE)
You should be masking off the wParam with 0xFFF0 before you compare the
value. As per MSDN documentation:
"In WM_SYSCOMMAND messages, the four low-order bits of the wParam
parameter are used internally by the system. To obtain the correct result
when testing the value of wParam, an application must combine the value
0xFFF0 with the wParam value by using the bitwise AND operator."
Your code should be this instead:
if( (msg.wParam & 0xFFF0) == SC_SCREENSAVE )
Alternatively, I just found this article on MSDN:
HOWTO: Know When Your Screen Saver Starts
http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B238882
Gambit
Technical Details
Message-ID:
<3ede97d2$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-01!sn-xit-09!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mailReferences:
<3ede7c1b@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,e18e111f10ac0959 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-06-04 18:12:51 PST From: "Remy Lebeau \(TeamB\)" <gambit47@yahoo.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <3ede7c1b@newsgroups.borland.com> Subject: Re: It's a mistery??? WM_SYSCOMMAND & Screen Savers Date: Wed, 4 Jun 2003 18:10:39 -0700 Lines: 27 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 207.175.226.26 Message-ID: <3ede97d2$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1054775250 207.175.226.26 (4 Jun 2003 18:07:30 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-01!sn-xit-09!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail