Cybship Posted December 13, 2015 Posted December 13, 2015 Hi, I am using an IP Camera software called "XXCAMERA" and it does not have a title. I would like to use the 'WinMove' command to position the window in a certain spot on the screen, but apparently the lack of a title is preventing the script to execute the command. It appears to want to run, but the window does not move. Have tried the following two scripts:WinMove("XXCAMERA", "", -585, 392, 960, 750) >> Here I am using the name of the program that shows in the task manager, I see the icons in the taskbar flashing so the script apparently tried to run, but the window did not moveWinMove("", "", -585, 392, 960, 750) >> Here I am leaving the title blank, this one winds up moving the windows explorer window insteadAny ideas how I can move a window that does not show a name in the title bar, or in the AutoIt Info window when I move the Finder Tool over the window?
water Posted December 13, 2015 Posted December 13, 2015 Use the AutoIt Window Info Tool to get the class and then pass this class to WinMove. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Cybship Posted December 14, 2015 Author Posted December 14, 2015 (edited) That didn't work, did I do it right?WinMove("Afx:00D90000:b:00010005:00000006:00070424", "", -585, 392, 960, 750) Edited December 14, 2015 by Cybship Correction
Cybship Posted December 14, 2015 Author Posted December 14, 2015 Never mind, I didn't use class properly, got it to work now. Thank you for the help!!WinMove("[Class:Afx:00D90000:b:00010005:00000006:00070424]", "", -585, 392, 960, 750)
water Posted December 14, 2015 Posted December 14, 2015 My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Cybship Posted December 16, 2015 Author Posted December 16, 2015 I didn't think of the class value changing when the software is closed, which means I have to look up and enter the new value in the script each time the software opens. Is there a workaround for that?
Moderators JLogan3o13 Posted December 16, 2015 Moderators Posted December 16, 2015 @Cybship is there anything that stays the same on the window (visible text?). There are a couple of options, but you have to have at least some consistent feature to search for. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
Cybship Posted December 17, 2015 Author Posted December 17, 2015 There is a consistent top menu bar that has four items (system, screen, view, help) with drop down menus items, and a number of clickable icons below that in a second bar, screenshot attached.
Moderators JLogan3o13 Posted December 17, 2015 Moderators Posted December 17, 2015 Use the AutoIt Window Info tool as suggested before. Post what it shows you under the Visible Text tab.... "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
Cybship Posted December 17, 2015 Author Posted December 17, 2015 This is what it shows for visible text:osdir关闭开关打开shangxia反转左右反转左右巡航上下巡航RIGHTDOWNDOWNLEFEDOWNRIGHTSTOPLEFTRIGHTUPUPLEFTUP菜单栏Toolbar
Cybship Posted December 22, 2015 Author Posted December 22, 2015 Is there a way to use the visible text with WinMove?
InunoTaishou Posted December 22, 2015 Posted December 22, 2015 (edited) If you can can launch the software you could get the handle to the window through its PID (Or you could get the PID manually and input it)https://www.autoitscript.com/wiki/FAQ#How_can_I_get_a_window_handle_when_all_I_have_is_a_PID.3FThis should work, just make sure you don't activate some other window while you're waiting for the software to initialize. You could replace the while loop with just a long enough pause until your camera software starts and then move it.$hActiveWindow = WinGetHandle("[Active]") ;Run process $iPID = Run("D:\Program Files (x86)\Putty\putty.exe") ; Sleep until the software initializes While (WinGetHandle("[Active]") = $hActiveWindow) Sleep(100) WEnd ;Get HWND. $hWnd = _GetHwndFromPID($iPID) ;Move software WinMove($hWnd, "", -585, 392, 960, 750) ;Function for getting HWND from PID Func _GetHwndFromPID($PID) $hWnd = 0 $winlist = WinList() Do For $i = 1 To $winlist[0][0] If $winlist[$i][0] <> "" Then $iPID2 = WinGetProcess($winlist[$i][1]) If $iPID2 = $PID Then $hWnd = $winlist[$i][1] ExitLoop EndIf EndIf Next Until $hWnd <> 0 Return $hWnd EndFunc;==>_GetHwndFromPID Edited December 22, 2015 by InunoTaishou
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