Jump to content



Photo

Get All Auto-it Windows


  • Please log in to reply
15 replies to this topic

#1 aNewLyfe

aNewLyfe

    Adventurer

  • Active Members
  • PipPip
  • 124 posts

Posted 05 June 2008 - 10:30 PM

I want to get all open autoit windows on my computer, is there a way to do this ?
from different exes off course
i ve searched but nothing found sorry

Edited by mistakilla, 05 June 2008 - 10:31 PM.

Posted Image

I have a blog about programming but mostly about autoit and its in my language (turkish)Btw, feel free to visit it, i answer every comment :P here: autoit






#2 jwseek

jwseek

    Seeker

  • Active Members
  • 28 posts

Posted 05 June 2008 - 10:34 PM

I want to get all open autoit windows on my computer, is there a way to do this ?
from different exes off course
i ve searched but nothing found sorry


The WinList() function gives you an array of all open windows and handlers. Unfortunately, nothing in AutoIt I know of actually can determine the "type" of program it is, only the name of the program. But maybe you can figure something out with WinList()

#3 aNewLyfe

aNewLyfe

    Adventurer

  • Active Members
  • PipPip
  • 124 posts

Posted 05 June 2008 - 10:39 PM

The WinList() function gives you an array of all open windows and handlers. Unfortunately, nothing in AutoIt I know of actually can determine the "type" of program it is, only the name of the program. But maybe you can figure something out with WinList()


yea, iam diggin on it at the moment. I am also checking WinGetClass but nothing yet.
there is a way :) AutoItWinGetTitle but it only returns own scripts title, waiting helps :)

Posted Image

I have a blog about programming but mostly about autoit and its in my language (turkish)Btw, feel free to visit it, i answer every comment :P here: autoit


#4 MrCreatoR

MrCreatoR

    Must AutoIt!

  • MVPs
  • 3,241 posts

Posted 05 June 2008 - 11:10 PM

Unfortunately, nothing in AutoIt I know of actually can determine the "type" of program it is, only the name of the program

You can always check the CLASS window:

$sAutoItWinList = _GetAutoItWinList() ConsoleWrite($sAutoItWinList) Func _GetAutoItWinList()     Local $aWinList = WinList("[CLASS:AutoIt v3 GUI]")     Local $sRet_List = ""         For $i = 1 To UBound($aWinList)-1         $sRet_List &= $aWinList[$i][0] & @CRLF     Next         Return StringStripWS($sRet_List, 3) EndFunc

Edited by MrCreatoR, 05 June 2008 - 11:12 PM.

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

Posted Image AutoIt Russian CommunityPosted Image Projects: ATT - Application Translate Tool [new] | BlockIt - Block files & folders [new] | SIP - Selected Image Preview [new] | SISCABMAN - SciTE Abbreviations Manager [new] | AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramPosted Image UDFs: OnAutoItErrorRegister - Handle AutoIt critical errors [new] | AutoIt Syntax Highlight [new] | Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDFPosted Image Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation DemoLike the examples/UDFs? Please rate the topic (up-right corner of the post header: Rating Posted Image)* === My topics === *

==========================================================Posted Image==========================================================

AutoIt is simple, subtle, elegant. © AutoIt Team


#5 aNewLyfe

aNewLyfe

    Adventurer

  • Active Members
  • PipPip
  • 124 posts

Posted 06 June 2008 - 12:11 AM

You can always check the CLASS window:

$sAutoItWinList = _GetAutoItWinList() ConsoleWrite($sAutoItWinList) Func _GetAutoItWinList()     Local $aWinList = WinList("[CLASS:AutoIt v3 GUI]")     Local $sRet_List = ""         For $i = 1 To UBound($aWinList)-1         $sRet_List &= $aWinList[$i][0] & @CRLF     Next         Return StringStripWS($sRet_List, 3) EndFunc

Thanks! you are the one :)

Posted Image

I have a blog about programming but mostly about autoit and its in my language (turkish)Btw, feel free to visit it, i answer every comment :P here: autoit


#6 aNewLyfe

aNewLyfe

    Adventurer

  • Active Members
  • PipPip
  • 124 posts

Posted 06 June 2008 - 12:23 AM

mm, is there a way to do this on processes instead of windows ?

Edited by mistakilla, 06 June 2008 - 12:24 AM.

Posted Image

