Archive: Using SendMessage help?


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.


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.


I had looked at the system wiki/examples but did not understand how to implement.


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. :(

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.