Jump to content

Need help on WinGetPos()


Recommended Posts

I have Notepad and am running 1 copy of Notepad in sandboxie and 1 copy of the program by itself. Sandboxie appends its [#] thing to the title. e.g
 
Regular Program title:
Notepad
 
Sandboxie Program title:
[#] Notepad [#]
 
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("Notepad ")
$x = $windowinfo[0]
$y = $windowinfo[1]
$windowinfos = WinGetPos("[#] Notepad [#]")
$xs = $windowinfos[0]
$ys = $windowinfos[1]
 
I need the window positions to calculate the locations of text boxes and words within the program. 
 
This program is not used for
1)malware
2)bypassing security measures
3)automation contrary to EULA
4)launching games
5)running or injecting code
6)decompilaton of anything
7)a non-exhaustive list of anything else
 
It is not
1)pornographic
2)explicit
3)express anti societal ideas
4)copyrighted material
 
It is NOT the same question as posted before because now it is interacting with Notepad so I can enter data and save it using 2 different instances.
 
Other than that thanks for any help! :D

Edited by Melba23
Reduced font size
Link to comment
Share on other sites

  • Moderators

lingo124,

 

You obviously missed this bit:

 

 

"Do not repost the same question if the previous thread has been locked - particularly if you merely reword the question to get around one of the prohibitions listed above"

 

 

Please do not try a third time. :naughty:

 

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...