I have a blog about programming but mostly about autoit and its in my language (turkish)Btw, feel free to visit it, i answer every comment :P here: autoit


#7 SmOke_N

SmOke_N

    It's not what you know ... It's what you can prove!

  • Moderators
  • 15,729 posts

Posted 06 June 2008 - 12:23 AM

mm, is there also a way to do process like this ?

ProcessList("processName.exe")?

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.


#8 aNewLyfe

aNewLyfe

    Adventurer

  • Active Members
  • PipPip
  • 124 posts

Posted 06 June 2008 - 12:25 AM

ProcessList("processName.exe")?


nop :)

i want to get a list of Auto-it v3 Processess running

Posted Image

I have a blog about programming but mostly about autoit and its in my language (turkish)Btw, feel free to visit it, i answer every comment :P here: autoit


#9 SmOke_N

SmOke_N

    It's not what you know ... It's what you can prove!

  • Moderators
  • 15,729 posts

Posted 06 June 2008 - 12:27 AM

nop :)

i want to get a list of Auto-it v3 Processess running

You need to be MUCH more specific when asking a question then.

You have the list... go through the list, use WinGetProcess, that will return the PID, with that you can use _ProcessGetName

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.


#10 aNewLyfe

aNewLyfe

    Adventurer

  • Active Members
  • PipPip
  • 124 posts

Posted 06 June 2008 - 12:45 AM

You need to be MUCH more specific when asking a question then.

You have the list... go through the list, use WinGetProcess, that will return the PID, with that you can use _ProcessGetName


thanks for your help Smoke_n
but i dont have the list. i wrote things that i trying to do at the first post, and just want to do same with processess nvm its not important, you r looking tight :) also i am not asking question, i am trying to form an opinion with help of you to straighten my au3script.

so, i want to recognize an Auto-it process from process name not from win title, there is also guiless auto it scripts around

Edited by mistakilla, 06 June 2008 - 12:48 AM.

Posted Image

I have a blog about programming but mostly about autoit and its in my language (turkish)Btw, feel free to visit it, i answer every comment :P here: autoit


#11 SmOke_N

SmOke_N

    It's not what you know ... It's what you can prove!

  • Moderators
  • 15,729 posts

Posted 06 June 2008 - 12:52 AM

thanks for your help Smoke_n
but i dont have the list. i wrote things that i trying to do at the first post, and just want to do same with processess nvm its not important, you r looking tight :) also i am not asking question, i am trying to form an opinion with help of you to straighten my au3script.

so, i want to recognize an Auto-it process from process name not from win title, there is also guiless auto it scripts around

Processes can be named anything, the idea of finding one by it's name purely other than AutoIt3.exe (or wrapper.exe) is not going to happen... so mscreator provided the stepping stone to finding autoit processes being ran.

1. Winlist with autoits class name
2. Loop through ubound of winlist found
3. ProcessGetName(WinGetProcess($winlistarray[$loopnumber][1]))

How you display the information is up to you.... So, I'm not tight... just need to understand what someone want specifically rather than wasting my time coming up with something that isn't what they want or need.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.


#12 MrCreatoR

MrCreatoR

    Must AutoIt!

  • MVPs
  • 3,241 posts

Posted 06 June 2008 - 01:16 AM

I think the only indication of AutoIt executable can be found in the file properties, e.g. «CompiledScript»...

