lingo124 Posted May 21, 2013 Share Posted May 21, 2013 (edited) I have a game and am running 1 copy of the proram in sandboxie and 1 copy of the program by itself. Sandboxie appends its [#] thing to the title. e.g Regular Program title: program title Sandboxie Program title: [#] program title[#] When I try to use wingetpos() on the first title, it works fine. But when I try to use wingetpos() on the sandboxie title, nothing is returned. However, if I set the sandboxie program to display the original program title, it can find the position just fine. But then I can only get the position of one of the windows because they share the same name and wingetpos() only gets the most recently active window. I thought it might have to do with escaping characters, so I tried escaping the brackets with "", and then I tried escaping the pound signs. Neither worked. It would always return an error saying subscript used with nonvariable array. My code: Global $windowinfo, $windowinfos $windowinfo = WinGetPos("THEGAME™ ") $x = $windowinfo[0] $y = $windowinfo[1] $windowinfos = WinGetPos("[#] THEGAME™ [#]") $xs = $windowinfos[0] $ys = $windowinfos[1] Any help would be appreciated. Thanks Edited May 21, 2013 by lingo124 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 21, 2013 Moderators Share Posted May 21, 2013 lingo124, Welcome to the AutoIt forum. To what end are you trying to identify these windows? Please read the Forum rules (there is also a link at bottom right of each page) to see what is not permitted here. But please also note that this is not the correct section for general queries - "General Help" is more suitable than "Developer Chat". I will move the thread for you. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
lingo124 Posted May 21, 2013 Author Share Posted May 21, 2013 (edited) Sorry about that. I just saw general coding talk and put it there. I am trying to get the position of each of the windows so I can figure out the position of window elements in relation to its position (i.e. the enter key is 300,200 from the top right of the window. I am trying to use functions like mouseclick along with a coordinate.) Edited May 21, 2013 by lingo124 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 21, 2013 Moderators Share Posted May 21, 2013 lingo124, I take from that reply that you did not bother to read the Forum rules to which I linked - and which clearly state that game interaction is not a permitted subject here. Using MouseClick on game windows is interaction in my book. Please take the time to read the rules before you post again - thread locked. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Recommended Posts