Shoutbox

[Question] How to obtain screen resolution? - 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: [Question] How to obtain screen resolution? (/showthread.php?tid=72619)

[Question] How to obtain screen resolution? by xsylvain2 on 03-13-2007 at 02:56 PM

[Question] How to obtain screen resolution in JScrpt? ^o)


RE: [Question] How to obtain screen resolution? by matty on 03-13-2007 at 03:23 PM

code:
function OnEvent_Initialize(MessengerStart){
    /*
        Get the x and y widths of all monitors.
    */

   
    var _x = Interop.Call('user32', 'GetSystemMetrics', 0x4e /* SM_CXVIRTUALSCREEN */);
    var _y = Interop.Call('user32', 'GetSystemMetrics', 0x4f /* SM_CYVIRTUALSCREEN */);
   
    /*
        Print out the screen resolution
    */

    Debug.Trace(_x+'x'+_y);
}

RE: [Question] How to obtain screen resolution? by xsylvain2 on 03-13-2007 at 03:33 PM

Ok cool!!!

I try this and is work now. :S ok, I declared my variables at wrong place.

code:
function OnEvent_Initialize(MessengerStart){
var _x = Interop.Call('user32', 'GetSystemMetrics', 0x4e /* SM_CXVIRTUALSCREEN */);
var _y = Interop.Call('user32', 'GetSystemMetrics', 0x4f /* SM_CYVIRTUALSCREEN */);
var MerlinLeft_X   = 0 + Merlin.Width;           var MerlinTop_Y    = 0 + Merlin.Height;
var MerlinCenter_X = _x / 2 - Merlin.Width  / 2; var MerlinRight_X  = _x - Merlin.Width;
var MerlinCenter_Y = _y / 2 - Merlin.Height / 2; var MerlinBottom_Y = _y - Merlin.Height;

Is ok, I forgot to declare my variables at front of my script.
RE: [Question] How to obtain screen resolution? by matty on 03-13-2007 at 07:03 PM

Post your entire code and we can help.