Archive: closing the Temp window


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


Works on Win98 SE without any changes :)


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?


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.


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

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