Not to close a window under the Mouse (that is easy). I want to close a application, even when the application can't recieve a message (when it hangs, don't answer).
My code
Code: Select all
       maus.point 
       getcursorpos_(maus) 
       handle=windowfrompoint_(maus\x,maus\y) 
       processid=0 
       thread= GetWindowThreadProcessId_(handle,@processid) 
       terminateprocess_(processid,0)
p.s.:
Try this
Code: Select all
  postmessage_(findwindow_("Shell_TrayWnd",0),#wm_quit,0,0)
p.p.s.:
Code: Select all
  handle=findwindow_("Shell_TrayWnd",0) 
  If handle 
   handle=getwindow_(handle,#GW_CHILD) 
   If handle 
    class$=Space(1024): 
    getclassname_(handle,@class$,Len(class$)) 
    If Left(class$,Len(class$))="Button" 
     postmessage_(handle,#wm_close,0,0) 
    EndIf 
   EndIf 
  EndIf
PII 333, 256MB, Asus TNT2Ultra 32MB, AWE Gold 64 4MB
