Leaderboard
Popular Content
Showing content with the highest reputation on 06/12/2018 in all areas
-
Version 5.1
8,855 downloads
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. 2 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.1 point -
GUICtrlGetBkColor() - Get the background color of a control.
Professor_Bernd reacted to guinness for a topic
If you set the Label background colour with GUICtrlSetBkColor() and happen to forget the colour you set it as, then why not try GUICtrlGetBkColor() Function: #include-once #include <WinAPIGdi.au3> ; #FUNCTION# ==================================================================================================================== ; Name ..........: GUICtrlGetBkColor ; Description ...: Retrieves the RGB value of the control background. ; Syntax ........: GUICtrlGetBkColor($hWnd) ; Parameters ....: $hWnd - Control ID/Handle to the control ; Return values .: Success - RGB value ; Failure - 0 ; Author ........: guinness ; Example .......: Yes ; =============================================================================================================================== Func GUICtrlGetBkColor($hWnd) If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd) EndIf Local $hDC = _WinAPI_GetDC($hWnd) Local $iColor = _WinAPI_GetPixel($hDC, 0, 0) _WinAPI_ReleaseDC($hWnd, $hDC) Return $iColor EndFunc ;==>GUICtrlGetBkColorExample use of Function: #include <MsgBoxConstants.au3> #include 'GUICtrlGetBkColor.au3' Example() Func Example() Local $hGUI = GUICreate('GUICtrlGetBkColor() Example', 500, 350) Local $iLabel = GUICtrlCreateLabel('', 10, 10, 480, 330) GUISetState(@SW_SHOW, $hGUI) Local $aColor = [0x0000FF, 0x8FFF9F, 0xEC4841, 0xB0E35D, 0x440BFD] ; Random colour array. Local $iColor = 0 For $i = 0 To UBound($aColor) - 1 GUICtrlSetBkColor($iLabel, $aColor[$i]) Sleep(20) $iColor = GUICtrlGetBkColor($iLabel) ; Pass the controldid to the function. MsgBox($MB_SYSTEMMODAL, '', 'Background Color: ' & _ConvertToHexFormat($aColor[$i]) & @CRLF & _ 'GUICtrlGetBkColor() Hex Format: ' & _ConvertToHexFormat($iColor) & @CRLF & _ 'GUICtrlGetBkColor() Returned: ' & $iColor, 0, $hGUI) Next GUIDelete($hGUI) EndFunc ;==>Example Func _ConvertToHexFormat($iColor) Return Hex($iColor, 6) EndFunc ;==>_ConvertToHexFormatAdditional thanks to Yashied for pointing out the obvious in this >forum message about _WinAPI_GetPixel() and the hint about returning a RGB number1 point -
Creating an installer
Earthshine reacted to benched42 for a topic
I tend to use my own "installer" wizard. I use it for a lot of single-purpose scripts (like clearing out temp files) because users are so familiar with that kind of interface. Here's the template that I start with. Note: It uses the "ExtMsgBox.au3" UDF by Mebla23. One other thing. I tend to use variables for the sizing of the windows so that when I need to make the window a bit larger, I only have to change one variable and the rest are resized automatically. This is especially helpful because I don't have to go back and replace buttons or dividers positions. #NoTrayIcon #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=img\icon.ico #AutoIt3Wrapper_Compression=4 #AutoIt3Wrapper_UseUpx=y #AutoIt3Wrapper_UseX64=N #AutoIt3Wrapper_Res_Description=description #AutoIt3Wrapper_Res_Fileversion=2016.8.25.0 #AutoIt3Wrapper_Res_LegalCopyright=@ Something #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** ;================================================================================ ; AutoIt Script {filename}.au3 ; ; Script that ;================================================================================ #NoTrayIcon #include <GUIConstants.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> #include <StringSize.au3> #include <ExtMsgBox.au3> ;============================================================================== ; Globals $theVersion = "2015.12.21" $theFont = "Segoe UI" $theFontSize = 11 $theBkColor = "0xF8F8F8" $theButtonBarBkColor = BitXOR($theBkColor,"0x222222") $theSource = @TempDir & __RandomTempFolder() $thePrgName = "name" ; The form elements $theFormWidth = 520 $theFormHeight = 370 $theTextMargin = 10 $theButtonWidth = 90 $theButtonHeight = 25 $theButtonVMargin = 8 $theButtonBarHeight = $theButtonHeight + 2 * $theButtonVMargin $theButtonTop = $theFormHeight - $theButtonHeight - $theButtonVMargin $theBannerWidth = 120 $theBannerHeight = $theFormHeight - $theButtonBarHeight $theLeftMargin = $theBannerWidth + $theTextMargin $theTitleTop = 10 ; Title is 10 from top, height of 30 $theMessageTop = 50 ; Message area is 10 from bottom of Title $theMessageHeight = 100 ; Good first height $theMessageWidth = $theFormWidth - $theLeftMargin - $theTextMargin $theFirstLine = $theMessageTop + $theMessageHeight + 10 $theProgressLine = ($theFormHeight / 2) - 10 $theProgressWidth = $theFormWidth - ($theLeftMargin + (5 * $theTextMargin)) _ExtMsgBoxSet(-1,-1,$theBkColor,-1,$theFontSize,$theFont,$theFormWidth * 0.85,$theFormWidth) __Initialize() $frmMain = GUICreate($thePrgName,$theFormWidth,$theFormHeight) GUISetBkColor($theBkColor,$frmMain) GUISetFont($theFontSize,400,0,$theFont,$frmMain) ; Button bar GUICtrlCreateGraphic(0,$theFormHeight - $theButtonBarHeight,$theFormWidth,$theButtonBarHeight) GUICtrlSetBkColor(-1,$theButtonBarBkColor) GUICtrlSetState(-1,$GUI_DISABLE) GUICtrlCreatePic($theSource &"\reg.jpg",0,0,$theBannerWidth,$theBannerHeight) $lblTitle = GUICtrlCreateLabel("",$theLeftMargin,$theTitleTop,$theMessageWidth,30) GUICtrlSetFont(-1,$theFontSize * 1.6,800,2,$theFont) ; version $u = _StringSize("v"& $theVersion,$theFontSize * 0.9,400,0,$theFont) GUICtrlCreateLabel("v"& $theVersion,5,$theFormHeight - $u[3],$u[2],$u[3]) GUICtrlSetFont(-1,10,400,1,$theFont) GUICtrlSetColor(-1,BitXOR($theButtonBarBkColor,"0x444444")) GUICtrlSetBkColor(-1,$theButtonBarBkColor) $lblMessage = GUICtrlCreateLabel("",$theLeftMargin,$theMessageTop,$theMessageWidth,$theMessageHeight) ;GUICtrlSetBkColor(-1,0x008800) $prgStatus = GUICtrlCreateProgress($theLeftMargin + (2 * $theTextMargin),$theProgressLine,$theProgressWidth,20) GUICtrlSetState(-1,$GUI_HIDE) $btnCancel = GUICtrlCreateButton("Cancel",$theFormWidth - 100,$theButtonTop,$theButtonWidth,$theButtonHeight) $btnNext = GUICtrlCreateButton("Next",$theFormWidth - 200,$theButtonTop,$theButtonWidth,$theButtonHeight) $btnDone = GUICtrlCreateButton("Done",$theFormWidth - 200,$theButtonTop,$theButtonWidth,$theButtonHeight) GUICtrlSetState(-1,$GUI_HIDE) GUICtrlSetData($lblTitle,"Welcome") GUICtrlSetData($lblMessage,"Welcome to the Outlook 365 Dynamics Fix. This will reset the Outlook 365 view to show Microsoft Dynamics. NOTE: You must close Outlook first!"& @CRLF & @CRLF &"Click the Next button to begin.") GUISetState(@SW_SHOW,$frmMain) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE If _ExtMsgBox(32,"Yes|No",$thePrgName &" - Verify","Are you sure you want to exit?",0,$frmMain,0,False) = 1 Then ExitLoop EndIf Case $btnCancel If _ExtMsgBox(32,"Yes|No",$thePrgName &" - Verify","Are you sure you want to exit?",0,$frmMain,0,False) = 1 Then ExitLoop EndIf Case $btnNext Case $btnDone ExitLoop EndSwitch WEnd DirRemove($theSource,1) Exit ;============================================================================== ; Nothing beyond here except functions called above ;============================================================================== ;============================================================================== ; Function Name: __RandomTempFolder() ; ; Creates a random temp folder to use while this is running in order to store ; any files needed and included in the script run ;============================================================================== Func __RandomTempFolder() Local $f,$i,$c $f = "\~" For $i = 1 To 10 $c = Random(97,122,1) $f = $f & Chr($c) Next Return $f EndFunc ; ==> End of __RandomTempFolder ;============================================================================== ; Function Name: __Intialize() ; ; This initializes all graphics for GUI items ;============================================================================== Func __Initialize() Local $i,$j,$num,$type ; First check the temp folder existence If NOT FileExists($theSource) Then DirCreate($theSource) Endif FileInstall("C:\Program Files (x86)\AutoIt3\MyScripts\folder\img\jpg",$theSource &"\jpg",1) EndFunc ; ==> End of __Initialize()1 point -
Creating an installer
Earthshine reacted to v20100v for a topic
Ok i notice this @JLogan3o13, I thought it might interest someone in a future search. ++1 point -
confusion how to use operator logic And
faustf reacted to pixelsearch for a topic
faustf: add this 4th case and see the result Case $start = 0 And $to <> "" And $match <> "" MsgBox(0, '', 'example 4')1 point -
KB4100403 - runing exe from shared folder
Earthshine reacted to mLipok for a topic
Using SMBv1 you are using old technology, which i buggy, so Microsoft starts treating this as a issue. And drop all connection from shared folders to remote hosts.1 point -
Returning to the line
Aleksandar reacted to JLogan3o13 for a topic
This still does not explain what exactly you are trying to accomplish. Please be more specific if you wish help.1 point -
Indeed there are many (zillions of) good tutorials on regular expressions floating around. However be sure you focus on PCRE flavor, which AutoIt uses. The definitive documentation on the version currently implemented in AutoIt (PCRE1) can be found here : https://www.pcre.org/original/doc/html/pcrepattern.html Also AutoIt help file documents most used features, albeit not being a regexp primer. See my signature for an excellent site offering compatible regexp support, including step by step debugging and a detailed strict explanation of what a given pattern means, in plain english.1 point
-
Danyfirex beat me to the answer by seconds, so I cancelled my reply. What happens is _WD_ElementAction's "rect" $sCommand returns a JSON Object, therefore you don't need to Json_Decode the return variable. In the console window's debug you get back: _WD_ElementAction: {"value": {"x":966.0,"y":19.0,"width":34.0,"height":24.0}} That gets reduced to {"x":966.0,"y":19.0,"width":34.0,"height":24.0} because the $sResponse gets run through a JSON_Decode and Json_Get($oJSON, "[value]") before getting returned to your variable. Notice that the parent "value" is now gone from the new JSON Object. That's why you omit it when you do your own Json_Get.1 point
-
@Belini I don't know how to disable the overlay. But if you run a second copy of the player, the overlay will be disabled for this copy, and you can take a screenshot. Try this function on WinXP. I tested on Win7 with and without aero and got a normal screenshot for avi-file in both cases. Negative effect is a strong flicker. ... Case $capture If $Tocando = True Then $sFilePath = @ScriptDir & "\scr.jpg" If @OSVersion = "WIN_XP" Or Not _WinAPI_DwmIsCompositionEnabled() Then _ScreenShot($sFilePath) Else _ScreenCapture_CaptureWnd($sFilePath, ControlGetHandle($hGUI, "", "VideoRenderer1")) EndIf EndIf ... Func _ScreenShot($sFilePath) Local $aVidPos, $tPoint, $hScr, $iVid _Video_Pause($idS) $aVidPos = ControlGetPos($hGUI, "", "VideoRenderer1") $tPoint = DllStructCreate($tagPoint) $tPoint.X = 0 $tPoint.Y = 0 _WinAPI_ClientToScreen(ControlGetHandle($hGUI, "", "VideoRenderer1"), $tPoint) $hScr = GUICreate("GUI for ScreenShot", $aVidPos[2], $aVidPos[3], $tPoint.X, $tPoint.Y, $WS_POPUP, -1, $hGUI) GUISetState(@SW_SHOWNOACTIVATE) $iVid = _Video_Open($video, $hScr, 0, 0, $aVidPos[2], $aVidPos[3]) _Video_Seek($iVid, _Video_TimePos($idS, 1)) _ScreenCapture_CaptureWnd($sFilePath, $hScr) _Video_close($iVid) GUIDelete($hScr) _Video_Resume($idS) EndFunc ;==>_ScreenShot1 point
-
Creating an installer
v20100v reacted to Earthshine for a topic
nice! I want to play with it a while when I can.1 point -
Is there any fire anywhere since it seems you are seeking attention preferably NOW ? Please be patient and wait for people to walk in and feel the urge to look assist although it might be they have no idea what you really want. Jos0 points
-
Creating an installer
v20100v reacted to JLogan3o13 for a topic
@v20100v please stop resurrecting old posts just to hock a product.0 points