What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Help with API

Help with API
Author: Message:
vikke
Senior Member
****

Avatar

Posts: 900
Reputation: 28
31 / Male / Flag
Joined: May 2006
RE: Help with API
You can call almost any DLL export function with the MsgPlus! scripting.
The calling method has to be stdcall, so the Windows 32 API works fine. The function does also have to return int (if you're going to read the return value).

For example: You can call the SetWindowsHookEx function, but you won't be able to anything with it because javascript cannot handle the callbacks functions needed.

To use Win32 APIs, simply use the Interop object. The Interop object has a method/function which is called Call.
To use call in order to call any API function do like this:
code:
Interop.Call("user32.dll", "SetWindowsTextW", 0, "Hello");
The first parameter is the DLL the function is in, the second is the export name, rest are optional parameters used by the function.

Note: Always use the unicode version of Win32 APIs instead of the ANSI version. So put a W after a function to use the unicode function (only on functions whichs contains one string in its parameters, all expect GetProcAddress).

Edit: After using the DLL, you might want to free it, then simply do:
code:
Interop.FreeDll("dllname.dll");

This post was edited on 05-26-2007 at 06:50 AM by vikke.
4 8 15 16 23 42
05-26-2007 06:48 AM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Help with API - by pedro_cesar on 05-26-2007 at 06:13 AM
RE: Help with API - by vikke on 05-26-2007 at 06:48 AM
RE: Help with API - by Matti on 05-26-2007 at 06:52 AM
RE: RE: Help with API - by vikke on 05-26-2007 at 06:54 AM
RE: Help with API - by mickael9 on 05-26-2007 at 09:23 AM
RE: Help with API - by Matti on 05-26-2007 at 10:21 AM
RE: Help with API - by mickael9 on 05-26-2007 at 05:30 PM
RE: Help with API - by pedro_cesar on 05-27-2007 at 01:03 AM


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