AJ6594 Posted March 31, 2008 Posted March 31, 2008 There will be several windows open on my desktop. I will not know the titles of them ahead of time.These windows will be placed in specific positions.I want to activate the window with the position of (5,5)then I want to activate the window in position (500,500)post code and Ill give you a cookie..ty
Ealric Posted March 31, 2008 Posted March 31, 2008 There will be several windows open on my desktop. I will not know the titles of them ahead of time.These windows will be placed in specific positions.I want to activate the window with the position of (5,5)then I want to activate the window in position (500,500)post code and Ill give you a cookie..tyIf you want some help you should post some example code you are working with. Don't expect people to write code for you. My Projects: [topic="89413"]GoogleHack Search[/topic], [topic="67095"]Swiss File Knife GUI[/topic], [topic="69072"]Mouse Location Pointer[/topic], [topic="86040"]Standard Deviation Calculator[/topic]
AJ6594 Posted March 31, 2008 Author Posted March 31, 2008 If you want some help you should post some example code you are working with. Don't expect people to write code for you.thxs jerk, now nobody will post any codeI dont want to post my lame code, because I am trying to learn you have just made it harder for me
mikeyr Posted March 31, 2008 Posted March 31, 2008 Its not lame code if you are learning, it may not be the best code but its not lame if you are honestly trying to learn. First rule of the web, never be embarrassed by your code! we all had to learn at one time and we all wrote garbage in the beginning.
AJ6594 Posted March 31, 2008 Author Posted March 31, 2008 Its not lame code if you are learning, it may not be the best code but its not lame if you are honestly trying to learn. First rule of the web, never be embarrassed by your code! we all had to learn at one time and we all wrote garbage in the beginning.I WANT TO SEE HOW OTHERS WOULD TACKLE THIS CODEI dont want my code to influence this thread.
martin Posted March 31, 2008 Posted March 31, 2008 thxs jerk, now nobody will post any codeI dont want to post my lame code, because I am trying to learn you have just made it harder for meMaybe you made it harder for yourself. I encourage you to try producing some code.You don't get big muscles asking someone else to pick up weights for you and it's no different with mental skills. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
AJ6594 Posted March 31, 2008 Author Posted March 31, 2008 (edited) Func activate1() $windows = WinList() For $i=1 to $windows[0][0] $title = $windows[$i][0] $position = WinGetPos($title,"") if $position[1] = 5 Then WinActivate($title,"") EndIf Next EndFunc Func activate2() $x = WinList() For $i = 1 to $x[0][0] $title = $x[$i][0] $position = WinGetPos($title,"") If $position[1] = 500 Then WinActivate($title,"") Sleep(2000) MsgBox(0,"","") EndIf Next EndFunc Edited March 31, 2008 by AJ6594
PsaltyDS Posted March 31, 2008 Posted March 31, 2008 (edited) Func activate1() $windows = WinList() For $i=1 to $windows[0][0] $title = $windows[$i][0] $position = WinGetPos($title,"") if $position[1] = 5 Then WinActivate($title,"") EndIf Next EndFunc Func activate2() $x = WinList() For $i = 1 to $x[0][0] $title = $x[$i][0] $position = WinGetPos($title,"") If $position[1] = 500 Then WinActivate($title,"") Sleep(2000) MsgBox(0,"","") EndIf Next EndFunc I would have put it all in one function, and used handles instead of the titles, much more reliable that way. If more than one window has the same title, your code will not necessarily get the right one. Func _Activate() Local $windows = WinList(), $avPosition For $i = 1 To $windows[0][0] $avPosition = WinGetPos($windows[$i][1], "") If $avPosition[1] = 5 Then WinActivate($windows[$i][1]) ElseIf $avPosition[1] = 500 Then WinActivate($windows[$i][1]) Sleep(2000) MsgBox(0, "", "") EndIf Next EndFunc ;==> _Activate I am sympathetic to the idea of not posting lame code, but you should get over that (I did, and have posted lots of lame stuff). The best help I have received or given on this forum has come from specific analysis of specific code. If you expect to continue getting help here, the "Jerk" stuff will have to be dropped. There are other, more juvenile, sites you can practice that kind of "learning". Edit: Typo. Edited March 31, 2008 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
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