Old 24th July 2002, 18:14   #1
clunix
Junior Member
 
Join Date: Jul 2002
Posts: 4
SendMessage Usage

Where can I find all the available messages and their values? What are wparam and lparam? I found examples in the Winamp forum but I don't know what the different wparam and lparam values will do. How would I close a window once I have the HWND from FindWindow? SendMessage $R9 16 ? ?

From the docs:
SendMessage HWND
msg
wparam
lparam
[user_var(return value)]

... Here are a few example messages and their values:

* WM_CLOSE 16
* WM_COMMAND 273
* WM_USER 1024
clunix is offline   Reply With Quote
Old 24th July 2002, 18:53   #2
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Include WinMessages.NSH in your NSIS directory to your script and you will have them all defined.

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 24th July 2002, 19:52   #3
clunix
Junior Member
 
Join Date: Jul 2002
Posts: 4
Unhappy

Sorry, I don't know what you mean by this.
clunix is offline   Reply With Quote
Old 24th July 2002, 20:02   #4
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Add this line:
!include "C:\Program Files\NSIS\WinMessages.nsh"
At the top of your script.

If you use NSIS 2.0a1 put this line:
!include "C:\Program Files\NSIS\Examples\WinMessages.nsh"

Then you will be able to use any windows message by its name.

Example:

FindWindow $0 "Winamp v1.x"
SendMessage $0 ${WM_CLOSE} 0 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 24th July 2002, 20:26   #5
clunix
Junior Member
 
Join Date: Jul 2002
Posts: 4
Great. THANKS. But what are the wparam and lparam values for? What are they used for?
clunix is offline   Reply With Quote
Old 24th July 2002, 20:32   #6
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Every messages deals with its WPARAM and LPARAM differently. They are just two parameters for every message, like functions in C.

WM_CLOSE ignores them, so you can leave them both at 0.

For more information on every message and its parameters go to MSDN and search for the message name.

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 24th July 2002, 20:47   #7
clunix
Junior Member
 
Join Date: Jul 2002
Posts: 4
Thanks again and thanks for the fast response.
clunix is offline   Reply With Quote
Old 24th July 2002, 21:00   #8
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Glad I can help

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
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