Shoutbox

[help]Message notification - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: [help]Message notification (/showthread.php?tid=88992)

[help]Message notification by DaAniv on 02-06-2009 at 04:13 PM

there's a couple of questions how do I know the hex value?
for example I looked at msdn for WM_MOVE and it says it is equal to &H3 what does that mean?.
and also to get HIWORD/LOWORD does

code:
WORD LOWORD(DWORD Value);
or
code:
WORD HiWORD(DWORD Value);
works?
and lastly at the Message Notification event what do I write at the if(Message==?)


RE: [help]Message notification by matty on 02-06-2009 at 05:52 PM

&H3 is the Visual Basic way of displaying a hex value. &H3 is the equivalent of 0x3.

To get the hiword and lowords from a number use these

js code:
/*
    Name:     lobyte
    Purpose:    Retrieves the lobyte from a value
    Parameters:    w - the value to get the lobyte from
    Return:    lobyte of the w parameter
*/
function lobyte(w){ return w & 0xff; }

/*
    Name:     hibyte
    Purpose:    Retrieves the hibyte from a value
    Parameters:    w - the value to get the hibyte from
    Return:    hibyte of the w parameter
*/
function hibyte(w){ return w >> 8; }

/*
    Name:     makeword
    Purpose:    Creates a WORD value by concatenating the specified values.
    Parameters:    a - Specifies the low-order byte of the new value.
                b - Specifies the high-order byte of the new value.
    Return:    The return value is a WORD value.
*/
function makeword(a,b){ return a | (b << 8); }


And for your last question you would do something like this

js code:
function OnWindowEvent_MessageNotification(pPlusWnd, nMessage, wParam, lParam){
    switch(nMessage){
        case WM_MOVE:
            /*
                your code here
            */
    }
}

RE: [help]Message notification by Matti on 02-06-2009 at 06:21 PM

@matty: The two functions you posted there are for getting the low- and high-order bytes, not the low- and high-order words! A word consists of 2 bytes (16 bits), so you need to alter your functions a bit.

js code:
function loword(n){ return n & 0xffff; }
function hiword(n){ return (n >> 16) & 0xffff; }

RE: [help]Message notification by DaAniv on 02-06-2009 at 06:28 PM

Thanks sorta figured it out looking at some people scripts but thanks anyway ^^


RE: [help]Message notification by matty on 02-06-2009 at 06:43 PM

quote:
Originally posted by Matti
@matty: The two functions you posted there are for getting the low- and high-order bytes, not the low- and high-order words! A word consists of 2 bytes (16 bits), so you need to alter your functions a bit.
js code:
function loword(n){ return n & 0xffff; }
function hiword(n){ return (n >> 16) & 0xffff; }

My bad I just quickly copied it from a previous script; didn't pay attention :P I am working after all :P