grahama
7th January 2005 01:45 UTC
closing the Temp window
I am tring to close the 'Temp' Window which is launched 'free of charge' ;) after completion from a 3rd party installer. For some reason the below code does not do the trick....
some syntax error ?
many thanks
!include WinMessages.nsh
Function closeTempWindow
FindWindow $0 "" "Temp"
IntCmp $0 0 done
IsWindow $0 0 done
System::Call 'user32::PostMessageA(i,i,i,i) i($0,${WM_CLOSE},0,0)'
done:
FunctiionEnd
Takhir
7th January 2005 07:16 UTC
Works on Win98 SE without any changes :)
RobGrant
7th January 2005 08:43 UTC
Isn't PostMessage the one which just sends the message to a queue? Immediate execution (while possible) isn't guaranteed...perhaps you could try using SendMessage instead?
Takhir
7th January 2005 12:53 UTC
MyComputer window caption may include full path (or may not ? ), so window search may be a bit more complex - all top level "CabinetWClass" windows with "Temp" sustring in the caption.
Joel
7th January 2005 15:41 UTC
From MSDN:
The PostMessage function places (posts) a message in the message queue associated with the thread that created the specified window and returns without waiting for the thread to process the message.
Since the NSIS is the parent thread, you just can SendMessage to do the same task :)
grahama
7th January 2005 22:20 UTC
Neither PostMessage or SendMessage work. And the nsi from Tahkir did not work either :( I am using Win2k and the full Temp folder path is: C:\Documents and Settings\VirtualPC User\Local Settings\Temp
For some odd reason this was working several months ago..maybe it works with an earlier version of NSIS.
odd :(
g