Archive: finding window


finding window
I try to use the finding window function with no seccess.the last version I work with I used the findwindowbytitle function with no problems but now i have problem


if you are trying to find one to close it.. here is a small script that justin posted a little while ago on the forums to do this..


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


if you want to do other things you can use SendMessage to send different types of messages. this comes in very useful if you wish to click buttons etc..

find the window but can not close it.
I try to to close IE.
The "find an IE" message will show up.
But can not close it. Why?
The code is as following:

; CloseIE
; Closes all running instances of IE
; modifies no other variables
Function CloseIE
Push $0
loop:
FindWindow $0 "IEFrame"
IntCmp $0 0 done
MessageBox MB_OK "find an IE."
SendMessage $0 16 0 0
Sleep 1000
MessageBox MB_OK "close IE."
Goto loop
done:
MessageBox MB_OK "IE Check complete"
Pop $0
FunctionEnd

Thanks.