magician13134 Posted November 25, 2006 Posted November 25, 2006 What's the class name or handle, or whatever for the start button? Visit Magic Soft Inc. for some of my software
PaulIA Posted November 26, 2006 Posted November 26, 2006 What's the class name or handle, or whatever for the start button?Using the AutoIt Window Info tool that comes with AutoIt reveals that the Start button class name is "Button". Auto3Lib: A library of over 1200 functions for AutoIt
Paulie Posted November 26, 2006 Posted November 26, 2006 What's the class name or handle, or whatever...Well which is it?Classname, handle, or whatever?
magician13134 Posted November 26, 2006 Author Posted November 26, 2006 Well which is it?Classname, handle, or whatever?I don't know... I don't think it matters... any of them will let me control it, right? Visit Magic Soft Inc. for some of my software
magician13134 Posted November 26, 2006 Author Posted November 26, 2006 Hmmm... I can't find the "Edit" button... Is something wrong, or am I just that dumb? How do I use the name "button"? Like... if I were to get the position of the start button... how would I do that using "button"? And where does that AutoIt Window Info tool live? Thanks Visit Magic Soft Inc. for some of my software
BigDod Posted November 26, 2006 Posted November 26, 2006 And where does that AutoIt Window Info tool live?Start>>All Programs>>Autoit v3 Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother
magician13134 Posted November 26, 2006 Author Posted November 26, 2006 dang... still nothing there that'll let me get info from it... Visit Magic Soft Inc. for some of my software
Moderators SmOke_N Posted November 26, 2006 Moderators Posted November 26, 2006 Funny, I was able to pull the info:Opt('WinTitleMatchMode', 4) ControlClick('classname=Shell_TrayWnd', 'start', 'Button1') 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.
magician13134 Posted November 26, 2006 Author Posted November 26, 2006 (edited) Funny, I was able to pull the info:Opt('WinTitleMatchMode', 4) ControlClick('classname=Shell_TrayWnd', 'start', 'Button1') What exactly does your code do... it didn't do anything... And I don't think that worked... it returned a 0... which means it failed... Edited November 26, 2006 by magician13134 Visit Magic Soft Inc. for some of my software
Moderators SmOke_N Posted November 26, 2006 Moderators Posted November 26, 2006 That gives me an error... Opt("WinTitleMatchMode", 4) $size = WinGetPos("classname=Shell_TrayWnd", "start", "Button1") MsgBox(0, "Active window stats (x,y,width,height):", $size[0] & " " & $size[1] & " " & $size[2] & " " & $size[3]) What exactly does your code do... it didn't do anything...2 problems with your code... 1. Did you bother to check the parameters of WinGetPos? (Maybe ControlGetPos())? 2. You don't error check to make sure it's an array. 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.
magician13134 Posted November 26, 2006 Author Posted November 26, 2006 (edited) 2 problems with your code...1. Did you bother to check the parameters of WinGetPos? (Maybe ControlGetPos())?2. You don't error check to make sure it's an array.Yeah... I saw that, that's why I deleted it... I never tried to use an array in your code...Oh, and ControlGetPos still returns 0 Edited November 26, 2006 by magician13134 Visit Magic Soft Inc. for some of my software
Moderators SmOke_N Posted November 26, 2006 Moderators Posted November 26, 2006 (edited) Are you trying to do the Start button on your system tray? Try this... I don't know what yours is called, but mine is called button1$SC = _GetScreenCoords() If IsArray($SC) Then MouseClick('primary', Random($SC[0], $SC[2], 1), Random($SC[1], $SC[3], 1), 1, 1) Func _GetScreenCoords($sText = "classname=Shell_TrayWnd") $OptWTMM = Opt("WinTitleMatchMode", 4) $aCPos = ControlGetPos($sText, "", "Button1") $aWPos = WinGetPos($sText) If Not IsArray($aCPos) Or Not IsArray($aWPos) Then Return SetError(1, 0, 0) Local $aReturn[4] = [$aWPos[0] + $aCPos[0], $aWPos[1] + $aCPos[1] + 4, _ $aCPos[2] - 4, $aWPos[1] + $aCPos[1] + 4 + $aCPos[3]] Opt('WinTitleMatchMode', $OptWTMM) Return $aReturn EndFunc I really have no idea what you are trying to do, but the above will return screen coordinates for the start button in your system tray (at least if my math is right it will). Edited November 26, 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.
magician13134 Posted November 26, 2006 Author Posted November 26, 2006 Are you trying to do the Start button on your system tray? Try this... I don't know what yours is called, but mine is called button1$SC = _GetScreenCoords() If IsArray($SC) Then MouseClick('primary', Random($SC[0], $SC[2], 1), Random($SC[1], $SC[3], 1), 1, 1) Func _GetScreenCoords($sText = "classname=Shell_TrayWnd") $OptWTMM = Opt("WinTitleMatchMode", 4) $aCPos = ControlGetPos($sText, "", "Button1") $aWPos = WinGetPos($sText) If Not IsArray($aCPos) Or Not IsArray($aWPos) Then Return SetError(1, 0, 0) Local $aReturn[4] = [$aWPos[0] + $aCPos[0], $aWPos[1] + $aCPos[1] + 4, _ $aCPos[2] - 4, $aWPos[1] + $aCPos[1] + 4 + $aCPos[3]] Opt('WinTitleMatchMode', $OptWTMM) Return $aReturn EndFunc I really have no idea what you are trying to do, but the above will return screen coordinates for the start button in your system tray (at least if my math is right it will). Well, yeah, that does click it... but... what I wanted to do was more like this: http://www.rjlsoftware.com/software/entertainment/avoid/ I'm trying to rewrite everyone of their software programs, just as a personal challenge.... Visit Magic Soft Inc. for some of my software
Moderators SmOke_N Posted November 26, 2006 Moderators Posted November 26, 2006 (edited) Well, yeah, that does click it... but... what I wanted to do was more like this:http://www.rjlsoftware.com/software/entertainment/avoid/I'm trying to rewrite everyone of their software programs, just as a personal challenge....Ok, I thought you might be up to something like that... my function will return the coords, now it's your job to do something else with it... we did something like this in the scripts and scraps forum a while back.Edit:http://www.autoitscript.com/forum/index.php?showtopic=30838 Edited November 26, 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.
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