AutoIt         
$sAutoItProcList = _GetAutoItProcList() ConsoleWrite($sAutoItProcList) Func _GetAutoItProcList()     Local $aProcList = ProcessList()     Local $sRet_List = "", $sProc_Path = ""         For $i = 1 To UBound($aProcList)-1         $sProc_Path = _ProcessGetPath($aProcList[$i][1])                 If StringInStr(FileGetVersion($sProc_Path, "CompiledScript"), "AutoIt") Then $sRet_List &= $aProcList[$i][0] & @CRLF     Next         Return StringStripWS($sRet_List, 3) EndFunc Func _ProcessGetPath($vProcess)     Local $iPID = ProcessExists($vProcess)     If Not $iPID Then Return SetError(1, 0, -1)         Local $aProc = DllCall('kernel32.dll', 'hwnd', 'OpenProcess', 'int', BitOR(0x0400, 0x0010), 'int', 0, 'int', $iPID)     If Not IsArray($aProc) Or Not $aProc[0] Then Return SetError(2, 0, -1)         Local $vStruct = DllStructCreate('int[1024]')         Local $hPsapi_Dll = DllOpen('Psapi.dll')     If $hPsapi_Dll = -1 Then $hPsapi_Dll = DllOpen(@SystemDir & '\Psapi.dll')     If $hPsapi_Dll = -1 Then $hPsapi_Dll = DllOpen(@WindowsDir & '\Psapi.dll')     If $hPsapi_Dll = -1 Then Return SetError(3, 0, '')         DllCall($hPsapi_Dll, 'int', 'EnumProcessModules', _         'hwnd', $aProc[0], _         'ptr', DllStructGetPtr($vStruct), _         'int', DllStructGetSize($vStruct), _         'int_ptr', 0)     Local $aRet = DllCall($hPsapi_Dll, 'int', 'GetModuleFileNameEx', _         'hwnd', $aProc[0], _         'int', DllStructGetData($vStruct, 1), _         'str', '', _         'int', 2048)         DllClose($hPsapi_Dll)         If Not IsArray($aRet) Or StringLen($aRet[3]) = 0 Then Return SetError(4, 0, '')     Return $aRet[3] EndFunc

Edited by MrCreatoR, 06 June 2008 - 03:38 PM.

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

Posted Image AutoIt Russian CommunityPosted Image Projects: ATT - Application Translate Tool [new] | BlockIt - Block files & folders [new] | SIP - Selected Image Preview [new] | SISCABMAN - SciTE Abbreviations Manager [new] | AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramPosted Image UDFs: OnAutoItErrorRegister - Handle AutoIt critical errors [new] | AutoIt Syntax Highlight [new] | Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDFPosted Image Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation DemoLike the examples/UDFs? Please rate the topic (up-right corner of the post header: Rating Posted Image)* === My topics === *

==========================================================Posted Image==========================================================

AutoIt is simple, subtle, elegant. © AutoIt Team


#13 aNewLyfe

aNewLyfe

    Adventurer

  • Active Members
  • PipPip
  • 124 posts

Posted 06 June 2008 - 12:05 PM

I think the only indication of AutoIt executable can be found in the file properties, e.g. «CompiledScript»...

AutoIt         
$sAutoItProcList = _GetAutoItProcList() ConsoleWrite($sAutoItProcList) Func _GetAutoItProcList()     Local $aProcList = ProcessList()     Local $sRet_List = "", $Proc_Path = ""         For $i = 1 To UBound($aProcList)-1         $Proc_Path = _ProcessGetPath($aProcList[$i][1])                 If StringInStr(FileGetVersion($Proc_Path, "CompiledScript"), "AutoIt") Then $sRet_List &= $aProcList[$i][0] & @CRLF     Next         Return $sRet_List EndFunc Func _ProcessGetPath($vProcess)     Local $iPID = ProcessExists($vProcess)     If Not $iPID Then Return SetError(1, 0, -1)         Local $aProc = DllCall('kernel32.dll', 'hwnd', 'OpenProcess', 'int', BitOR(0x0400, 0x0010), 'int', 0, 'int', $iPID)     If Not IsArray($aProc) Or Not $aProc[0] Then Return SetError(2, 0, -1)         Local $vStruct = DllStructCreate('int[1024]')         Local $hPsapi_Dll = DllOpen('Psapi.dll')     If $hPsapi_Dll = -1 Then $hPsapi_Dll = DllOpen(@SystemDir & '\Psapi.dll')     If $hPsapi_Dll = -1 Then $hPsapi_Dll = DllOpen(@WindowsDir & '\Psapi.dll')     If $hPsapi_Dll = -1 Then Return SetError(3, 0, '')         DllCall($hPsapi_Dll, 'int', 'EnumProcessModules', _         'hwnd', $aProc[0], _         'ptr', DllStructGetPtr($vStruct), _         'int', DllStructGetSize($vStruct), _         'int_ptr', 0)     Local $aRet = DllCall($hPsapi_Dll, 'int', 'GetModuleFileNameEx', _         'hwnd', $aProc[0], _         'int', DllStructGetData($vStruct, 1), _         'str', '', _         'int', 2048)         DllClose($hPsapi_Dll)         If Not IsArray($aRet) Or StringLen($aRet[3]) = 0 Then Return SetError(4, 0, '')     Return $aRet[3] EndFunc

