Glyco Posted September 12, 2010 Share Posted September 12, 2010 Hii want to wait for a window to get active, start it, activate it, do some clicks & close it.but the problem is that Window has no title or hidden text.i searched the forum and did not find anything which can help me out. i also asked my brother who is good in Autoit but he sent me here Here is the info i collected through AutoIt Window info toolTitle: Class: #32770Position: 191, 94Size: 728, 557Style: 0x94CF0844ExStyle: 0x00010100Handle: 0x049B0242>>>> Visible Text <<<<OKCancelList1Sections>>>> Hidden Text <<<<List1RestartNewi tried to use it's Class name, but the problem is there are two other programs with same class name.For example, Internet Download Manager (IDM) uses the same Class name as the window i am working on.Secondly, i thought of using Handle, i don't know how to use it but i think Handle gets changed every time we restart the computer or run the program on some other computer.So, how can we do it?Possible or Impossible? Link to comment Share on other sites More sharing options...
Varian Posted September 12, 2010 Share Posted September 12, 2010 Something like this will help you get the Window Handle via the PID. Then you can ControlSend to that Hadle Link to comment Share on other sites More sharing options...
Glyco Posted September 12, 2010 Author Share Posted September 12, 2010 thanks varian but the problem is still there. because i don't know the Process name & it may be changed in future. can we do anything by detecting hidden/visible Text? or any other solution? Link to comment Share on other sites More sharing options...
jaberwacky Posted September 12, 2010 Share Posted September 12, 2010 i want to wait for a window to get active, start it, activate it, do some clicks & close it.You want the window to get active and then start it? Sounds like it shoud be the other way around? Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
Varian Posted September 12, 2010 Share Posted September 12, 2010 Have you triedOpt('WinDetectHiddenText', 1)Here is a quick bit of code that will display all of the CLASS:#32770 windows openOpt('WinTitleMatchMode', 4) Opt('WinDetectHiddenText', 1) Local $WindowArray = WinList('[CLASS:#32770]') Local $ProcessArray = ProcessList() For $i = 1 To $WindowArray[0][0] For $z = 1 To $ProcessArray[0][0] If WinGetProcess($WindowArray[$i][1]) = $ProcessArray[$z][1] Then Local $Name = $ProcessArray[$z][0] _Splash('Window Handle: ' & $WindowArray[$i][1] & @LF & 'PID: ' & WinGetProcess($WindowArray[$i][1]) & @LF & 'Name: ' & $Name) Sleep(2000) ExitLoop EndIf Next Next Func _Splash($Text) ;Shows a small borderless splash message. SplashTextOn('', $Text, 900, 80, -1, 5, 33, '', 14) EndFunc ;==>_Splash Link to comment Share on other sites More sharing options...
Glyco Posted September 12, 2010 Author Share Posted September 12, 2010 (edited) @ Varian i checked this post and found 6 process names with same class. Like: IDMan.exe UnlockerAssistant.exe IeMonitor.exe PicSet.exe endamule.exe DvdSpy.exe now how do i know that which is needed? i am confused. Edited September 12, 2010 by Glyco Link to comment Share on other sites More sharing options...
SharpShooter Posted September 12, 2010 Share Posted September 12, 2010 i think CLASS: #32770 is mostly used for VB Programs. So, it's a common class name & mostly programmers use it. Link to comment Share on other sites More sharing options...
wakillon Posted September 12, 2010 Share Posted September 12, 2010 That smell Bots... AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
Glyco Posted September 15, 2010 Author Share Posted September 15, 2010 That smell Bots...i have not created any game bot or spamming bot in my life.what i asked is for a Windows program.here is another window info without title>>>> Window <<<<Title:Class: TForm1Position: 147, 219Size: 532, 569Style: 0x16CA0000ExStyle: 0x00010110Handle: 0x00040320>>>> Control <<<<Class: Instance: ClassnameNN: Name: Advanced (Class): ID: Text: Position: Size: ControlClick Coords: Style: ExStyle: Handle: >>>> Mouse <<<<Position: 484, 231Cursor ID: 2Color: 0x0055E5>>>> StatusBar <<<<>>>> ToolsBar <<<<>>>> Visible Text <<<< Show DetailsDeleteStop>>>> Hidden Text <<<< Create New i need some solution. i have been trying to do for 1 week but no success yet. Link to comment Share on other sites More sharing options...
wakillon Posted September 15, 2010 Share Posted September 15, 2010 Sorry ! But no title, no text, no process : indices are light ! So, how do you recognize the window ? AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
Dav1d Posted September 15, 2010 Share Posted September 15, 2010 As wakillon says.. you somehow need a (unique) landmark to identify the correct window. May I ask what kind of appliation your're trying to automate? Maybe there are other ways to achieve the same? Link to comment Share on other sites More sharing options...
HavikTech Posted September 16, 2010 Share Posted September 16, 2010 Sorry ! But no title, no text, no process : indices are light ! So, how do you recognize the window ? i think there is still a way to do it. i am just giving an idea of what is in my mind. Maybe this can work... WinList() & get a list of all available windows using WinGetState option 1. Then, exclude all the Window's Handles which does not have Window Titles. Now, Get the Window size of windows without title using WinGetPos() & If $size[2] = $Win_Width & $size[3] = $Win_Height Then that 'll be the exact window which we are looking for... & then using it's handle we can work on it... i don't have time, maybe someone else can write a UDF of it. it 'll be great and helpful for all... i have one more idea but i am not sure if it 'll work or not, here is it: While 1 $size = WinGetPos("[active]") If $size[2] = 728 & $size[3] = 557 Then ;do some stuff using $size or [active] EndIf WEnd Link to comment Share on other sites More sharing options...
wakillon Posted September 16, 2010 Share Posted September 16, 2010 with the hope that its size is not proportional to screen's size ! AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
SharpShooter Posted September 16, 2010 Share Posted September 16, 2010 with the hope that its size is not proportional to screen's size !that is impossible.because the screen size can never be 728x557Right? Link to comment Share on other sites More sharing options...
Tvern Posted September 16, 2010 Share Posted September 16, 2010 @SprinterGuru: I don't think so, but it being based on the screen size doesn't have to mean it's the full screen size. It is also possible that the window is resizable and remembers it's last size, but it's easy to check if the size is constant. I believe size can be different depending on the OS you are running and what display style you use, but I'm not certain. HavikTech is probably on the right track here. You could also incorporate window styles into that idea and maibe check for available controls. If the software is something common, or some freeware, it'd still be nice to know what you're dealing with here and you'd get allot more examples. Link to comment Share on other sites More sharing options...
Varian Posted September 16, 2010 Share Posted September 16, 2010 @ Varian i checked this post and found 6 process names with same class. Like: IDMan.exe UnlockerAssistant.exe IeMonitor.exe PicSet.exe endamule.exe DvdSpy.exe now how do i know that which is needed? i am confused. You said that you are looking to manipulate a window of Class 32770, and the script I provided gave you a list of all of the Windows of that class. Was your process and Window open at that time? If it was, and you know the processes that are NOT the process that you are looking for, you can find your process through exclusion. You know that the process that you want is NOT IDMan.exe, and if it is not UnlockerAssistant.exe or IeMonitor.exe, you can scroll through the list to until you are left with only 1 process left.If you use the Opt('WinDetectHiddenText', 1), you can specify the window with unique text rather than using the process of elimination way above.Opt('WinTitleMatchMode', 4) [*]Opt('WinDetectHiddenText', 1) [*]$hWindow = WinGetHandle('[CLASS:#32770]', 'List1')Can't you just open taskmanager and look at the processes to narrow down your search of the process name? Unless it is being run by svchost, you can guesstimate a small list of processes that it could be.It seems like you have enough markers to identify the window that you are looking for. If more than one CLASS:#32770 window has "List1" in its text, you can further qualify it with scrolling through the array and use more text compares likeIf StringRegExp(WinGetText($WindowArray[$i][1]), ''), '(?i)Restart') Then [*] ;This is my window [*]EndIfI'm just not sure what is confusing you. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now