Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/25/2017 in all areas

  1. Features: Create modern looking borderless and resizable GUIs with control buttons (Close,Maximize/Restore,Minimize, Fullscreen, Menu) True borderless, resizeable GUI with full support for aerosnap etc. Many color schemes/themes included. See MetroThemes.au3 for more details. 3 type of Windows 8/10 style buttons. Modern checkboxes, radios, toggles and progressbar. All buttons, checkboxes etc. have hover effects! Windows 10 style modern MsgBox. Windows 10/Android style menu that slides in from left. Windows 10 style right click menu Credits: @UEZ, for the function to create buttons with text using GDIPlus. @binhnx for his SSCtrlHover UDF Changelog: Download UDF with example:
    1 point
  2. I normally put it in place to strip white space from the beginning and end of a string and also remove double spaces. You probably don't actually need it at all. The issue was you were targeting "button" rather than "input".
    1 point
  3. What about: Local $oInputs = _IETagNameGetCollection($oIE, "input") For $oInput in $oInputs If StringStripWS($oInput.value, 7) = "Sign In" Then _IEAction($oInput, "click") Next
    1 point
  4. Run with Alt-F5 and compile with Alt-F7. Else use the directive: #AutoIt3Wrapper_Version=b ;(B/P) Use Beta or Production for AutoIt3 and Aut2Eex. Default is P
    1 point
  5. have a look to _IsPressed() #pragma compile(Console, True) #include <MsgBoxConstants.au3> #include <Misc.au3> Local $hDLL = DllOpen("user32.dll") ConsoleWrite("coded byy hani |" & @CRLF ) $p = ConsoleWrite("| [ Press 1 ]|" & @CRLF ) $g = ConsoleWrite("| [ Press 2 ]|" & @CRLF ) $i = ConsoleWrite("| [ Press 3 to exit]|" & @CRLF ) $i = ConsoleWrite("_____________________________________________________________" & @CRLF ) While 1 if _IsPressed("31", $hDLL) Or _IsPressed("61", $hDLL) Then MsgBox(0,0, "You pressed 1", 1) if _IsPressed("32", $hDLL) Or _IsPressed("62", $hDLL) Then MsgBox(0,0, "You pressed 2", 1) if _IsPressed("33", $hDLL) Or _IsPressed("63", $hDLL) Then MsgBox(0,0, "You pressed 3" & @CRLF & "script will exit in 2 second", 2) ConsoleWrite("Bye" & @CRLF) Exit EndIf Sleep(50) WEnd
    1 point
  6. You can store ControlIDs as keys in the new Map datatype offered in the beta, the value being the index for accessing the array of descriptions and names. You can also store an array of name and description as value instead of an index and get rid of the other arrays.
    1 point
  7. Another way: Local $sString = "" If StringIsDigit($sString) Then MsgBox(4096, "", $sString > 0 ? "Value is positive." : "Value is negative.") Else MsgBox(4096, "", StringIsXDigit($sString) ? "Value might be hexadecimal!" : "Value is a string.") EndIf
    1 point
  8. CUIAutomation2.au3 does not have any functions defined in it, that is why call tips are not created. User CallTips Manager only works with functions. Adam
    1 point
  9. Tricky (and bugie?) method: #include <WindowsConstants.au3> Opt("GUICloseOnESC", 0) Opt("GUIOnEventMode", 1) Opt("WinWaitDelay", 0) Global $hButton_GUI, $nButton, $ContextMenu Global $MenuItem1, $MenuItem2, $MenuItem3, $Exit_MenuItem Global $aOld_ParentPos = -1, $hParent, $hOld_Parent Global $sMain_Title = "[CLASS:Notepad]" Run(@WindowsDir & "\Notepad.exe") WinWait($sMain_Title) $hParent = WinGetHandle($sMain_Title) _ExternalButtonCreate_Proc() AdlibEnable("_ExternalButtonFollow_Proc", 1) While 1 Sleep(100) WEnd Func _ExternalButtonCreate_Proc() $hButton_GUI = GUICreate("", 65, 18, -1, -1, $WS_POPUP, $WS_EX_TOPMOST+$WS_EX_TOOLWINDOW) $nButton = GUICtrlCreateButton("Button", 0, 0, 65, 18) GUICtrlSetOnEvent(-1, "_Button_Event") Local $DummyMenu = GUICtrlCreateDummy() $ContextMenu = GUICtrlCreateContextMenu($DummyMenu) $MenuItem1 = GUICtrlCreateMenuItem("Some Item1", $ContextMenu) $MenuItem2 = GUICtrlCreateMenuItem("Some Item2", $ContextMenu) $MenuItem3 = GUICtrlCreateMenuItem("Some Item3", $ContextMenu) GUICtrlCreateMenuItem("", $ContextMenu) $Exit_MenuItem = GUICtrlCreateMenuItem("Exit", $ContextMenu) GUICtrlSetOnEvent(-1, "_Exit") GUISetState(@SW_SHOW, $hButton_GUI) EndFunc Func _ExternalButtonFollow_Proc() If $hParent <> -1 And Not WinExists($hParent) Then GUISetState(@SW_HIDE, $hButton_GUI) $hParent = -1 ElseIf $hParent = -1 And WinExists($sMain_Title) Then GUISetState(@SW_SHOW, $hButton_GUI) $hParent = WinGetHandle($sMain_Title) ElseIf $hParent = -1 Then Return EndIf $aParentPos = WinGetPos($hParent) $aParentClientSize = WinGetClientSize($hParent) If Not IsArray($aParentPos) Then Return If Not WinActive($hParent) And Not WinActive($hButton_GUI) Then $aParentPos[0] = -3200 $aParentPos[1] = -3200 EndIf If $aOld_ParentPos = -1 Or $aOld_ParentPos[0] <> $aParentPos[0] Or $aOld_ParentPos[1] <> $aParentPos[1] Or _ $aOld_ParentPos[2] <> $aParentPos[2] Then $aOld_ParentPos = $aParentPos $iBorder_Size = ($aParentPos[2] - $aParentClientSize[0]) / 2 $iX = ($aParentPos[0] + $aParentPos[2]) - 170 $iY = $aParentPos[1] + $iBorder_Size If $aParentPos[2] < 170 Then $iX = $aParentPos[0] + $iBorder_Size WinMove($hButton_GUI, "", $iX, $iY) EndIf EndFunc Func _Button_Event() ConsoleWrite("Button clicked" & @CRLF) _GUICtrlMenu_Show($hButton_GUI, $ContextMenu, $nButton) EndFunc Func _GUICtrlMenu_Show($hWnd, $nContextID, $nContextControlID, $iMouse=0) Local $hMenu = GUICtrlGetHandle($nContextID) Local $iCtrlPos = ControlGetPos($hWnd, "", $nContextControlID) Local $iX = $iCtrlPos[0] Local $iY = $iCtrlPos[1] + $iCtrlPos[3] ; Convert the client (GUI) coordinates to screen (desktop) coordinates ;ClientToScreen Local $stPoint = DllStructCreate("int;int") DllStructSetData($stPoint, 1, $iX) DllStructSetData($stPoint, 2, $iY) DllCall("user32.dll", "int", "ClientToScreen", "hwnd", $hWnd, "ptr", DllStructGetPtr($stPoint)) $iX = DllStructGetData($stPoint, 1) $iY = DllStructGetData($stPoint, 2) ;ClientToScreen If $iMouse Then $iX = MouseGetPos(0) $iY = MouseGetPos(1) EndIf DllCall("user32.dll", "int", "TrackPopupMenuEx", "hwnd", $hMenu, "int", 0, "int", $iX, "int", $iY, "hwnd", $hWnd, "ptr", 0) EndFunc Func _Exit() Exit EndFunc
    1 point
  10. You can do this in AutoIt with _FileListToArray() or FileFindFirstFile()/FileFindNextFile(), and FileCopy().
    1 point
×
×
  • Create New...