Iuli Posted September 4, 2009 Posted September 4, 2009 Hi, I really got stuck today with this problem. How can i check if a window is moving ? I did this for the GUI created with AutoIT, via GUIRegisterMsg (). But how can i do this for other windows ? Thank you very much, Iuli. [size="2"]SFXMaker[/size] - The most complete switchless installer creator software[indent][/indent]
Iuli Posted September 4, 2009 Author Posted September 4, 2009 That will not work. For example, if i just click the top part of a window (where title is placed), without actually moving it, GUIRegisterMsg () will return that the window is moving, what i cannot do with WinGetPos. Any other suggestions ? [size="2"]SFXMaker[/size] - The most complete switchless installer creator software[indent][/indent]
99ojo Posted September 4, 2009 Posted September 4, 2009 (edited) Hi, a click on top of the window doesn't mean that the window is really moved. It's 'prepared' for moving. This is tested with Winword 2003 and only fired if the window is really moved: Opt("WinTitleMatchMode", 2) ShellExecute ("winword.exe") WinWait ("Word") $getpos1st = WinGetPos ("Word") While ProcessExists ("Winword.exe") $getpos2nd = WinGetPos ("Word") If $getpos1st [0] <> $getpos2nd [0] Or $getpos1st [1] <> $getpos2nd [1] Then $getpos1st [0] = $getpos2nd [0] $getpos1st [1] = $getpos2nd [1] ConsoleWrite ("Window moved" & @CRLF) EndIf Sleep (50) WEnd ;-)) Stefan Edited September 4, 2009 by 99ojo
Moderators SmOke_N Posted September 4, 2009 Moderators Posted September 4, 2009 http://www.autoitscript.com/forum/index.php?showtopic=56536 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.
Yashied Posted September 4, 2009 Posted September 4, 2009 http://www.autoitscript.com/forum/index.php?showtopic=56536It will not register the windows movement. My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More...
Moderators SmOke_N Posted September 4, 2009 Moderators Posted September 4, 2009 (edited) It will not register the windows movement.Looks like the OP is stuck using position polling or writing SetWindowsHookEx method then.Edit:Or placing their own GUI as a child to the window in question, and using the GUIRegisterMsg() method that way. Edited September 4, 2009 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.
Iuli Posted September 4, 2009 Author Posted September 4, 2009 Looks like the OP is stuck using position polling or writing SetWindowsHookEx method then. Edit: Or placing their own GUI as a child to the window in question, and using the GUIRegisterMsg() method that way. SmOke_N, i tried the method you mentioned, the one with child GUI. It doesn't work. If you move the parent window, the child window does not respond as it is moved. Here's the code i tried #include "WinAPIEx.au3" $ActiveWin=WinGetTitle("[active]") $ActiveWinPos=WinGetPos($ActiveWin) $ChildGUI=GUICreate("ChildGUI",$ActiveWinPos[2],$ActiveWinPos[3],0,0) GUIRegisterMsg(0x0216,"IsMoving") GUISetState(@SW_SHOW) $ParentWindow=WinGetHandle($ActiveWin) _WinAPI_SetParent($ChildGUI, $ParentWindow) Func IsMoving ($hWnd, $Msg, $wParam, $lParam) ConsoleWrite("Working" & @CRLF) EndFunc While 1 WEnd Did i do something wrong ? [size="2"]SFXMaker[/size] - The most complete switchless installer creator software[indent][/indent]
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