SandelPerieanu Posted March 6, 2009 Share Posted March 6, 2009 (edited) hi,any improvement is welcomedGuiCtrlSetonmove.au3 expandcollapse popup#include-once #include <GUIConstantsEx.au3> Global $move_id_control = 0, $last_primary_down_mctrlgui = 0, $dif_x_mctrlgui = 0, $dif_y_mctrlgui = 0 Global $mctrlgui_ctrls = '|' ; Func GuiCtrlSetonmove($mctrlgui_ctrls_gui, $mctrlgui_ctrls_id, $mctrlgui_enable = True) If $mctrlgui_enable Then $mctrlgui_ctrls &= $mctrlgui_ctrls_gui & '*' & $mctrlgui_ctrls_id & '|' Else $mctrlgui_ctrls = StringReplace($mctrlgui_ctrls, '|' & $mctrlgui_ctrls_gui & '*' & $mctrlgui_ctrls_id & '|', '|') EndIf GUISetOnEvent($gui_event_mousemove, "WM_MOVE_CONTROLS") EndFunc ;==>GuiCtrlSetonmove ; Func WM_MOVE_CONTROLS() Local $mctrlgui = @GUI_WinHandle If Not IsHWnd($mctrlgui) Then Return Local $cursorinfo_mctrlgui, $control_pos_mctrlgui $cursorinfo_mctrlgui = GUIGetCursorInfo($mctrlgui) $control_pos_mctrlgui = ControlGetPos('', '', $move_id_control) If $move_id_control <> $cursorinfo_mctrlgui[4] And $last_primary_down_mctrlgui = 0 Then $move_id_control = $cursorinfo_mctrlgui[4] If StringReplace($mctrlgui_ctrls, '|' & @GUI_WinHandle & '*' & $move_id_control & '|', '') <> $mctrlgui_ctrls Then If $last_primary_down_mctrlgui <> $cursorinfo_mctrlgui[3] Then $last_primary_down_mctrlgui = $cursorinfo_mctrlgui[3] $move_id_control = $cursorinfo_mctrlgui[4] If $last_primary_down_mctrlgui = 1 Then ControlDisable(@GUI_WinHandle, '', $move_id_control) $dif_x_mctrlgui = $cursorinfo_mctrlgui[0] - $control_pos_mctrlgui[0] $dif_y_mctrlgui = $cursorinfo_mctrlgui[1] - $control_pos_mctrlgui[1] Else ControlEnable(@GUI_WinHandle, '', $move_id_control) $dif_x_mctrlgui = 0 $dif_x_mctrlgui = 0 EndIf EndIf If $cursorinfo_mctrlgui[3] = 1 And $move_id_control > 0 Then ControlMove('', '', $move_id_control, $cursorinfo_mctrlgui[0] - $dif_x_mctrlgui, $cursorinfo_mctrlgui[1] - $dif_y_mctrlgui) EndIf EndIf EndFunc ;==>WM_MOVE_CONTROLSoÝ÷ Ù±®+k':s(½àÞ®ßöÚºÚ"µÍÚ[ÛYH ÑÕRPÛÛÝ[Ñ^]LÉÝÂÚ[ÛYH ÑÝZPÝÙ]Û[ÝK]LÉÝÂÜ ][ÝÑÕRSÛ][[ÙI][ÝËJBÌÍÛXZ[ÙÝZWÌHHÕRPÜX]J ÌÎNÓ[ÝHHYIÌÎNË L LLKLJBÕRTÙ]Û][ ÌÍÙÝZWÙ][ØÛÜÙK ÌÎNÑ^]Ð[ ÌÎNÊBÌÍØÝÌHHÕRPÝÜX]P]Û ÌÎNÕÝÌIÌÎNË K KLL BÕRPÝÙ]Û][ ÌÍØÝÌK ÌÎNÕÝ ÌÎNÊBÝZPÝÙ]Û[ÝJ ÌÍÛXZ[ÙÝZWÌK ÌÍØÝÌJBÌÍØÝÌHÕRPÝÜX]QY] ÌÎNÕÝÌÌÎNËMLLLL BÝZPÝÙ]Û[ÝJ ÌÍÛXZ[ÙÝZWÌK ÌÍØÝÌBÕRTÙ]Ý]J BÂÛÛ ][ÝÕÚ][ÝÙWÔÙXÛÛWÐ]Û[ÝHØ[[ÝHHÛÛÛÈ YÉÌÎNÛÌÎNÑÜ I][ÝÊBÂÚ[HBÛY JBÑ[Â[È^]Ð[ B^][[ÈÏOIÝÑ^]Ð[Â[ÈÝ BÙÐÞ M ÌÎNÉÌÎNËÕRPÝXY ÌÍØÝÌJBÝZPÝÙ]Û[ÝJ ÌÍÛXZ[ÙÝZWÌK ÌÍØÝÌK[ÙJBÛÛ ÌÎNÓÝÈÛH ÌÍØÝÌØ[H[ÝIÌÎNÊB[[ÈÏOIÝÕÝ Edited March 6, 2009 by psandu.ro Link to comment Share on other sites More sharing options...
SandelPerieanu Posted March 9, 2009 Author Share Posted March 9, 2009 nobody? Link to comment Share on other sites More sharing options...
damian666 Posted March 9, 2009 Share Posted March 9, 2009 wtf... thats cool man ^^ can ya make it so that it remembers teh place ya put the controls? nice script man, very clear written ^^ Damian666 and proud of it!!! Link to comment Share on other sites More sharing options...
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