Jump to content

cheatera

Active Members
  • Posts

    55
  • Joined

  • Last visited

About cheatera

  • Birthday 01/06/1983

Profile Information

  • Location
    Bulgaria

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

cheatera's Achievements

Wayfarer

Wayfarer (2/7)

0

Reputation

  1. DONE! now i removed movers, decided there is no point to create 8 more ctrls while i can just moved them around the edited label, and actualy this-a-like i know wich hotspot im in, when i look at the movers that they are on it ... Download pic again if needed. ;//includes #include <GUIConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Include <Misc.au3> ;#include <GUICtrlOnHover.au3> ;//options Opt("MouseCoordMode", 2) ;Opt("CaretCoordMode", 2) ;//vars Dim $hotspot_ctrl[99] Dim $hotspot_loc[99] Dim $hotspot_info[99][11] Dim $hotspot_movers[9] $hotspot_count = 0 ;//gui $frame_gui = GUICreate("Form1", 1025, 769, -1, -1, BitOR($WS_POPUP,$WS_GROUP)) $pic = GUICtrlCreatePic("pic.jpg", 0, 0, 1024, 768) GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlSetCursor (-1, 3) For $i = 1 to 8 $hotspot_movers[$i] = GUICtrlCreateLabel("", -11, -11, 1, 1, $SS_WHITEFRAME) Next GUISetState(@SW_SHOW) $current_hotspot = 1 ;//main loop Do $msg = GUIGetMsg() ;$ID = GUIGetCursorInfo($frame_gui) $mpos = MouseGetPos() $mouse_cur = MouseGetCursor() For $i = 1 to 98 If $msg = $hotspot_ctrl[$i] And $hotspot_loc[$i] <> "" then $current_hotspot = $i $_dim_ = StringSplit($hotspot_loc[$i], ",") _MoveMovers($_dim_[1], $_dim_[2], $_dim_[3], $_dim_[4]) EndIf Next If $msg = $GUI_EVENT_PRIMARYDOWN And $mouse_cur = 2 then _MoveMovers(-666) $hotspot_count += 1 _CreateHotSpot($mpos[0], $mpos[1], $hotspot_count) EndIf If $msg = $hotspot_movers[1] then ;gore vlqvo ;$current_hotspot = 1 _Resize($current_hotspot, 1) EndIf If $msg = $hotspot_movers[2] then ;gore sreda ;$current_hotspot = 1 _Resize($current_hotspot, 2) EndIf If $msg = $hotspot_movers[3] then ;gore dqsno ;$current_hotspot = 1 _Resize($current_hotspot, 3) EndIf If $msg = $hotspot_movers[4] then ;sreda vlqvo ;$current_hotspot = 1 _Resize($current_hotspot, 4) EndIf If $msg = $hotspot_movers[5] then ;sreda dqsno ;$current_hotspot = 1 _Resize($current_hotspot, 5) EndIf If $msg = $hotspot_movers[6] then ;dolu vlqvo ;$current_hotspot = 1 _Resize($current_hotspot, 6) EndIf If $msg = $hotspot_movers[7] then ;dolu sreda ;$current_hotspot = 1 _Resize($current_hotspot, 7) EndIf If $msg = $hotspot_movers[8] then ;dolu dqsno ;$current_hotspot = 1 _Resize($current_hotspot, 8) EndIf Until $msg = $GUI_EVENT_CLOSE ;//funcs Func _MoveMovers($x = -666, $y = -1, $w = -1, $h = -1, $hotspot = -1) If $x = -666 then For $i = 1 to 8 GUICtrlSetPos($hotspot_movers[$i], -11, -11, 1, 1) Next Else ;gore-lqvo GUICtrlSetPos($hotspot_movers[1], $x - 4.5, $y - 4.5, 5, 5) ;gore_sreda GUICtrlSetPos($hotspot_movers[2], ($x + ($w / 2)) - 2.5, $y - 4.5, 5, 5) ;gore_dqsno GUICtrlSetPos($hotspot_movers[3], $x + $w, $y - 4.5, 5, 5) ;sreda_lqvo GUICtrlSetPos($hotspot_movers[4], $x - 5, $y + ($h / 2) - 2.5, 5, 5) ;sreda_dqsno GUICtrlSetPos($hotspot_movers[5], $x + $w, $y + ($h / 2) - 3, 5, 5) ;dolu_lqvo GUICtrlSetPos($hotspot_movers[6], $x - 5, $y + $h, 5, 5) ;dolu_sreda GUICtrlSetPos($hotspot_movers[7], ($x + ($w / 2)) - 2.5, $y + $h, 5, 5) ;dolu_dqsno GUICtrlSetPos($hotspot_movers[8], $x + $w, $y + $h, 5, 5) EndIf EndFunc Func _Resize($_curr_hs, $_mover) ;$mover = clicked mover (1-8) Local $hotspot = $_curr_hs Local $dim = StringSplit($hotspot_loc[$hotspot], ",") Local $win_coords = WinGetPos($frame_gui) If $_mover = 1 then GUICtrlSetCursor($hotspot_ctrl[$hotspot], 12) EndIf If $_mover = 2 then GUICtrlSetCursor($hotspot_ctrl[$hotspot], 11) EndIf If $_mover = 3 then GUICtrlSetCursor($hotspot_ctrl[$hotspot], 10) EndIf If $_mover = 4 then GUICtrlSetCursor($hotspot_ctrl[$hotspot], 13) EndIf If $_mover = 5 then GUICtrlSetCursor($hotspot_ctrl[$hotspot], 13) EndIf If $_mover = 6 then GUICtrlSetCursor($hotspot_ctrl[$hotspot], 10) EndIf If $_mover = 7 then GUICtrlSetCursor($hotspot_ctrl[$hotspot], 11) EndIf If $_mover = 8 then GUICtrlSetCursor($hotspot_ctrl[$hotspot], 12) EndIf If $_mover = 1 then _MouseTrap($win_coords[0], $win_coords[1], (($dim[1] + $dim[3]) - 5) + $win_coords[0], (($dim[2] + $dim[4]) - 5) + $win_coords[1]) Do $msg3 = GUIGetMsg() $mpos = MouseGetPos() GUICtrlSetPos($hotspot_ctrl[$hotspot], $mpos[0], $mpos[1], ($dim[1] + $dim[3]) - $mpos[0], ($dim[2] + $dim[4]) - $mpos[1]) _MoveMovers($mpos[0], $mpos[1], ($dim[1] + $dim[3]) - $mpos[0], ($dim[2] + $dim[4]) - $mpos[1], $hotspot) $hotspot_loc[$hotspot] = $mpos[0] & "," & $mpos[1] & "," & ($dim[1] + $dim[3]) - $mpos[0] & "," & ($dim[2] + $dim[4]) - $mpos[1] ToolTip("X = " & $mpos[0] & @CRLF & "Y = " & $mpos[1] & @CRLF & "Width = " & ($dim[1] + $dim[3]) - $mpos[0] & @CRLF & "Height = " & ($dim[2] + $dim[4]) - $mpos[1]) Until $msg3 = $GUI_EVENT_PRIMARYUP EndIf If $_mover = 2 then _MouseTrap($win_coords[0] + $dim[1], $win_coords[1], (($dim[1] + $dim[3]) - 5) + $win_coords[0], (($dim[2] + $dim[4]) - 5) + $win_coords[1]) Do $msg3 = GUIGetMsg() $mpos = MouseGetPos() GUICtrlSetPos($hotspot_ctrl[$hotspot], $dim[1], $mpos[1], $dim[3], ($dim[2] + $dim[4]) - $mpos[1]) _MoveMovers($dim[1], $mpos[1], $dim[3], ($dim[2] + $dim[4]) - $mpos[1], $hotspot) $hotspot_loc[$hotspot] = $dim[1] & "," & $mpos[1] & "," & $dim[3] & "," & ($dim[2] + $dim[4]) - $mpos[1] Until $msg3 = $GUI_EVENT_PRIMARYUP EndIf If $_mover = 3 then _MouseTrap($win_coords[0] + $dim[1] + 5, $win_coords[1], $win_coords[2] + $win_coords[0], ($win_coords[1] + $dim[2] + $dim[4]) - 5) Do $msg3 = GUIGetMsg() $mpos = MouseGetPos() GUICtrlSetPos($hotspot_ctrl[$hotspot], $dim[1], $mpos[1], ($mpos[0] + $dim[3]) - ($dim[1] + $dim[3]), ($dim[2] + $dim[4]) - $mpos[1]) _MoveMovers($dim[1], $mpos[1], ($mpos[0] + $dim[3]) - ($dim[1] + $dim[3]), ($dim[2] + $dim[4]) - $mpos[1], $hotspot) $hotspot_loc[$hotspot] = $dim[1] & "," & $mpos[1] & "," & ($mpos[0] + $dim[3]) - ($dim[1] + $dim[3]) & "," & ($dim[2] + $dim[4]) - $mpos[1] Until $msg3 = $GUI_EVENT_PRIMARYUP EndIf If $_mover = 4 then _MouseTrap($win_coords[0], $win_coords[1] + $dim[2], (($dim[1] + $dim[3]) - 5) + $win_coords[0], $dim[2] + $dim[4] + $win_coords[1]) Do $msg3 = GUIGetMsg() $mpos = MouseGetPos() GUICtrlSetPos($hotspot_ctrl[$hotspot], $mpos[0], $dim[2], ($dim[1] + $dim[3]) - $mpos[0], $dim[4]) _MoveMovers($mpos[0], $dim[2], ($dim[1] + $dim[3]) - $mpos[0], $dim[4], $hotspot) $hotspot_loc[$hotspot] = $mpos[0] & "," & $dim[2] & "," & ($dim[1] + $dim[3]) - $mpos[0] & "," & $dim[4] Until $msg3 = $GUI_EVENT_PRIMARYUP EndIf If $_mover = 5 then _MouseTrap($win_coords[0] + $dim[1] + 5, $win_coords[1] + $dim[2], $win_coords[2] + $win_coords[0], $win_coords[1] + $dim[4] + $dim[2]) Do $msg3 = GUIGetMsg() $mpos = MouseGetPos() GUICtrlSetPos($hotspot_ctrl[$hotspot], $dim[1], $dim[2], $mpos[0] - $dim[1], $dim[4]) _MoveMovers($dim[1], $dim[2], $mpos[0] - $dim[1], $dim[4], $hotspot) $hotspot_loc[$hotspot] = $dim[1] & "," & $dim[2] & "," & $mpos[0] - $dim[1] & "," & $dim[4] Until $msg3 = $GUI_EVENT_PRIMARYUP EndIf If $_mover = 6 then _MouseTrap($win_coords[0], $win_coords[1] + $dim[2] + 5, ($win_coords[0] + $dim[1] + $dim[3]) - 5, $win_coords[1] + $win_coords[3]) Do $msg3 = GUIGetMsg() $mpos = MouseGetPos() GUICtrlSetPos($hotspot_ctrl[$hotspot], $mpos[0], $dim[2], $dim[3] + ($dim[1] - $mpos[0]), ($mpos[1] + $dim[4]) - ($dim[2] + $dim[4])) _MoveMovers($mpos[0], $dim[2], $dim[3] + ($dim[1] - $mpos[0]), ($mpos[1] + $dim[4]) - ($dim[2] + $dim[4]), $hotspot) $hotspot_loc[$hotspot] = $mpos[0] & "," & $dim[2] & "," & $dim[3] + ($dim[1] - $mpos[0]) & "," & ($mpos[1] + $dim[4]) - ($dim[2] + $dim[4]) Until $msg3 = $GUI_EVENT_PRIMARYUP EndIf If $_mover = 7 then _MouseTrap($win_coords[0] + $dim[1], $win_coords[1] + $dim[2] + 5, $dim[1] + $dim[3] + $win_coords[0], $win_coords[3] + $win_coords[1]) Do $msg3 = GUIGetMsg() $mpos = MouseGetPos() GUICtrlSetPos($hotspot_ctrl[$hotspot], $dim[1], $dim[2], $dim[3], ($mpos[1] + $dim[4]) - ($dim[2] + $dim[4])) _MoveMovers($dim[1], $dim[2], $dim[3], ($mpos[1] + $dim[4]) - ($dim[2] + $dim[4]), $hotspot) $hotspot_loc[$hotspot] = $dim[1] & "," & $dim[2] & "," & $dim[3] & "," & ($mpos[1] + $dim[4]) - ($dim[2] + $dim[4]) Until $msg3 = $GUI_EVENT_PRIMARYUP EndIf If $_mover = 8 then _MouseTrap($win_coords[0] + $dim[1] + 5, $win_coords[1] + $dim[2] + 5, $win_coords[0] + $win_coords[2], $win_coords[1] + $win_coords[3]) Do $msg3 = GUIGetMsg() $mpos = MouseGetPos() GUICtrlSetPos($hotspot_ctrl[$hotspot], $dim[1], $dim[2], $mpos[0] - $dim[1], $mpos[1] - $dim[2]) _MoveMovers($dim[1], $dim[2], $mpos[0] - $dim[1], $mpos[1] - $dim[2], $hotspot) $hotspot_loc[$hotspot] = $dim[1] & "," & $dim[2] & "," & $mpos[0] - $dim[1] & "," & $mpos[1] - $dim[2] Until $msg3 = $GUI_EVENT_PRIMARYUP EndIf _MouseTrap() ToolTip("") GUICtrlSetCursor($hotspot_ctrl[$hotspot], 9) EndFunc Func _CreateHotSpot($_x, $_y, $_curr_hs) Local $hotspot = $_curr_hs Local $startpoint_x = $_x Local $startpoint_y = $_y Local $endpoint_x = $startpoint_x + 5 Local $endpoint_y = $startpoint_y + 5 MouseMove($endpoint_x + 5, $endpoint_y + 5, 0) $hotspot_ctrl[$hotspot] = GUICtrlCreateLabel("", $startpoint_x, $startpoint_y, $endpoint_x, $endpoint_y, $SS_ETCHEDHORZ) $current_hotspot = $hotspot GUICtrlSetTip(-1, "hotspot #" & $hotspot) GUICtrlSetCursor (-1, 9) Do $msg2 = GUIGetMsg() $mpos = MouseGetPos() $ID = GUIGetCursorInfo() ;ToolTip($id[4]) If $startpoint_x < $mpos[0] Then $X = $startpoint_x $W = $mpos[0] - $startpoint_x Else $X = $mpos[0] $W = $startpoint_x - $mpos[0] EndIf If $startpoint_y < $mpos[1] Then $Y = $startpoint_y $H = $mpos[1] - $startpoint_y Else $Y = $mpos[1] $H = $startpoint_y - $mpos[1] EndIf GUICtrlSetPos($hotspot_ctrl[$hotspot], $x, $y, $w, $h) $hotspot_loc[$hotspot] = $x & "," & $y & "," & $w & "," & $h Until $msg2 = $GUI_EVENT_PRIMARYUP ;gore-lqvo $hotspot_movers[1] = GUICtrlCreateLabel("", $x - 4.5, $y - 4.5, 5, 5, $SS_WHITEFRAME) GUICtrlSetCursor (-1, 12) GUICtrlSetBkColor(-1, 0x000000) GUICtrlSetTip(-1, "NW (1)") ;gore_sreda $hotspot_movers[2] = GUICtrlCreateLabel("", ($x + ($w / 2)) - 4.5, $y - 4.5, 5, 5, $SS_WHITEFRAME) GUICtrlSetCursor (-1, 11) GUICtrlSetBkColor(-1, 0x000000) GUICtrlSetTip(-1, "N (2)") ;gore_dqsno $hotspot_movers[3] = GUICtrlCreateLabel("", $x + $w, $y - 4.5, 5, 5, $SS_WHITEFRAME) GUICtrlSetCursor (-1, 10) GUICtrlSetBkColor(-1, 0x000000) GUICtrlSetTip(-1, "NE (3)") ;sreda_lqvo $hotspot_movers[4] = GUICtrlCreateLabel("", $x - 4.5, $y + ($h / 2), 5, 5, $SS_WHITEFRAME) GUICtrlSetCursor (-1, 13) GUICtrlSetBkColor(-1, 0x000000) GUICtrlSetTip(-1, "w (4)") ;sreda_dqsno $hotspot_movers[5] = GUICtrlCreateLabel("", $x + $w, $y + ($h / 2), 5, 5, $SS_WHITEFRAME) GUICtrlSetCursor (-1, 13) GUICtrlSetBkColor(-1, 0x000000) GUICtrlSetTip(-1, "E (5)") ;dolu_lqvo $hotspot_movers[6] = GUICtrlCreateLabel("", $x - 4.5, $y + $h, 5, 5, $SS_WHITEFRAME) GUICtrlSetCursor (-1, 10) GUICtrlSetBkColor(-1, 0x000000) GUICtrlSetTip(-1, "SW (6)") ;dolu_sreda $hotspot_movers[7] = GUICtrlCreateLabel("", ($x + ($w / 2)) - 4.5, $y + $h, 5, 5, $SS_WHITEFRAME) GUICtrlSetCursor (-1, 11) GUICtrlSetBkColor(-1, 0x000000) GUICtrlSetTip(-1, "S (7)") ;dolu_dqsno $hotspot_movers[8] = GUICtrlCreateLabel("", $x + $w, $y + $h, 5, 5, $SS_WHITEFRAME) GUICtrlSetCursor (-1, 12) GUICtrlSetBkColor(-1, 0x000000) GUICtrlSetTip(-1, "SE (8)") EndFunc @KaFu: dude ... that is EXACLTY what i was looking for ty! didnt knew about this object but will use it ... can it make labels? like those i need? "transperent"? download this code and run it on your machine to see what i mean ...
  2. it creates hotspots on image, for lateer viewing/editing etc. so basicly darg to create hotspot. after that u can RESIZE it bot NOT move it (i didnt writed it for $current_hotspot). so: If $msg = $GUI_EVENT_PRIMARYDOWN And $mouse_cur = 2 then $hotspot_count += 1 ;MsgBox(0, "", $id[4]) _CreateHotSpot($mpos[0], $mpos[1], $hotspot_count) EndIf checks if mouse is clicked (and held) if yes => _CreateHotSpot with those args, $hotspot_counts ++ because to give the new created button a var which will handle him later. after _CreateHotSpot which is simply resizing of the control it idles, and w8s for new click, if u click on any of the "movers" (the little boxes in corners and centers) it will start to resize of in that direction. the problem is that i gieved "a constant" of $current_hotspot = 1 and u can only edit $hotspot_ctrl[1], and all the movers for $hotspot_ctrl[1]. i want to detect which is the clicked label so can pass the right argument to move him and etc., and move the "movers" bcoz they are with the same "constant" of 1. so i must get the "current clicked/hoovered" hotspot so to pass it to the funcs. more clear now? edit: x) dude i jsut realised that i may see if there is a creation at all in $hotspot_ctrl, like If $hotspot_ctrl[$i] <> "" .. and i just wanted to post the explaining so u to know what my script does any way ... and u just edited YOU post saying the same x) ok i got it ... this is it > will check if the If $hotspot_ctrl[$i] = "", and if it is - continue count, if not to pass the $i to the func ty if wernt you i wouldnt think of it and when i saw u suggestin the same i know that im in the right direction /closed
  3. x) steam powered x)))) ok its my bad that i dont post the exact script ... your answers are good but i didnt explained well whats exaclty hapening. well here it is: ;//includes #include <GUIConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Include <Misc.au3> ;#include <GUICtrlOnHover.au3> ;//options Opt("MouseCoordMode", 2) ;Opt("CaretCoordMode", 2) ;//vars Dim $hotspot_ctrl[99] Dim $hotspot_loc[99] Dim $hotspot_info[99][11] Dim $hotspot_movers[99][9] $hotspot_count = 0 ;//gui $frame_gui = GUICreate("Form1", 1025, 769, -1, -1, BitOR($WS_POPUP,$WS_GROUP)) $pic = GUICtrlCreatePic("pic.jpg", 0, 0, 1024, 768) GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlSetCursor (-1, 3) For $i = 1 to 8 $hotspot_movers[1][$i] = GUICtrlCreateLabel("", -11, -11, 1, 1, $SS_WHITEFRAME) Next GUISetState(@SW_SHOW) $current_hotspot = 1 ;//main loop Do $msg = GUIGetMsg() $ID = GUIGetCursorInfo($frame_gui) $mpos = MouseGetPos() $mouse_cur = MouseGetCursor() ToolTip($id[4] & @CRLF & $mouse_cur) For $I = 1 to 98 If $msg = $hotspot_ctrl[$i] then ;func for moving the hotspot itself with arg $i MsgBox(0, "", "") EndIf Next If $msg = $GUI_EVENT_PRIMARYDOWN And $mouse_cur = 2 then $hotspot_count += 1 ;MsgBox(0, "", $id[4]) _CreateHotSpot($mpos[0], $mpos[1], $hotspot_count) EndIf If $msg = $hotspot_movers[$current_hotspot][1] then ;gore vlqvo $current_hotspot = 1 _Resize($current_hotspot = 1, 1) EndIf If $msg = $hotspot_movers[$current_hotspot][2] then ;gore sreda $current_hotspot = 1 _Resize($current_hotspot = 1, 2) EndIf If $msg = $hotspot_movers[$current_hotspot][3] then ;gore dqsno $current_hotspot = 1 _Resize($current_hotspot = 1, 3) EndIf If $msg = $hotspot_movers[$current_hotspot][4] then ;sreda vlqvo $current_hotspot = 1 _Resize($current_hotspot = 1, 4) EndIf If $msg = $hotspot_movers[$current_hotspot][5] then ;sreda dqsno $current_hotspot = 1 _Resize($current_hotspot = 1, 5) EndIf If $msg = $hotspot_movers[$current_hotspot][6] then ;dolu vlqvo $current_hotspot = 1 _Resize($current_hotspot = 1, 6) EndIf If $msg = $hotspot_movers[$current_hotspot][7] then ;dolu sreda $current_hotspot = 1 _Resize($current_hotspot = 1, 7) EndIf If $msg = $hotspot_movers[$current_hotspot][8] then ;dolu dqsno $current_hotspot = 1 _Resize($current_hotspot = 1, 8) EndIf Until $msg = $GUI_EVENT_CLOSE ;//funcs Func _MoveMovers($x, $y, $w, $h, $hotspot) ;gore-lqvo GUICtrlSetPos($hotspot_movers[$hotspot][1], $x - 4.5, $y - 4.5, 5, 5) ;gore_sreda GUICtrlSetPos($hotspot_movers[$hotspot][2], ($x + ($w / 2)) - 2.5, $y - 4.5, 5, 5) ;gore_dqsno GUICtrlSetPos($hotspot_movers[$hotspot][3], $x + $w, $y - 4.5, 5, 5) ;sreda_lqvo GUICtrlSetPos($hotspot_movers[$hotspot][4], $x - 5, $y + ($h / 2) - 2.5, 5, 5) ;sreda_dqsno GUICtrlSetPos($hotspot_movers[$hotspot][5], $x + $w, $y + ($h / 2) - 3, 5, 5) ;dolu_lqvo GUICtrlSetPos($hotspot_movers[$hotspot][6], $x - 5, $y + $h, 5, 5) ;dolu_sreda GUICtrlSetPos($hotspot_movers[$hotspot][7], ($x + ($w / 2)) - 2.5, $y + $h, 5, 5) ;dolu_dqsno GUICtrlSetPos($hotspot_movers[$hotspot][8], $x + $w, $y + $h, 5, 5) EndFunc Func _Resize($_curr_hs, $_mover) ;$mover = clicked mover (1-8) Local $hotspot = $_curr_hs Local $dim = StringSplit($hotspot_loc[$hotspot], ",") Local $win_coords = WinGetPos($frame_gui) If $_mover = 1 then GUICtrlSetCursor($hotspot_ctrl[$hotspot], 12) EndIf If $_mover = 2 then GUICtrlSetCursor($hotspot_ctrl[$hotspot], 11) EndIf If $_mover = 3 then GUICtrlSetCursor($hotspot_ctrl[$hotspot], 10) EndIf If $_mover = 4 then GUICtrlSetCursor($hotspot_ctrl[$hotspot], 13) EndIf If $_mover = 5 then GUICtrlSetCursor($hotspot_ctrl[$hotspot], 13) EndIf If $_mover = 6 then GUICtrlSetCursor($hotspot_ctrl[$hotspot], 10) EndIf If $_mover = 7 then GUICtrlSetCursor($hotspot_ctrl[$hotspot], 11) EndIf If $_mover = 8 then GUICtrlSetCursor($hotspot_ctrl[$hotspot], 12) EndIf If $_mover = 1 then _MouseTrap($win_coords[0], $win_coords[1], (($dim[1] + $dim[3]) - 5) + $win_coords[0], (($dim[2] + $dim[4]) - 5) + $win_coords[1]) Do $msg3 = GUIGetMsg() $mpos = MouseGetPos() GUICtrlSetPos($hotspot_ctrl[$hotspot], $mpos[0], $mpos[1], ($dim[1] + $dim[3]) - $mpos[0], ($dim[2] + $dim[4]) - $mpos[1]) _MoveMovers($mpos[0], $mpos[1], ($dim[1] + $dim[3]) - $mpos[0], ($dim[2] + $dim[4]) - $mpos[1], $hotspot) $hotspot_loc[$hotspot] = $mpos[0] & "," & $mpos[1] & "," & ($dim[1] + $dim[3]) - $mpos[0] & "," & ($dim[2] + $dim[4]) - $mpos[1] ToolTip("X = " & $mpos[0] & @CRLF & "Y = " & $mpos[1] & @CRLF & "Width = " & ($dim[1] + $dim[3]) - $mpos[0] & @CRLF & "Height = " & ($dim[2] + $dim[4]) - $mpos[1]) Until $msg3 = $GUI_EVENT_PRIMARYUP EndIf If $_mover = 2 then _MouseTrap($win_coords[0] + $dim[1], $win_coords[1], (($dim[1] + $dim[3]) - 5) + $win_coords[0], (($dim[2] + $dim[4]) - 5) + $win_coords[1]) Do $msg3 = GUIGetMsg() $mpos = MouseGetPos() GUICtrlSetPos($hotspot_ctrl[$hotspot], $dim[1], $mpos[1], $dim[3], ($dim[2] + $dim[4]) - $mpos[1]) _MoveMovers($dim[1], $mpos[1], $dim[3], ($dim[2] + $dim[4]) - $mpos[1], $hotspot) $hotspot_loc[$hotspot] = $dim[1] & "," & $mpos[1] & "," & $dim[3] & "," & ($dim[2] + $dim[4]) - $mpos[1] Until $msg3 = $GUI_EVENT_PRIMARYUP EndIf If $_mover = 3 then _MouseTrap($win_coords[0] + $dim[1] + 5, $win_coords[1], $win_coords[2] + $win_coords[0], ($win_coords[1] + $dim[2] + $dim[4]) - 5) Do $msg3 = GUIGetMsg() $mpos = MouseGetPos() GUICtrlSetPos($hotspot_ctrl[$hotspot], $dim[1], $mpos[1], ($mpos[0] + $dim[3]) - ($dim[1] + $dim[3]), ($dim[2] + $dim[4]) - $mpos[1]) _MoveMovers($dim[1], $mpos[1], ($mpos[0] + $dim[3]) - ($dim[1] + $dim[3]), ($dim[2] + $dim[4]) - $mpos[1], $hotspot) $hotspot_loc[$hotspot] = $dim[1] & "," & $mpos[1] & "," & ($mpos[0] + $dim[3]) - ($dim[1] + $dim[3]) & "," & ($dim[2] + $dim[4]) - $mpos[1] Until $msg3 = $GUI_EVENT_PRIMARYUP EndIf If $_mover = 4 then _MouseTrap($win_coords[0], $win_coords[1] + $dim[2], (($dim[1] + $dim[3]) - 5) + $win_coords[0], $dim[2] + $dim[4] + $win_coords[1]) Do $msg3 = GUIGetMsg() $mpos = MouseGetPos() GUICtrlSetPos($hotspot_ctrl[$hotspot], $mpos[0], $dim[2], ($dim[1] + $dim[3]) - $mpos[0], $dim[4]) _MoveMovers($mpos[0], $dim[2], ($dim[1] + $dim[3]) - $mpos[0], $dim[4], $hotspot) $hotspot_loc[$hotspot] = $mpos[0] & "," & $dim[2] & "," & ($dim[1] + $dim[3]) - $mpos[0] & "," & $dim[4] Until $msg3 = $GUI_EVENT_PRIMARYUP EndIf If $_mover = 5 then _MouseTrap($win_coords[0] + $dim[1] + 5, $win_coords[1] + $dim[2], $win_coords[2] + $win_coords[0], $win_coords[1] + $dim[4] + $dim[2]) Do $msg3 = GUIGetMsg() $mpos = MouseGetPos() GUICtrlSetPos($hotspot_ctrl[$hotspot], $dim[1], $dim[2], $mpos[0] - $dim[1], $dim[4]) _MoveMovers($dim[1], $dim[2], $mpos[0] - $dim[1], $dim[4], $hotspot) $hotspot_loc[$hotspot] = $dim[1] & "," & $dim[2] & "," & $mpos[0] - $dim[1] & "," & $dim[4] Until $msg3 = $GUI_EVENT_PRIMARYUP EndIf If $_mover = 6 then _MouseTrap($win_coords[0], $win_coords[1] + $dim[2] + 5, ($win_coords[0] + $dim[1] + $dim[3]) - 5, $win_coords[1] + $win_coords[3]) Do $msg3 = GUIGetMsg() $mpos = MouseGetPos() GUICtrlSetPos($hotspot_ctrl[$hotspot], $mpos[0], $dim[2], $dim[3] + ($dim[1] - $mpos[0]), ($mpos[1] + $dim[4]) - ($dim[2] + $dim[4])) _MoveMovers($mpos[0], $dim[2], $dim[3] + ($dim[1] - $mpos[0]), ($mpos[1] + $dim[4]) - ($dim[2] + $dim[4]), $hotspot) $hotspot_loc[$hotspot] = $mpos[0] & "," & $dim[2] & "," & $dim[3] + ($dim[1] - $mpos[0]) & "," & ($mpos[1] + $dim[4]) - ($dim[2] + $dim[4]) Until $msg3 = $GUI_EVENT_PRIMARYUP EndIf If $_mover = 7 then _MouseTrap($win_coords[0] + $dim[1], $win_coords[1] + $dim[2] + 5, $dim[1] + $dim[3] + $win_coords[0], $win_coords[3] + $win_coords[1]) Do $msg3 = GUIGetMsg() $mpos = MouseGetPos() GUICtrlSetPos($hotspot_ctrl[$hotspot], $dim[1], $dim[2], $dim[3], ($mpos[1] + $dim[4]) - ($dim[2] + $dim[4])) _MoveMovers($dim[1], $dim[2], $dim[3], ($mpos[1] + $dim[4]) - ($dim[2] + $dim[4]), $hotspot) $hotspot_loc[$hotspot] = $dim[1] & "," & $dim[2] & "," & $dim[3] & "," & ($mpos[1] + $dim[4]) - ($dim[2] + $dim[4]) Until $msg3 = $GUI_EVENT_PRIMARYUP EndIf If $_mover = 8 then _MouseTrap($win_coords[0] + $dim[1] + 5, $win_coords[1] + $dim[2] + 5, $win_coords[0] + $win_coords[2], $win_coords[1] + $win_coords[3]) Do $msg3 = GUIGetMsg() $mpos = MouseGetPos() GUICtrlSetPos($hotspot_ctrl[$hotspot], $dim[1], $dim[2], $mpos[0] - $dim[1], $mpos[1] - $dim[2]) _MoveMovers($dim[1], $dim[2], $mpos[0] - $dim[1], $mpos[1] - $dim[2], $hotspot) $hotspot_loc[$hotspot] = $dim[1] & "," & $dim[2] & "," & $mpos[0] - $dim[1] & "," & $mpos[1] - $dim[2] Until $msg3 = $GUI_EVENT_PRIMARYUP EndIf _MouseTrap() ToolTip("") GUICtrlSetCursor($hotspot_ctrl[$hotspot], 9) EndFunc Func _CreateHotSpot($_x, $_y, $_curr_hs) Local $hotspot = $_curr_hs Local $startpoint_x = $_x Local $startpoint_y = $_y Local $endpoint_x = $startpoint_x + 5 Local $endpoint_y = $startpoint_y + 5 MouseMove($endpoint_x + 5, $endpoint_y + 5, 0) $hotspot_ctrl[$hotspot] = GUICtrlCreateLabel("", $startpoint_x, $startpoint_y, $endpoint_x, $endpoint_y, $SS_ETCHEDHORZ) ;_GUICtrl_OnHoverRegister($hotspot_ctrl[$hotspot], "_Hover_Func") GUICtrlSetTip(-1, "hotspot #" & $hotspot) GUICtrlSetCursor (-1, 9) Do $msg2 = GUIGetMsg() $mpos = MouseGetPos() $ID = GUIGetCursorInfo() ;ToolTip($id[4]) If $startpoint_x < $mpos[0] Then $X = $startpoint_x $W = $mpos[0] - $startpoint_x Else $X = $mpos[0] $W = $startpoint_x - $mpos[0] EndIf If $startpoint_y < $mpos[1] Then $Y = $startpoint_y $H = $mpos[1] - $startpoint_y Else $Y = $mpos[1] $H = $startpoint_y - $mpos[1] EndIf GUICtrlSetPos($hotspot_ctrl[$hotspot], $x, $y, $w, $h) $hotspot_loc[$hotspot] = $x & "," & $y & "," & $w & "," & $h Until $msg2 = $GUI_EVENT_PRIMARYUP ;gore-lqvo $hotspot_movers[$hotspot][1] = GUICtrlCreateLabel("", $x - 4.5, $y - 4.5, 5, 5, $SS_WHITEFRAME) GUICtrlSetCursor (-1, 12) GUICtrlSetBkColor(-1, 0x000000) GUICtrlSetTip(-1, "NW (1)") ;gore_sreda $hotspot_movers[$hotspot][2] = GUICtrlCreateLabel("", ($x + ($w / 2)) - 4.5, $y - 4.5, 5, 5, $SS_WHITEFRAME) GUICtrlSetCursor (-1, 11) GUICtrlSetBkColor(-1, 0x000000) GUICtrlSetTip(-1, "N (2)") ;gore_dqsno $hotspot_movers[$hotspot][3] = GUICtrlCreateLabel("", $x + $w, $y - 4.5, 5, 5, $SS_WHITEFRAME) GUICtrlSetCursor (-1, 10) GUICtrlSetBkColor(-1, 0x000000) GUICtrlSetTip(-1, "NE (3)") ;sreda_lqvo $hotspot_movers[$hotspot][4] = GUICtrlCreateLabel("", $x - 4.5, $y + ($h / 2), 5, 5, $SS_WHITEFRAME) GUICtrlSetCursor (-1, 13) GUICtrlSetBkColor(-1, 0x000000) GUICtrlSetTip(-1, "w (4)") ;sreda_dqsno $hotspot_movers[$hotspot][5] = GUICtrlCreateLabel("", $x + $w, $y + ($h / 2), 5, 5, $SS_WHITEFRAME) GUICtrlSetCursor (-1, 13) GUICtrlSetBkColor(-1, 0x000000) GUICtrlSetTip(-1, "E (5)") ;dolu_lqvo $hotspot_movers[$hotspot][6] = GUICtrlCreateLabel("", $x - 4.5, $y + $h, 5, 5, $SS_WHITEFRAME) GUICtrlSetCursor (-1, 10) GUICtrlSetBkColor(-1, 0x000000) GUICtrlSetTip(-1, "SW (6)") ;dolu_sreda $hotspot_movers[$hotspot][7] = GUICtrlCreateLabel("", ($x + ($w / 2)) - 4.5, $y + $h, 5, 5, $SS_WHITEFRAME) GUICtrlSetCursor (-1, 11) GUICtrlSetBkColor(-1, 0x000000) GUICtrlSetTip(-1, "S (7)") ;dolu_dqsno $hotspot_movers[$hotspot][8] = GUICtrlCreateLabel("", $x + $w, $y + $h, 5, 5, $SS_WHITEFRAME) GUICtrlSetCursor (-1, 12) GUICtrlSetBkColor(-1, 0x000000) GUICtrlSetTip(-1, "SE (8)") EndFunc copy/paste, download pic.jpg put in same dir and watch poping msgboxes ... thats because the ctrl itself isnt created yet. do you understand me more better now? delete the For $I = 1 to 98 If $msg = $hotspot_ctrl[$i] then ;func for moving the hotspot itself with arg $i MsgBox(0, "", "") EndIf Next to see what my script actualy does.
  4. yep thats it - it IS a long func, but still your reply with interrupting funcs gives me halve the answer ... i was thinking more like using some kind of registering the control on its creation, like _GUICtrl_OnHoverRegister($button[$i], "_Hover_Func") and get the hoover id, but still, when u create more controls BEFORE button creation there will be a difference. like ID=1 would be gui itself or the label u created BEFORE button creation, so if u hover over $button[1], the id would be 5-6 or depends on how many controls you created BEFORE buttons creation. isnt there any way to register the function to the button upon its creation? like ... For $i = 1 to 10 $button[$i] = GUICtrlCreateButton(...) _register_on_click_func($i) Next ... Func _reguister_on_click_func($_ctrl_id) ;do that'n'that EndFunc and when $button[n] is clicked it goes to that func with args "n"? strangely i ran the code (i just writed it on the forum without runing it) and i was amazed when it ran smoothly ... but thats plain script, and controls are only 10. if there are 200-300 there will be alot of delay in counting. depends on the CPU too but there must NOT be any kind of operatin which depends on the speed of the PC in this situation.. like clicking on button214 and wait till it counts them all (on my pc like 1sec to count them) and then do the func. maybe in your scripts you used too few controls? idk, but there is delay for sure. and what about if the control ISNT still created? but u dommed some kind of max controls that may be created like Dim $button[99] and created only 2 of them, till it loops from 2 to 98, the $button[98] is 0 and msg is 0 on idle so it will ran the func for all other buttons with 0 args. any other suggestions for the "self register thing upon creation" of the control?
  5. heya i've been looking for asnwer on this question for about 8-9 months and ... STILL nothing for now ... searched forum and i decided to start the topic. so whats it all about? look: ;//includes #include <GUIConstants.au3> #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> ;//options ;//vars Dim $button_ctrl[11] ;//gui #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 168, 449, 432, 195) For $i = 1 to 10 $button_ctrl[$i] = GUICtrlCreateButton("Button" & $i, 40, $i*35, 75, 25) Next GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### ;//main loop Do $msg = GUIGetMsg() Until $msg = $GUI_EVENT_CLOSE what is on my mind is: how to get that the msg is from button X? ;//includes #include <GUIConstants.au3> #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> ;//options ;//vars Dim $button_ctrl[11] ;//gui #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 168, 449, 432, 195) For $i = 1 to 10 $button_ctrl[$i] = GUICtrlCreateButton("Button" & $i, 40, $i*35, 75, 25) Next GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### ;//main loop Do $msg = GUIGetMsg() For $i = 1 to 10 If $msg = $button_ctrl[$i] then MsgBox(0, "", "u clicked on button #" & $i) EndIF Next Until $msg = $GUI_EVENT_CLOSE this DOESNT wotks well ... i mean sometimes it gets the msg sometimes not. there is delay from when it counts to when it gets the new msg recieved so sometimes i click when it still counts and the new msg isnt recived by guigetmsg ... i like to use Do-Untill styles, but did it in select-case = still the same ... and there is no way to do it like that: ;//includes #include <GUIConstants.au3> #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> ;//options ;//vars Dim $button_ctrl[11] ;//gui #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 168, 449, 432, 195) For $i = 1 to 10 $button_ctrl[$i] = GUICtrlCreateButton("Button" & $i, 40, $i*35, 75, 25) Next GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### ;//main loop Do $msg = GUIGetMsg() If $msg = $button_ctrl[1] then _func_for_button(1) If $msg = $button_ctrl[2] then _func_for_button(2) If $msg = $button_ctrl[3] then _func_for_button(3) ... Until $msg = $GUI_EVENT_CLOSE because its 10 controls now, what about 912? there must be a way to get what i'm clicking the "easy" way thank you in advance
  6. RLY nicely done dude! /salute@you...
  7. @all: ok folx, i maybe rushed things a little. promissing to explain all tomorrow better (too tired atm). @urie: ok will explain better, actually its pretty easy using. @storme: 1. ok. will add checkbox for already running application, so to dont asks for prog path. the reason i did this is (as i said above) it only SMALL part of a bigger project (which isnt finished afterall) and the path to exe must be inputed. 2. will do. tomorrow 3. will cut the unneeded. basicly all this does its to generate au3 scripts. optimised it for prog installations for my project, but after i shoved the source of this part will fix it much better - just wanted to show and see if there is any good opinions. so will optimise it more and name it otherway - again tomorrow. @storme again: if its not highlighted as control it may be pic. sum programs are with pics instead of controls and its detects clicked pic (not much) and mouse coords (mostly used). if u typed exactly ({alt}g) it wont happen - needs to be ("{alt}g") - like using it in autoit - same syntax. im happy that my sscript made yout things easier actually it can automate EVERYTHING u can do with KB/MOUSE (and sum more). it may not work perfect - but will fix it. ok thats all from me for now. new version (fixed) is coming soon. s0z f0r m3 b4d 3ngl|sh!
  8. guys, its kinda lame to "self-answer" my posts. PLEASE add some comment ... or suggestion ... or critic ... or whatever! 123 downloads! i want to know it is useful to you or not ...
  9. as i said, the source here is only for showing it, i dont know why it has those mistakes (<p></p> and etc) i dont know very well html, but i think thos etags are there bcoz of the "codebox" and etc ... i only type "codebox copy-pasted the source codebox" ... the source isnt broken it doesnt needs a fix i said download the rar file bcoz it needs the resources from there too so download it and u'll see working source. let me try another codebox/autoit ;// includes #include <Misc.au3> #Include <GuiIPAddress.au3> #Include <GuiStatusBar.au3> #include <ButtonConstants.au3> #include <ComboConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <ProgressConstants.au3> #include <TabConstants.au3> #include <WindowsConstants.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> #include <ListBoxConstants.au3> #include <winApi.au3> #include <GUIEdit.au3> ;// options Opt("MouseCoordMode", "0") $newprog_gui = GUICreate("new program configure", 427, 305) $np_tab_name_combo = GUICtrlCreateCombo("", 88, 8, 145, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL)) GUICtrlSetData(-1, "tab1|tab2") $np_program_name_input = GUICtrlCreateInput("", 88, 40, 145, 21) $np_prog_path_input = GUICtrlCreateInput("", 8, 88, 377, 21, BitOR($ES_AUTOHSCROLL,$ES_READONLY)) $np_browse_path_input = GUICtrlCreateButton("...", 384, 88, 27, 21, 0) $np_Group1 = GUICtrlCreateGroup("aditional options", 8, 112, 409, 153) $np_Radio1 = GUICtrlCreateRadio("start BEFORE instalation", 16, 128, 145, 17) $np_Radio2 = GUICtrlCreateRadio("start AFTER installation", 16, 144, 145, 17) GUICtrlSetState(-1, $GUI_CHECKED) $np_Label3 = GUICtrlCreateLabel("path to additional exe:", 16, 160, 108, 17) $np_aprog1_path_input = GUICtrlCreateInput("", 16, 184, 369, 21, BitOR($ES_AUTOHSCROLL,$ES_READONLY)) $np_abrowse1_path_button = GUICtrlCreateButton("...", 384, 184, 27, 21, 0) $np_onemore_checkbox = GUICtrlCreateCheckbox("one more plz", 16, 208, 97, 17) $np_aprog2_path_input = GUICtrlCreateInput("", 16, 232, 369, 21, BitOR($ES_AUTOHSCROLL,$ES_READONLY)) $np_abrowse2_path_button = GUICtrlCreateButton("...", 384, 232, 27, 21, 0) GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlCreateGroup("", -99, -99, 1, 1) $np_run_button = GUICtrlCreateButton("install", 8, 272, 83, 25, 0) $np_Label1 = GUICtrlCreateLabel("store in this tab:", 8, 8, 78, 17) $np_label2222 = GUICtrlCreateLabel("program name:", 8, 40, 74, 17) $np_Label2 = GUICtrlCreateLabel("path to exe:", 8, 64, 60, 17) $np_cancel_button = GUICtrlCreateButton("cancel", 344, 272, 75, 25, 0) $np_newtab_button = GUICtrlCreateButton("new tab ...", 240, 8, 75, 21, 0) $np_Label4 = GUICtrlCreateLabel("priority", 240, 40, 34, 17) $np_priority_input = GUICtrlCreateInput("0", 280, 40, 48, 21, BitOR($ES_AUTOHSCROLL,$ES_NUMBER)) $np_Updown1 = GUICtrlCreateUpdown($np_priority_input) GUISetState(@SW_SHOW, $newprog_gui) $exit = 0 Do $msg2 = GUIGetMsg() If $msg2 = $np_onemore_checkbox then If GUICtrlRead($np_onemore_checkbox) = $GUI_CHECKED then GUICtrlSetState($np_abrowse2_path_button, $GUI_ENABLE) GUICtrlSetState($np_aprog2_path_input, $GUI_ENABLE) Else GUICtrlSetState($np_abrowse2_path_button, $GUI_DISABLE) GUICtrlSetState($np_aprog2_path_input, $GUI_DISABLE) EndIf EndIf If $msg2 = $np_browse_path_input then $file = FileOpenDialog("Browse for executable:", @ScriptDir & "\", "EXEcutables (*.exe;*.msi)", 1 + 2) GUICtrlSetData($np_prog_path_input, $file) EndIf If $msg2 = $np_abrowse1_path_button then $file = FileOpenDialog("Browse for executable:", @ScriptDir & "\", "EXEcutables (*.exe;*.msi)", 1 + 2) GUICtrlSetData($np_aprog1_path_input, $file) EndIf If $msg2 = $np_abrowse2_path_button then $file = FileOpenDialog("Browse for executable:", @ScriptDir & "\", "EXEcutables (*.exe;*.msi)", 1 + 2) GUICtrlSetData($np_aprog2_path_input, $file) EndIf If $msg2 = $np_cancel_button then $answer = MsgBox(4, "new program configure", "are you sure u want to exit? u will be prompted to install" & @CRLF & "this program next time u start csz - installator.") If $answer = 6 then $exit = 1 EndIf EndIf If $msg2 = $np_run_button then If GUICtrlRead($np_tab_name_combo) = "" then MsgBox(0, "new program configure", "please choose in what tab to put the program.") Else If GUICtrlRead($np_program_name_input) = "" then MsgBox(0, "new program configure", "please input name for program.") ELse If GUICtrlRead($np_onemore_checkbox) = $GUI_CHECKED And GUICtrlRead($np_aprog2_path_input) = "" then MsgBox(0, "new program configure", "please input path for additional program.") Else If GUICtrlRead($np_prog_path_input) = "" then MsgBox(0, "new program configure", "please input path for main program.") Else If GUICtrlRead($np_Radio1) = $GUI_CHECKED then $np_time = "BEFORE" else $np_time = "AFTER" EndIf If GUICtrlRead($np_aprog1_path_input) = "" then $np_prog1 = "none" else $np_prog1 = GUICtrlRead($np_aprog1_path_input) EndIf If GUICtrlRead($np_onemore_checkbox) = $GUI_CHECKED then $np_prog2 = GUICtrlRead($np_aprog2_path_input) Else $np_prog2 = "none" EndIf $answer = MsgBox(4, "new program configure", "plaese confirm the following settings:" & @CRLF & "main program path: " & GUICtrlRead($np_prog_path_input) & @CRLF & "store program in tab: " & GUICtrlRead($np_tab_name_combo) & @CRLF & "program name: " & GUICtrlRead($np_program_name_input) & @CRLF & "run " & $np_time & " main program:" & @CRLF & "additional program1: " & $np_prog1 & @CRLF & "additional program2: " & $np_prog2) $main_prog_path = GUICtrlRead($np_prog_path_input) $main_prog_name = GUICtrlRead($np_program_name_input) $aditional_program1_path = GUICtrlRead($np_aprog1_path_input) $aditional_program2_path = GUICtrlRead($np_aprog2_path_input) If $answer = 6 then Global $hSquare_GUI = -1 Global $hCtrl = -1 Global $Last_hControl = -1 Global $Frame_Color = 0xFF0000 Global $Frame_Width = 3 GUIRegisterMsg($WM_WINDOWPOSCHANGED, "WM_WINDOWPOSCHANGED") $learning_gui = GUICreate("learning mode", 372, 252, 1, 1, -1, BitOR($WS_EX_TOOLWINDOW,$WS_EX_TOPMOST,$WS_EX_WINDOWEDGE)) $lm_Group1 = GUICtrlCreateGroup("tracking", 0, 0, 329, 41) $lm_cc_button = GUICtrlCreateButton("control click", 88, 16, 75, 17, 0) $lm_ww_button = GUICtrlCreateButton("wait window", 8, 16, 75, 17, 0) $lm_wl_button = GUICtrlCreateButton("wait label", 168, 16, 75, 17, 0) $lm_wc_button = GUICtrlCreateButton("wait color", 248, 16, 75, 17, 0) GUICtrlCreateGroup("", -99, -99, 1, 1) $lm_Group2 = GUICtrlCreateGroup("info", 0, 80, 369, 97) $lm_label = GUICtrlCreateEdit("idle...", 8, 96, 349, 73) GUICtrlCreateGroup("", -99, -99, 1, 1) $lm_run_button = GUICtrlCreateButton("run", 336, 56, 27, 17, 0) $lm_list = GUICtrlCreateEdit("", 0, 184, 369, 45, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_READONLY,$WS_VSCROLL)) $lm_finish_button = GUICtrlCreateButton("finish", 318, 232, 51, 17, 0) $lm_Group3 = GUICtrlCreateGroup("run external program", 0, 40, 369, 41) $lm_external_input = GUICtrlCreateInput("", 8, 56, 289, 17, BitOR($ES_AUTOHSCROLL,$ES_READONLY)) $lm_external_button = GUICtrlCreateButton("...", 296, 56, 27, 17, 0) GUICtrlCreateGroup("", -99, -99, 1, 1) $lm_icon = GUICtrlCreateIcon(@ScriptDir & "\data\curr.ico", 0, 336, 8, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP)) $lm_special_combo = GUICtrlCreateCombo("", 168, 232, 145, 17, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL)) GUICtrlSetData(-1, "close win|input sleep|send keys|kill process|wait process|mouse move") $lm_execute_button = GUICtrlCreateButton("execute >", 104, 232, 59, 17, 0) $lm_cancel_button = GUICtrlCreateButton("cancel", 0, 232, 51, 17, 0) GUISetState(@SW_SHOW, $learning_gui) GUIDelete($newprog_gui) GUIswitch($learning_gui) GUICtrlSetData($lm_list, "Run('" & $main_prog_path & "')") ;$list_items = GUICtrlRead($list) Run($main_prog_path) $win_arc = "" $in_exit = 0 Do $msg3 = GUIGetMsg() If $msg3 = $lm_icon then _SetCursor(@ScriptDir & "\data\curr.cur", 32512) GUICtrlSetImage($lm_icon, @ScriptDir & "\data\nocurr.ico") While _IsPressed("01") Check_Highlight_Controls_Proc() WEnd $Last_hControl = -1 _SetCursor(@ScriptDir & "\data\default.cur", 32512) GUICtrlSetImage($lm_icon, @ScriptDir & "\data\curr.ico") EndIf If $msg3 = $lm_ww_button then GUICtrlSetData($lm_list, GUICtrlRead($lm_list) & @CRLF & "WinWaitActive('" & $win_tittle & "')") $win_arc = $win_tittle _GUICtrlEdit_LineScroll($lm_list, 0, _GUICtrlEdit_GetLineCount($lm_list)) EndIf If $msg3 = $lm_cc_button then GUICtrlSetData($lm_list, GUICtrlRead($lm_list) & @CRLF & "ControlClick('" & $win_arc & "', '', " & $control_id & ")") _GUICtrlEdit_LineScroll($lm_list, 0, _GUICtrlEdit_GetLineCount($lm_list)) WinActivate($win_arc) WinWaitActive($win_arc) ControlClick($win_arc, "", $control_id) EndIf if $msg3 = $lm_execute_button then if GUICtrlRead($lm_special_combo) = "" then ;Or GUICtrlRead($special_combo) <> "close win" Or GUICtrlRead($special_combo) <> "input sleep" Or GUICtrlRead($special_combo) <> "send keys" Or GUICtrlRead($special_combo) <> "wait process" Or GUICtrlRead($special_combo) <> "kill process" Or GUICtrlRead($special_combo) <> "" Or GUICtrlRead($special_combo) <> "mouse move" then MsgBox(0, "learning mode", "command NOT found ...") Else If GUICtrlRead($lm_special_combo) = "close win" then GUICtrlSetData($lm_list, GUICtrlRead($lm_list) & @CRLF & "WinWaitActive('" & $win_arc & "')") GUICtrlSetData($lm_list, GUICtrlRead($lm_list) & @CRLF & "WinClose('" & $win_arc & "')") _GUICtrlEdit_LineScroll($lm_list, 0, _GUICtrlEdit_GetLineCount($lm_list)) WinActivate($win_arc) WinWaitActive($win_arc) WinClose($win_arc) EndIf If GUICtrlRead($lm_special_combo) = "input sleep" then $input = InputBox("learning mode - input sleep", "input sleep time in sec") If $input <> "" then GUICtrlSetData($lm_list, GUICtrlRead($lm_list) & @CRLF & "Sleep('" & $input * 1000 & "')") _GUICtrlEdit_LineScroll($lm_list, 0, _GUICtrlEdit_GetLineCount($lm_list)) EndIf EndIf If GUICtrlRead($lm_special_combo) = "send keys" then $input = InputBox("learning mode - send keys", "choose wich keys to send (READ manual!)") If $input <> "" then GUICtrlSetData($lm_list, GUICtrlRead($lm_list) & @CRLF & "Send('" & $input & "')") _GUICtrlEdit_LineScroll($lm_list, 0, _GUICtrlEdit_GetLineCount($lm_list)) WinActivate($win_arc) WinWaitActive($win_arc) Send($input) EndIf EndIf If GUICtrlRead($lm_special_combo) = "kill process" then $proc_list = ProcessList() $process_list = "" for $i = 1 to $proc_list[0][0] $process_list = $process_list & @CRLF & $proc_list[$i][0] & ", PID = " & $proc_list[$i][1] next MsgBox(0, "learning mode - kill process", "choose wich process to kill AND remmeber its EXACT NAME (notepad.exe, setup.exe): " & @CRLF & $process_list) $input = InputBox("learning mode - kill process", "NAME of process to kill:") If $input <> "" then GUICtrlSetData($lm_list, GUICtrlRead($lm_list) & @CRLF & "ProcessClose('" & $input & "')") ProcessClose($input) EndIf EndIf If GUICtrlRead($lm_special_combo) = "wait process" then $input = InputBox("learning mode - wait process", "input a name of process. this will pause execution untill process is found.") If $input <> "" then GUICtrlSetData($lm_list, GUICtrlRead($lm_list) & @CRLF & "ProcessWait('" & $input & "')") EndIf EndIf If GUICtrlRead($lm_special_combo) = "mouse move" then MsgBox(0, "learning mode", "in next versions ...") EndIf EndIf EndIf If $msg3 = $lm_external_button then $path = FileOpenDialog("Browse for executable:", @ScriptDir & "\", "EXEcutables (*.exe;*.msi)", 1 + 2) GUICtrlSetData($lm_external_input, $path) EndIf If $msg3 = $lm_run_button then If GUICtrlRead($lm_external_input) = "" then MsgBox(0, "learning mode", "no program chosen ...") Else GUICtrlSetData($lm_list, GUICtrlRead($lm_list) & @CRLF & "Run('" & $path & "')") Run($path) EndIf EndIf If $msg3 = $lm_cancel_button then $answer = MsgBox(4, "learning mode", "are you sure u want to exit WITHOUT saving changes?") If $answer = 6 then $in_exit = 1 EndIf EndIf If $msg3 = $lm_finish_button then FileWriteLine(@ScriptDir & "\data\" & $main_prog_name & ".au3", GUICtrlRead($lm_list)) ;// ini $in_exit = 1 EndIf Until $in_exit = 1 GUIDelete($learning_gui) $exit = 1 EndIf EndIF EndIF EndIF EndIf EndIf Until $exit = 1 Func Check_Highlight_Controls_Proc() Local $hCtrl = _ControlGetHovered() Global $control_id Global $control_text Global $win_tittle If $hCtrl <> 0 And $Last_hControl <> $hCtrl And $hSquare_GUI <> $hCtrl Then $Last_hControl = $hCtrl Local $aCtrlPos = WinGetPos($hCtrl) ;GUICtrlSetData($Info_Edit, _ ; "X = " & $aCtrlPos[0] & @CRLF & _ ; "Y = " & $aCtrlPos[1] & @CRLF & _ ; "W = " & $aCtrlPos[2] & @CRLF & _ ; "H = " & $aCtrlPos[3] & @CRLF & @CRLF & _ ; "Control/Win Class Name: " & _WinGetClassName($hCtrl) & @CRLF & _ ; "Control/Win Handle: " & $hCtrl & @CRLF & _ ; "Control ID: " & _HwndToID($hCtrl) & @CRLF & @CRLF & _ ; "Control Data:" & @CRLF & ControlGetText($hCtrl, "", "")) GUICtrlSetData($lm_label, "wint tittle: " & WinGetTitle("[CLASS:" & _WinGetClassName($hCtrl) & "]", "") & " win class: " & _WinGetClassName($hCtrl) & @CRLF & "highligted control: " & _HwndToID($hCtrl) & " text: " & ControlGetText($hCtrl, "", "")) $win_tittle = WinGetTitle("[CLASS:" & _WinGetClassName($hCtrl) & "]", "") $control_id = _HwndToID($hCtrl) $control_text = ControlGetText($hCtrl, "", "") GUIDeleteSquare($hSquare_GUI) $hSquare_GUI = GUICreateSquare($aCtrlPos[0], $aCtrlPos[1], $aCtrlPos[2], $aCtrlPos[3]) EndIf EndFunc Func GUICreateSquare($i_X=-1, $i_Y=-1, $i_W=-1, $i_H=-1) Local $hSquare_GUI = GUICreate("", $i_W, $i_H, $i_X, $i_Y, $WS_POPUP, $WS_EX_TOOLWINDOW+$WS_EX_TOPMOST) GUISetBkColor($Frame_Color) _GUISetHole($hSquare_GUI, $Frame_Width, $Frame_Width, $i_W - ($Frame_Width * 2), $i_H - ($Frame_Width * 2)) GUISetState(@SW_SHOWNOACTIVATE, $hSquare_GUI) Return $hSquare_GUI EndFunc Func GUIDeleteSquare($hSquare_GUI) If IsHWnd($hSquare_GUI) And $hSquare_GUI <> $learning_GUI Then GUIDelete($hSquare_GUI) EndFunc Func _ControlGetHovered() Local $aRet = DllCall("user32.dll", "int", "WindowFromPoint", "long", MouseGetPos(0), "long", MouseGetPos(1)) If Not IsArray($aRet) Then Return SetError(1, 0, 0) Return HWnd($aRet[0]) EndFunc Func _HwndToID($hWnd) If Not IsHWnd($hWnd) Then Return SetError(1, 0, "") Local $aRet = DllCall("user32.dll", "int", "GetDlgCtrlID", "hwnd", $hWnd) If Not IsArray($aRet) Then Return SetError(2, 0, "") Return $aRet[0] EndFunc Func _WinGetClassName($hWnd) $aClassName = DLLCall("user32.dll", "int", "GetClassName", "hWnd", $hWnd, "str", "", "int", 64) If Not @error And $aClassName[0] <> 0 Then Return $aClassName[2] Return "" EndFunc Func _GUISetHole($hWin, $i_X, $i_Y, $i_SizeW, $i_SizeH) Local $aWinPos, $Outer_Rgn, $Inner_Rgn, $Wh, $Combined_Rgn Local Const $RGN_DIFF = 4 $aWinPos = WinGetPos($hWin) $Outer_Rgn = DllCall("gdi32.dll", "long", "CreateRectRgn", "long", 0, "long", 0, "long", $aWinPos[2], "long", $aWinPos[3]) $Inner_Rgn = DllCall("gdi32.dll", "long", "CreateRectRgn", "long", $i_Y, "long", $i_Y, "long", $i_Y + $i_SizeW, _ "long", $i_Y + $i_SizeH) $Combined_Rgn = DllCall("gdi32.dll", "long", "CreateRectRgn", "long", 0, "long", 0, "long", 0, "long", 0) DllCall("gdi32.dll", "long", "CombineRgn", "long", $Combined_Rgn[0], "long", $Outer_Rgn[0], "long", $Inner_Rgn[0], _ "int", $RGN_DIFF) DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $hWin, "long", $Combined_Rgn[0], "int", 1) EndFunc Func _IdleWait($IdleSec=0) Local $iSave, $stLastInput = DllStructCreate("uint;dword") DllStructSetData($stLastInput, 1, DllStructGetSize($stLastInput)) DllCall("user32.dll", "int", "GetLastInputInfo", "ptr", DllStructGetPtr($stLastInput)) Do $iSave = DllStructGetData($stLastInput, 2) Sleep(20) DllCall("user32.dll", "int", "GetLastInputInfo", "ptr", DllStructGetPtr($stLastInput)) Until (DllStructGetData($stLastInput, 2) - $iSave) > $IdleSec Return DllStructGetData($stLastInput, 2) - $iSave EndFunc Func WM_WINDOWPOSCHANGED($hWndGUI, $MsgID, $WParam, $LParam) If $hWndGUI <> $learning_GUI Then Return $GUI_RUNDEFMSG GUIDeleteSquare($hSquare_GUI) Check_Highlight_Controls_Proc() $Last_hControl = -1 EndFunc Func _SetCursor($s_file, $i_cursor) Local $newhcurs, $lResult $newhcurs = DllCall("user32.dll", "int", "LoadCursorFromFile", "str", $s_file) If Not @error Then $lResult = DllCall("user32.dll", "int", "SetSystemCursor", "int", $newhcurs[0], "int", $i_cursor) If Not @error Then $lResult = DllCall("user32.dll", "int", "DestroyCursor", "int", $newhcurs[0]) Else MsgBox(0, "Error", "Failed SetSystemCursor") EndIf Else MsgBox(0, "Error", "Failed LoadCursorFromFile") EndIf EndFunc ;==>_SetCursor edit: well, its showing good now /edit ps: s0z f0r m3 b4d 3ngl|sh
  10. 90 views, 10 downloadz, and 0 comments... looks like bad guyz are preventing...
×
×
  • Create New...