Skip to content
⌘ NSIS Forum Archive

Using SendMessage help?

5 posts

billym#

Using SendMessage help?

I need my nsis installer to send custom windows messages to the application that is listening for the stages of the installation. I believe that I need to use sendmessage with WM_COPYDATA but do not know how to do it within nsis. Any help would be appreciated.
Joel#
WM_COPYDATA? Then you'll need system plugin to send the COPYDATASTRUCT to the application. See sytem plugin help file about how to use structs.
{_trueparuex^}#edited
System plugin is not necessarily needed here. Try something like this.

!define WM_COPYDATA 0x004A

FindWindow $0 "my window class" "my window title"
FindWindow $1 "#32770" "" $HWNDPARENT
SendMessage $0 ${WM_COPYDATA} $1 $data
But this will work only if lisner application haves a window.

Edit: I tried it myself and it didn't work. 🙁
Joel#
Hi {_trueparuex^} 🙂

Of course we need system plugin to use COPYDATASTRUCT, see msdn's about WM_COPYDATA

I'll try to write an example about it.