Archive: Creating a Data Struct


Creating a Data Struct
I trying to convert an old InstallShield installer over to NSIS and I'm running into a problem creating the copydatastruct using the system plugin.

Here is the original InstallShield portion:

typedef COPYDATASTRUCT
begin
NUMBER dwData;
NUMBER cbData;
NUMBER lpData;
end;

copyData.dwData = _FORCECLOSE;
copyData.cbData = 0;
copyData.lpData = 0;

SendMessage( hWnd, WM_COPYDATA, NULL, &copyData );
Now here is what I've done with NSIS (thats obviously not working):
System::Call "*(t, i, i)i.s"
Pop $0
System::Call "*$0(t '_FORCECLOSE', i 0, i 0)"
FindWindow $1 "TMPV_Frm_Main" ""
SendMessage $1 ${WM_COPYDATA} 0 $0
Obviously I am doing something wrong, however, I'm sure not seeing it. Any ideas? Thanks guys!

dwData is a DWORD and not text, so you need to find the value of _FORCECLOSE. If what you want is to send the actual string "_FORCECLOSE" cbData should have the size (in bytes including zero terminator) of the string, and lpData should point to the string