Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/22/2024 in all areas

  1. argumentum

    Static Button?

    #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 200, 50) Local $iBorderSize = 1 $Label1 = GUICtrlCreateLabel("", 10 - $iBorderSize, 10 - $iBorderSize, 75 + ($iBorderSize * 2), 25 + ($iBorderSize * 2)) GUICtrlSetBkColor(-1, 0x006600) $Button1 = GUICtrlCreateButton("Enable", 10, 10, 75, 25) $Checkbox1 = GUICtrlCreateCheckbox("Test here", 112, 12, 75, 25, BitOR($GUI_SS_DEFAULT_CHECKBOX,$BS_PUSHLIKE)) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Checkbox1 If GUICtrlRead($Checkbox1) = 1 Then GUICtrlSetData($Button1, "Enable") GUICtrlSetBkColor($Label1, 0x006600) Else GUICtrlSetData($Button1, "Disable") GUICtrlSetBkColor($Label1, 0x660000) EndIf EndSwitch WEnd you're very cryptic for me. The above will be identifiable anywhere. Kirk Out
    1 point
  2. argumentum

    Static Button?

    ..and that is how it looks for me. I assume that you'd like the enable/disable button to look "static". Play around with what win32 controls has to offer and settle for something that will clearly signal the state on any Windows version. My 2 cents of wisdom
    1 point
  3. MattyD

    Midi Controller

    A small update today. Added: Reverb and Chorus Engine controls - this is the new "setup" button sitting in the FX Send section. These settings aren't channel specific and should apply across the instrument (if supported). Fixed: The Reverb and Chorus sliders weren't resetting when required. the pitch indicator in Key-Based percussion dialog was not always displaying correctly.
    1 point
  4. CarlD

    World Time for the CLI

    Thanks to suggestions from @argumentum, I will be revising this script -- but not until after the year-end holidays. Cheers.
    1 point
  5. That's right, thanks for the info In fact, I remembered a discussion from 2021 with @UEZ concerning the bypass of SetBitmap() and its replacement with _WinAPI_UpdateLayeredWindowEx() . You can find the original discussion here, also you'll need Torus.png if you intend to run UEZ's interesting script. We really owe a lot to Yashied and "his famous WinAPIEx UDF" , as quoted by UEZ in his answer. Edit: now that SetBitmap() has gone forever, we still may get a shorter code with same functionalities : ; Local $hGUI = GUICreate("", $iWidth, $iHeight, -1, -1, $WS_POPUP, $WS_EX_LAYERED) Local $hGUI = GUICreate("", $iWidth, $iHeight, -1, -1, $WS_POPUP, BitOr($WS_EX_LAYERED, $WS_EX_CONTROLPARENT, $WS_EX_TOPMOST)) ; Register notification messages ; GUIRegisterMsg($WM_NCHITTEST, WM_NCHITTEST) ; WinSetOnTop($hGUI, "", $WINDOWS_ONTOP) ; Func WM_NCHITTEST($hWnd, $iMsg, $iwParam, $ilParam) ; Return $HTCAPTION ; EndFunc ;==>WM_NCHITTEST
    1 point
  6. @Nine does this work for you ? ; SetBitmap($hGUI, $hImage, 255) _WinAPI_UpdateLayeredWindowEx($hGUI, -1, -1, _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage)) If it works, then we shouldn't need Function SetBitmap() and its 18 lines.
    1 point
  7. Here modern coding (removed useless code) : #include <WinAPISysWin.au3> #include <WinAPIConstants.au3> #include <GDIPlus.au3> #include <GuiComboBox.au3> #include <File.au3> #include <WindowsConstants.au3> #include <GuiConstants.au3> #include <ButtonConstants.au3> Opt("MustDeclareVars", True) Global Const $AC_SRC_ALPHA = 1 Example() Func Example() ; Load PNG file as GDI bitmap _GDIPlus_Startup() Local $sPngSrc = @ScriptDir & "\LaunchySkin.png" Local $hImage = _GDIPlus_ImageLoadFromFile($sPngSrc) ; Extract image width and height from PNG Local $iWidth = _GDIPlus_ImageGetWidth($hImage) Local $iHeight = _GDIPlus_ImageGetHeight($hImage) ; Create layered window Local $hGUI = GUICreate("", $iWidth, $iHeight, -1, -1, $WS_POPUP, $WS_EX_LAYERED) Local $hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage) _WinAPI_UpdateLayeredWindowEx($hGUI, -1, -1, $hBitmap) ; Register notification messages GUIRegisterMsg($WM_NCHITTEST, WM_NCHITTEST) GUISetState() WinSetOnTop($hGUI, "", $WINDOWS_ONTOP) ; As per help file : ; When using $WS_EX_MDICHILD the position is relative to client area of the parent window. ; With $WS_EX_LAYERED it is possible to have a transparent picture on a background picture defined in the parent window. ; To have a transparent picture, create the GUI with the WS_EX_LAYERED extended style. ; The left-top pixel will be used as the transparency color. ; If several pictures are created the last picture defines the transparent color. GUICreate("", $iWidth, $iHeight, 0, 0, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_MDICHILD), $hGUI) GUICtrlCreatePic(@ScriptDir & "\grey.gif", 0, 0, $iWidth, $iHeight) ; makes the whole child GUI transparent GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlCreateLabel("Type the name of a file on" & @CR & "your desktop and press Enter", 50, 30, 140, 60) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetColor(-1, 0xFFFFFF) ; combo box listing all items on desktop Local $idCombo = GUICtrlCreateCombo("", 210, 30, 250, -1, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) GUICtrlSetFont($idCombo, 10) ; set default button for Enter key activation - renders outside GUI window Local $idButton = GUICtrlCreateButton("", 0, 0, 0, 0, $BS_DEFPUSHBUTTON) GUISetState() ; get list of files on desktop, show in combobox Local $aFileList = _FileListToArray(@DesktopDir), $sRun _ArraySort($aFileList, 0, 1) GUICtrlSetData($idCombo, _ArrayToString($aFileList, "|", 1)) While True Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $idButton $sRun = GUICtrlRead($idCombo) ExitLoop EndSwitch WEnd If $sRun And FileExists(@DesktopDir & "\" & $sRun) Then Beep(2000, 50) ShellExecute($sRun, "", @DesktopDir) EndIf _WinAPI_DeleteObject($hBitmap) _GDIPlus_ImageDispose($hImage) _GDIPlus_Shutdown() EndFunc ;==>Example Func WM_NCHITTEST($hWnd, $iMsg, $iwParam, $ilParam) Return $HTCAPTION EndFunc ;==>WM_NCHITTEST
    1 point
  8. Valuater

    Control Tooltip

    hows about #include <GUIConstants.au3> #include <Date.au3> GUICreate("MY GUI") $Button_1 = GUICtrlCreateButton("Select", 10, 50, 50, 20) GUICtrlSetTip( -1, "Select button") $Button_2 = GUICtrlCreateButton("Exit", 60, 50, 50, 20) GUICtrlSetTip( -1, "Exit button") $Label_4 = GUICtrlCreateLabel("Mouse over any control", 10, 10, 400, 30) GUICtrlSetTip( -1, "Label Message") GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $Button_1 MsgBox(64,"Mouse over","this is a mouse over control test") Case $msg = $GUI_EVENT_CLOSE Or $msg = $Button_2 Exit EndSelect WEnd 8)
    1 point
×
×
  • Create New...