Jump to content

Bone1970

Members
  • Posts

    5
  • Joined

  • Last visited

Community Answers

  1. Bone1970's post in RunAU3 error: missing Endif & error: missing until <expr>. was marked as the answer   
    #include <GUIConstants.au3> AutoItSetOption("GUIResizeMode", 802) Global $oldwidth = 114, $oldheight = 100, $ontop = 1, $time = @hour & ":" & @MIN ; create window (gui), all buttons and boxes. $main = GUICreate("Bone-menu", 114, 100, 450, 10, $WS_POPUP + $WS_SIZEBOX); create the window GUICtrlCreateLabel("move", 2, 2, 28, 20, $SS_CENTER, $GUI_WS_EX_PARENTDRAG) ; create the move box text "move" GUICtrlSetTip(-1, "move window's position") ; create the move box tooltip GUICtrlCreateLabel("", 0, 0, 32, 20, $SS_BLACKFRAME); create the box around move $trans = GUICtrlCreateSlider(40, 12, 73, 18, $TBS_NOTICKS) ; GUICtrlSetTip(-1, "set transparency") GUICtrlSetLimit(-1, 255, 80) GUICtrlSetData(-1, 220) ; 220 is the transparency when program starts GUICtrlCreateLabel("transparency:", 40, 0, 100, 12) GUICtrlSetFont(-1, 7) $top = GUICtrlCreateCheckbox('"Always top"', 1, 25) GUICtrlSetState(-1, 1) GUICtrlSetTip(-1, "Always on top on/off") $quit = GUICtrlCreateLabel("quit", 2, 48, 28, 20, $SS_CENTER) GUICtrlSetTip(-1, "exit") GUICtrlCreateLabel("", 0, 46, 32, 20, $SS_BLACKFRAME) $time1 = GUICtrlCreateLabel($time, 36, 48, 33, 20, $SS_CENTER) GUICtrlSetTip(-1, "click to start Bone-stopwatch.au3") GUICtrlCreateLabel("", 35, 46, 35, 20, $SS_BLACKFRAME) $note1 = GUICtrlCreateLabel("note's", 73, 48, 30, 20, $SS_CENTER) GUICtrlSetTip(-1, "click to start Bone-note.au3") GUICtrlCreateLabel("", 72, 46, 32, 20, $SS_BLACKFRAME) $info = GUICtrlCreateCheckbox('"Info"', 1, 67, -1, -1, $SS_NOTIFY) GUICtrlSetState(-1, 0) GUICtrlSetTip(-1, "get color and mouse position") ; end of create window (gui), all buttons and boxes. GUISetState() WinSetTrans("Bone-menu", "", 220) ; set window transparency to 220 WinSetOnTop("Bone-menu", "", 1) ; set to alwways on top (1) do local $time2 = @hour & ":" & @MIN if $time <> $time2 then ; compare old time with new time local $time = $time2 ; old time <> new time GUICtrlCreateLabel($time, 36, 48, 33, 20, $SS_CENTER); write new time GUICtrlCreateLabel("", 35, 46, 35, 20, $SS_BLACKFRAME); make the box around time endif $msg = GUIGetMsg() $size = WinGetPos("Bone-menu", "") If $size[3] <> $oldheight then If $size[3] < 100 then WinMove("Bone-menu", "", $size[0], $size[1], $size[2], 100); smalest possible size height Else $oldheight = $size[3] EndIf EndIf If $size[2] <> $oldwidth then If $size[2] < 120 then WinMove("Bone-menu", "", $size[0], $size[1], 120); smalest possible size width Else $oldwidth = $size[2] EndIf EndIf If $msg = $top then select case $ontop = 0 WinSetOnTop("Bone-menu", "", 1) $ontop = 1 case $ontop = 1 WinSetOnTop("Bone-menu", "", 0) $ontop = 0 EndSelect EndIf If $msg = $trans then WinSetTrans("Bone-menu", "", GUICtrlRead($trans)) If $msg = $quit then exit If $msg = $time1 then _RunAU3("Bone-stopwatch.au3") endif If $msg = $note1 then _RunAU3("Bone-note.au3") endif If $msg = $info then ToolTip("") If GUICtrlRead($info) = 1 then $pos = mousegetpos(); get x,y position of mouse $color = pixelgetcolor($pos[0], $pos[1]) ; get pixel color from screen (x & y) ToolTip("Color " & $color & ",pos " & $pos[0] & "," & $pos[1]) EndIf until $msg = $GUI_EVENT_CLOSE Func _draw() AutoItSetOption("GUIResizeMode", 802) EndFunc ;==>_draw Func _RunAU3($sFilePath, $sWorkingDir = "", $iShowFlag = @SW_SHOW, $iOptFlag = 0) Return Run('"' & @AutoItExe & '" /AutoIt3ExecuteScript "' & $sFilePath & '"', $sWorkingDir, $iShowFlag, $iOptFlag) EndFunc ;==>_RunAU3
×
×
  • Create New...