Thanks again you are very smart! and you just gave me the idea :)
Read process File and the stringinstr :)
Thank you MrCreator, again

Edited by mistakilla, 06 June 2008 - 12:07 PM.

Posted Image

I have a blog about programming but mostly about autoit and its in my language (turkish)Btw, feel free to visit it, i answer every comment :P here: autoit


#14 ProgAndy

ProgAndy

    You need AutoItObject

  • MVPs
  • 2,508 posts

Posted 06 June 2008 - 07:11 PM

Yu can do it with WinList. too, just use AutoIt v3 as Classname:
CODE
#include <Process.au3>
#include <Array.au3>
$Processes = _GetAutoItProcesses()
_ArrayDisplay($Processes)

;Parameters: [Optional:] $includemy -> include the Process of the executing Script
; Returns Array:
; [0][0] -> ProcessCount
; [$i][0] -> ProcessNmae
; [$i][1] -> PID
; Author: Prog@ndy
Func _GetAutoItProcesses($inlcudemy = True)
Local $aAutoItWinList = _GetAutoItWinList()
Local $Processes[1][2] = [[0]], $pid
For $i = 1 To $aAutoItWinList[0][0]
$pid = WinGetProcess($aAutoItWinList[$i][1])
If (Not $inlcudemy) And ($pid = @AutoItPID) Then ContinueLoop
$Processes[0][0] += 1
ReDim $Processes[$Processes[0][0]+1][2]
$Processes[$Processes[0][0]][1] = $pid
$Processes[$Processes[0][0]][0] = _ProcessGetName ( $Processes[$Processes[0][0]][1] )
Next
Return $Processes
EndFunc
Func _GetAutoItWinList()
Return WinList("[CLASS:AutoIt v3]")
EndFunc

*GERMAN* Posted Image [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

#15 SmOke_N

SmOke_N

    It's not what you know ... It's what you can prove!

  • Moderators
  • 15,729 posts

Posted 06 June 2008 - 07:14 PM

Yu can do it with WinList. too, just use AutoIt v3 as Classname:

CODE
#include <Process.au3>
#include <Array.au3>
$Processes = _GetAutoItProcesses()
_ArrayDisplay($Processes)

;Parameters: [Optional:] $includemy -> include the Process of the executing Script
; Returns Array:
; [0][0] -> ProcessCount
; [$i][0] -> ProcessNmae
; [$i][1] -> PID
; Author: Prog@ndy
Func _GetAutoItProcesses($inlcudemy = True)
Local $aAutoItWinList = _GetAutoItWinList()
Local $Processes[1][2] = [[0]], $pid
For $i = 1 To $aAutoItWinList[0][0]
$pid = WinGetProcess($aAutoItWinList[$i][1])
If (Not $inlcudemy) And ($pid = @AutoItPID) Then ContinueLoop
$Processes[0][0] += 1
ReDim $Processes[$Processes[0][0]+1][2]
$Processes[$Processes[0][0]][1] = $pid
$Processes[$Processes[0][0]][0] = _ProcessGetName ( $Processes[$Processes[0][0]][1] )
Next
Return $Processes
EndFunc
Func _GetAutoItWinList()
Return WinList("[CLASS:AutoIt v3]")
EndFunc

http://www.autoitscript.com/forum/index.ph...st&p=532202

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.


#16 MrCreatoR

MrCreatoR

    Must AutoIt!

  • MVPs
  • 3,241 posts

Posted 06 June 2008 - 11:31 PM

I think the only indication of AutoIt executable can be found in the file properties, e.g. «CompiledScript»...

Mixed them to one function, and changed the name/purpose a little: _ProcessListEx - UDF :)
Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

Posted Image AutoIt Russian CommunityPosted Image Projects: ATT - Application Translate Tool [new] | BlockIt - Block files & folders [new] | SIP - Selected Image Preview [new] | SISCABMAN - SciTE Abbreviations Manager [new] | AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramPosted Image UDFs: OnAutoItErrorRegister - Handle AutoIt critical errors [new] | AutoIt Syntax Highlight [new] | Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDFPosted Image Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation DemoLike the examples/UDFs? Please rate the topic (up-right corner of the post header: Rating Posted Image)* === My topics === *

==========================================================Posted Image==========================================================

AutoIt is simple, subtle, elegant. © AutoIt Team





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users