What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [?] Toggle display of PlusWnd taskbar button...

[?] Toggle display of PlusWnd taskbar button...
Author: Message:
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
RE: [?] Toggle display of PlusWnd taskbar button...
One correction for Cookie: to do a bitwise NOT operation, you need to use "~" as opposed to "!", as in:
js code:
Get = Get & ~0x40000;
The boolean not will not give the wanted results:
  • !0x40000: A non-zero number converts to boolean true. The "!" takes this boolean equivalent and returns the opposite.
    Result: false (boolean).
  • Get & false: The bitwise AND takes two integers, so the boolean false is converted to the number zero. Therefore the expression becomes equivalent to Get & 0 which will always evaluate to zero.
    Final result: 0 (number).
The only case where this could produce a non-zero number is when the flag to be subtracted would be zero. Then, the boolean NOT operator would evaluate to true and the expression becomes Get & 1. This gives 1 when the smallest bit is set or 0 if it's not.

I'm sure it was just a typo on Cookie's side but I thought it'd be better to properly explain what's wrong with it. Bitwise arithmetic is frequently used in the Windows API and more developers should be aware of it. :)
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
06-07-2011 01:21 PM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
[?] Toggle display of PlusWnd taskbar button... - by whiz on 06-05-2011 at 04:35 PM
RE: [?] Toggle display of PlusWnd taskbar button... - by Eljay on 06-05-2011 at 04:44 PM
RE: [?] Toggle display of PlusWnd taskbar button... - by whiz on 06-07-2011 at 07:56 AM
RE: [?] Toggle display of PlusWnd taskbar button... - by CookieRevised on 06-07-2011 at 10:24 AM
RE: [?] Toggle display of PlusWnd taskbar button... - by Matti on 06-07-2011 at 01:21 PM
RE: [?] Toggle display of PlusWnd taskbar button... - by CookieRevised on 06-07-2011 at 02:50 PM
RE: [?] Toggle display of PlusWnd taskbar button... - by whiz on 06-08-2011 at 07:44 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On