Amen Posted August 7, 2005 Share Posted August 7, 2005 (edited) If you look with Autoit info tool you can read the Class under the title. Scite's is SciTEWindow winRar's is WinRarWindow How can i take the Class name of a window title or from a process if better in my prog? (Not the WinGetClassList) Edited August 7, 2005 by Amen Plugged ThoughtsQBsick? check my Old staff (New Launchers to Work with Windows.Thnx to Autoit!)Game Development ToolsPortes (A Backgammon game)Ball (An Arkanoid Style game)Au3? SecretProgz - Reveals Commands that can be used on your system CleanOut - Uninstall leftovers Enable windows XP Autologon. Stop Windows Auto Sharing your hard drives (C$,D$,etc) D-Link - Create a dynamic link.Useful for server shortcuts Fun - How would your name sounds in Japanese,Russian or Reventian? Fix_srt - Shift a subtitle (.srt) some secs +/- Link to comment Share on other sites More sharing options...
belitre Posted February 28, 2006 Share Posted February 28, 2006 If you look with Autoit info tool you can read the Class under the title.Scite's is SciTEWindowwinRar's is WinRarWindowHow can i take the Class name of a window title or from a process if better in my prog? (Not the WinGetClassList) I also need this information. It cand be a way to build dinamically controls' classNameNN. Could someone tell us if this is imposible with autoit (at the moment).? Thanks a lot. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted February 28, 2006 Moderators Share Posted February 28, 2006 (edited) I could be wrong, but I believe these 2 questions are actually different.@AmenOpt('WinTitleMatchMode', 4) $Title = WinGetTitle('classname=WinRarWindow') MsgBox(0, 'Title', 'The Title Is: ' & $Title)@belitre: http://www.autoitscript.com/forum/index.ph...topic=17210&hl=Edit:I didn't notice you used the word 'build' belitre, but that thread may still come in handy for future ventures if your going to play with ClassNameNN(s). Edited February 28, 2006 by SmOke_N 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. Link to comment Share on other sites More sharing options...
Valuater Posted February 28, 2006 Share Posted February 28, 2006 i just played a little #include <GUIConstants.au3> Run("notepad.exe", "", @SW_MAXIMIZE) sleep(2000) $File = FileGetShortName(@ProgramFilesDir & "\Autoit3\Au3info.exe") $PID = Run($File,"", @SW_MINIMIZE) ControlSend("Untitled","","Edit1","Getting info" & @CRLF) MouseClick("left", 100, 100) Sleep(2000) $text = ControlGetText ("AutoIt v3 Active Window Info", "Press CTRL-ALT-F to pause the display.", "Edit1" ) $result = StringSplit($text, @CRLF) MsgBox(64, "Class", $result[9] ) ControlSend("Untitled","","Edit1", $text) WinClose("AutoIt v3 Active Window Info") 8) Link to comment Share on other sites More sharing options...
belitre Posted February 28, 2006 Share Posted February 28, 2006 i just played a little #include <GUIConstants.au3> Run("notepad.exe", "", @SW_MAXIMIZE) sleep(2000) $File = FileGetShortName(@ProgramFilesDir & "\Autoit3\Au3info.exe") $PID = Run($File,"", @SW_MINIMIZE) ControlSend("Untitled","","Edit1","Getting info" & @CRLF) MouseClick("left", 100, 100) Sleep(2000) $text = ControlGetText ("AutoIt v3 Active Window Info", "Press CTRL-ALT-F to pause the display.", "Edit1" ) $result = StringSplit($text, @CRLF) MsgBox(64, "Class", $result[9] ) ControlSend("Untitled","","Edit1", $text) WinClose("AutoIt v3 Active Window Info") 8) Thanks, Valuater. It can be a solution (and an idea to deal with some problems I have to solve). It's a pity that it can't be made programatically (via getWinClass function or similar). I will suggest it for next autoit versions. SmOke_N, you're right that thread will be useful for me. At this time I want to access to my controls adding NN to ClassName. NN doesn't change each iteration, but ClassName does. While I'm not able to find a more 'elegant' solution I will adapt Valuater's code. Link to comment Share on other sites More sharing options...
Valuater Posted February 28, 2006 Share Posted February 28, 2006 i want to seee if anyone has a better idea... mine is not real good so... BUMPITY 8) Link to comment Share on other sites More sharing options...
belitre Posted March 3, 2006 Share Posted March 3, 2006 I have thought another posibility for my problem, using WinGetClassList. In my enviroment, the windows change the name in each execution, and the controls contained in those windows have a fixed name depending on window's ClassName. An example: Window class name: WindowsForms10.window.8.app3c Window Edit control 1: WindowsForms10.EDIT.app3c1 Window Edit control 2: WindowsForms10.EDIT.app3c2 Window Button control 1: WindowsForms10.BUTTON.app3c1 What changes in each iteration is windows class name, affecting all buttons. And this is what I've written to work with these buttons: Func tools_ControlName($strCtrlType, $hwndWindow, $mNumber) Dim $strCtrlName Dim $arrayClassList[99] Dim $i $arrayClassList = StringSplit(WinGetClassList($hwndWindow),@LF) ; We find $strCtrlType in window, getting ClassName For $i = 1 To $arrayClassList[0] If (StringInStr($arrayClassList[$i],$strCtrlType) > 0) Then $strCtrlName = $arrayClassList[$i] & $mNumber ExitLoop(1) EndIf Next Return $strCtrlName EndFunc So in a main program I can do something like: $strCtrlName = tools_ControlName($strCtrlType, $hwndWindow, $mNumber) [i]; We can switch here for each type of control[/color][/i] $hwndControl = ControlGetHandle($hwndVentana, "", $strCtrlName) [i]; And do what we want with it[/color][/i] I accept any suggestion or critic. Thanks. 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