Archive: why?!?


why?!?
FindWindowByTitle seems to be completely gone... i used this in 2 of my installers to close prgrams beforte updating... anyone know how to accomplish the old 'FindWindowByTitle Close' with the new commands?


here is an example from the Utility functions

Function CloseWinamp
Push $0
loop:
FindWindow $0 "Winamp v1.x"
IntCmp $0 0 done
SendMessage $0 16 0 0
Sleep 100
Goto loop
done:
Pop $0
FunctionEnd


Re: why?!?

Originally posted by Kreft
FindWindowByTitle seems to be completely gone... i used this in 2 of my installers to close prgrams beforte updating... anyone know how to accomplish the old 'FindWindowByTitle Close' with the new commands?
The FindWindow is now general enough to do it. Lookie here:

Function CloseItDammit
Push $0
loop:
FindWindow $0 "" "WhateverMyWindowNameIs"
IntCmp $0 0 done
SendMessage $0 16 0 0
Sleep 100
Goto loop
done:
Pop $0
FunctionEnd


-Justin

thanks justin, seems like a bit more work than before though...


One problem I'm having with this one. I used to have a FindWindowByTitle inside the uninstall section, but since I can't put a function inside a section, I can't get this to work now. Does anyone have any ideas??


Originally posted by prodangle
One problem I'm having with this one. I used to have a FindWindowByTitle inside the uninstall section, but since I can't put a function inside a section, I can't get this to work now. Does anyone have any ideas??
You can rename the function un.CloseItDammit, or just put this code directly into your uninstall section:

loop:
FindWindow $0 "" "WhateverMyWindowNameIs"
IntCmp $0 0 done
SendMessage $0 16 0 0
Sleep 100
Goto loop
done:



-Justin

Originally posted by Kreft
thanks justin, seems like a bit more work than before though...
Yep, but it makes the exe header smaller anyway, and allows for a finer control of functinoality.

-Justin

Originally posted by justin


...or just put this code directly into your uninstall section: ...
DOH!

Thanks much, I really should've thought of that myself :p :p