Jump to content



Photo

Check for unknown window


  • Please log in to reply
3 replies to this topic

#1 apr1985

apr1985

    Seeker

  • Normal Members
  • 6 posts

Posted 07 October 2009 - 10:58 AM

Hello

The application that I am testing occasionally flashes up what I think is an MSI window for a split second, but I dont know the name of it.
Is there a function in AutoIt that would sit and wait and when this rogue window flashes up would send an alert message containing some useful info on the window, or even do a print screen while the box is up??

I know usually I would use a winwaitactive command but as I say I dont know the name or any details of the window :)

Cheers for any help

Adam







#2 Yashied

Yashied

    Happy in Moscow

  • MVPs
  • 2,512 posts

Posted 07 October 2009 - 11:33 AM

Hello

The application that I am testing occasionally flashes up what I think is an MSI window for a split second, but I dont know the name of it.
Is there a function in AutoIt that would sit and wait and when this rogue window flashes up would send an alert message containing some useful info on the window, or even do a print screen while the box is up??

I know usually I would use a winwaitactive command but as I say I dont know the name or any details of the window :)

Cheers for any help

Adam

This will register the creation of any windows.

AutoIt         
#Include <WinAPIEx.au3> Opt('MustDeclareVars', 1) Global $hForm $hForm = GUICreate('') GUIRegisterMsg(_WinAPI_RegisterWindowMessage('SHELLHOOK'), '_ShellHookProc') _WinAPI_RegisterShellHookWindow($hForm) While 1     Sleep(100) WEnd Func _ShellHookProc($hWnd, $iMsg, $wParam, $lParam)     Switch $hWnd         Case $hForm             Switch $wParam                 Case $HSHELL_WINDOWCREATED                     Local $Title = WinGetTitle($lParam)                     If IsString($Title) Then                         ConsoleWrite('Created window: ' & $Title & @CR)                     EndIf             EndSwitch     EndSwitch EndFunc   ;==>_ShellHookProc Func OnAutoItExit()     _WinAPI_DeregisterShellHookWindow($hForm) EndFunc   ;==>OnAutoItExit

WinAPIEx.au3

Edited by Yashied, 07 October 2009 - 11:34 AM.


#3 apr1985

apr1985

    Seeker

  • Normal Members
  • 6 posts

Posted 07 October 2009 - 01:26 PM

Thanks very much!!
That works perfectly (although I changed it to an msgbox rather than console text :) ).
Those winapi functions will come in handy as well.

Cheers
Adam

#4 anandchakru

anandchakru

    Seeker

  • Active Members
  • 22 posts

Posted 18 August 2012 - 07:15 PM

This is not working when the autoit is running as "SYSTEM" and not as logged in User. Any idea anybody whats missing here ?
Thanks`A




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users