What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » xml window position

xml window position
Author: Message:
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
RE: xml window position
MoveWindow is a Win32 API function in user32.dll. You should use Interop.Call(DllName, FunctionName, Param1, ...) to call it!

Source: MoveWindow on MSDN
code:
var Result = Interop.Call(
   "user32.dll", /* DLL name, you can find this on the MSDN page under Function Information */
   "MoveWindow", /* Function name */
   WndHandle, /* hWnd */
   100, /* X-position */
   100, /* Y-position */
   100, /* Width */
   100, /* Height */
   true /* bRepaint, set this to false if you're going to repaint the window yourself (which you better don't) */
);
Debug.Trace("MoveWindow result: "+Result);
The result of MoveWindow is zero if it failed. So, if you want to check if it failed, use if(Result == 0) ... and do whatever you want. (show error box, tell the debugger something, ...)

Of course, it's not needed that you place all these comments in your function call. It's just to let you know what each parameter stands for. Something like this can be used if you don't need all these comments:
code:
var Result = Interop.Call("user32.dll", "MoveWindow", WndHandle, 100, 100, 100, 100, true);
But I think you could've figured that out yourself too. :)

quote:
Originally posted by SpunkyLoveMuff
change FALSE to false or replace it with a 0 (zero)
Sorry, but that won't make any difference. FALSE is false. And false as parameter in an Interop.Call equals 0 too, the documentation explains:
quote:
Originally posted by Messenger Plus! Live Scripting Documentation
Here is how the data will be sent to the function depending on its type:
  • If the parameter is a plain number (positive or negative), it is sent as is.
  • If the parameter is a floating point number, it is rounded up and sent as a plain number.
  • If the parameter is a boolean, a number is sent: 1 for true, 0 for false.
  • If the parameter is null, 0 is sent.
  • If the parameter is a string, a pointer to a Unicode string is sent.
  • If the parameter is a DataBloc object, a pointer to its underlying data is sent.
  • If the parameter is any other object, a pointer to its IDispatch interface is sent. The reference count of the object is not increased.


This post was edited on 08-30-2007 at 12:19 PM by Matti.
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
08-30-2007 12:19 PM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
xml window position - by scutterman on 08-29-2007 at 07:35 PM
RE: xml window position - by matty on 08-29-2007 at 07:50 PM
RE: xml window position - by scutterman on 08-29-2007 at 07:53 PM
RE: xml window position - by markee on 08-29-2007 at 11:27 PM
RE: xml window position - by scutterman on 08-30-2007 at 08:58 AM
RE: xml window position - by scutterman on 08-30-2007 at 09:37 AM
RE: xml window position - by Spunky on 08-30-2007 at 10:17 AM
RE: xml window position - by scutterman on 08-30-2007 at 11:26 AM
RE: xml window position - by scutterman on 08-30-2007 at 11:34 AM
RE: xml window position - by Matti on 08-30-2007 at 12:19 PM
RE: xml window position - by scutterman on 08-30-2007 at 06:39 PM
RE: xml window position - by matty on 08-30-2007 at 07:01 PM
RE: xml window position - by markee on 08-31-2007 at 12:15 AM
RE: xml window position - by scutterman on 09-02-2007 at 01:38 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