Old 4th November 2006, 04:01   #1
keating_z
Junior Member
 
Join Date: Nov 2006
Posts: 2
How to use WinApi's Addmonitor() in nsis

I just want to know how to set these three parameters
in Nsis.thank you very much.
here is the function's basic information.

AddMonitor

The AddMonitor function installs a local port monitor and links the configuration, data, and monitor files.

BOOL AddMonitor(
LPTSTR pName, // server name
DWORD Level, // monitor information level
LPBYTE pMonitors // monitor information buffer
);

Parameters

pName
[in] Pointer to a null-terminated string that specifies the name of the server on which the monitor should be installed. For systems that support only local installation of monitors, this string should be NULL.
Level
[in] Specifies the version of the structure to which pMonitors points. This value must be 2.

pMonitors
[in] Pointer to a MONITOR_INFO_2 structure. If the pEnvironment member of the pMonitors structure is NULL, the current environment of the caller (client), not of the destination (server), is used.

Windows 95/98/Me: pEnvironment must not be NULL. Instead, the recommended value is "Windows 4.0".

Note that the call will fail if the environment does not match the environment of the server, that is, you can only add a monitor that was written for the architecture of the server.

Return Values

If the function succeeds, the return value is a nonzero value.

If the function fails, the return value is zero. To get extended error information, call GetLastError.
keating_z is offline   Reply With Quote
Old 4th November 2006, 12:07   #2
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Using the System plug-in.
code:
System::Call "*(t 'name', t 'env', t 'dll') i .r0"
System::Call "winspool::AddMonitor(t 'server name', i 2, i r0)"
System::Free $0


NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 5th November 2006, 01:48   #3
keating_z
Junior Member
 
Join Date: Nov 2006
Posts: 2
Thank You kichik!
keating_z is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump