Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/20/2025 in all areas

  1. I would simply use the constant $SBARS_SIZEGRIP.
    1 point
  2. I'm not sure this is what you are asking for. But I'll give it a try. I use the following function (written by Melba23) to remove style settings from controls: ; #INTERNAL_USE_ONLY#============================================================================================================ ; Name ..........: __Remove_Style ; Description ...: Remove a style from a single or multiple GUI controls. ; Syntax ........: __Remove_Style($iStyleToRemove, $id1[, $id2 = 0[, $id3 = 0[, $id4 = 0[, $id5 = 0[, $id6 = 0[, $id7 = 0[, $id8 = 0[, $id9 = 0[, $id10 = 0]]]]]]]]]) ; Parameters ....: $iStyleToRemove - integer value of the style to remove. ; $id1 - ControlID to remove the style from. ; $id2 to $id10 - [optional] additional ControlIDs to remove the style from. ; Return values .: Success - 0 ; Failure - None ; Author ........: Melba23 ; Modified ......: ; Remarks .......: Code taken from: https://www.autoitscript.com/forum/topic/209900-ignore-control-in-taborder/?tab=comments#comment-1515251 ; Related .......: ; Link ..........: ; Example .......: ; =============================================================================================================================== Func __Remove_Style($iStyleToRemove, $id1, $id2 = 0, $id3 = 0, $id4 = 0, $id5 = 0, $id6 = 0, $id7 = 0, $id8 = 0, $id9 = 0, $id10 = 0) #forceref $id1, $id2, $id3, $id4, $id5, $id6, $id7, $id8, $id9, $id10 Local $hControl, $iStyle For $i = 1 To @NumParams - 1 ; @NumParams must be between 2 and 11. The 1st parameter will always be the style to remove. $hControl = GUICtrlGetHandle(Eval("id" & $i)) $iStyle = _WinAPI_GetWindowLong($hControl, $GWL_STYLE) If BitAND($iStyle, $iStyleToRemove) = $iStyleToRemove Then _ _WinAPI_SetWindowLong($hControl, $GWL_STYLE, BitXOR($iStyle, $iStyleToRemove)) Next EndFunc ;==>__Remove_Style
    1 point
  3. Got bored today, while working on my au3unit project, and made this class-ish solution with functions, variables and maps. Maybe someone will use it 😜 Features: public class properties public static class properties public methods public static methods class Inheritance Repository: https://github.com/genius257/au3-functional-class ZIP download: https://github.com/genius257/au3-functional-class/archive/8503c876f65cb0cf339a324d0483d588a63eb4df.zip Online example file: https://github.com/genius257/au3-functional-class/blob/8503c876f65cb0cf339a324d0483d588a63eb4df/example.au3 Enjoy 😀
    1 point
  4. Hi @ioa747 , thanks for the heads up I have updated the code with the change like you mentioned, to get rid of the warning.
    1 point
  5. That is absolutely perfect, thank you. The title of that thread is likely why it wasn't coming up in my searches or at least wouldn't have been as likely to catch my attention.
    1 point
  6. take a look https://www.autoitscript.com/forum/topic/211606-_winapi_createwindowex-set-bgcolor
    1 point
  7. Current working screenshot: When comparing the screenshot from the OP to this one, it is much less cluttered with buttons everywhere. The giant Current Policy Information label was able to be reduced into the status bar. dark mode menu bar complete dark mode status bar complete I realized that there were no perfect solutions to dark mode menu bar after searching the forums for a few days. The sub-classing methods looked pretty good but still left the "gripper" or "resizer" part in the buttom right corner as a different color which was no good. I ended up using the _GUICtrlSimpleStatusBar_* functions from MrCreatoR. I was able to fix it so that it resizes perfectly and I can also update the status content easily.
    1 point
  8. Jos

    Easy if and else

    No shit, Yuchan is back.... This isn't going to end well.
    1 point
  9. Like this? #include <GUIConstants.au3> #include <WinAPI.au3> ; for _WinAPI_CreateWindowEx() #include <GDIPlus.au3> Opt("MustDeclareVars", 1) ; example from "https://www.autoitscript.com/forum/topic/178961-resize-control/?do=findComment&comment=1336645" Global Const $SBS_SIZEBOX = 0x08 Global Const $SBS_SIZEGRIP = 0x10 Global $hGui, $hSizebox, $hProc, $hOldProc, $hDots Example() Func Example() Local $iW = 250, $iH = 50 $hGui = GUICreate("Resize corner", $iW, $iH, -1, -1, $WS_OVERLAPPEDWINDOW) GUISetBkColor(0x383838) Local $idResizeLabel = GUICtrlCreateLabel("", $iW - 20, $iH - 20, 22, 22) GUICtrlSetResizing(-1, $GUI_DOCKRIGHT + $GUI_DOCKBOTTOM + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT) GUICtrlSetCursor(-1, 12) $hSizebox = _WinAPI_CreateWindowEx(0, "Scrollbar", "", $WS_CHILD + $WS_VISIBLE + $SBS_SIZEBOX, $iW - 20, $iH - 20, 20, 20, $hGui) ; $SBS_SIZEBOX or $SBS_SIZEGRIP _GDIPlus_Startup() $hProc = DllCallbackRegister('ScrollbarProc', 'lresult', 'hwnd;uint;wparam;lparam') $hOldProc = _WinAPI_SetWindowLong($hSizebox, $GWL_WNDPROC, DllCallbackGetPtr($hProc)) $hDots = CreateDots(20, 20, 0xFF383838, 0xFFBFBFBF) GUIRegisterMsg($WM_SIZE, "WM_SIZE") GUISetState() Local $iResize = 0 While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $GUI_EVENT_PRIMARYUP If $iResize Then $iResize = 0 ; restore the default mouse behaviour GUISetCursor(2, 0, $hGui) GUICtrlSetState($idResizeLabel, $GUI_SHOW) EndIf Case $idResizeLabel $iResize = 1 GUICtrlSetState($idResizeLabel, $GUI_HIDE) GUISetCursor(12, 1, $hGui) MouseDown("MAIN") ; ..now that the Ctrl is hidden, nothing is held down, so we fake it ;) EndSwitch WEnd GUIDelete($hGui) _GDIPlus_BitmapDispose($hDots) _WinAPI_SetWindowLong($hSizebox, $GWL_WNDPROC, $hOldProc) DllCallbackFree($hProc) _GDIPlus_Shutdown() Exit EndFunc ;==>Example Func WM_SIZE($hWnd, $iMsg, $wParam, $lParam) Local $aSize = WinGetClientSize($hGui) WinMove($hSizebox, "", $aSize[0] - 20, $aSize[1] - 20) EndFunc ;==>WM_SIZE Func ScrollbarProc($hWnd, $iMsg, $wParam, $lParam) If $hWnd = $hSizebox And $iMsg = $WM_PAINT Then Local $tPAINTSTRUCT Local $hDC = _WinAPI_BeginPaint($hWnd, $tPAINTSTRUCT) Local $iWidth = DllStructGetData($tPAINTSTRUCT, 'rPaint', 3) - DllStructGetData($tPAINTSTRUCT, 'rPaint', 1) Local $iHeight = DllStructGetData($tPAINTSTRUCT, 'rPaint', 4) - DllStructGetData($tPAINTSTRUCT, 'rPaint', 2) Local $hGraphics = _GDIPlus_GraphicsCreateFromHDC($hDC) _GDIPlus_GraphicsDrawImageRect($hGraphics, $hDots, 0, 0, $iWidth, $iHeight) _GDIPlus_GraphicsDispose($hGraphics) _WinAPI_EndPaint($hWnd, $tPAINTSTRUCT) Return 0 EndIf Return _WinAPI_CallWindowProc($hOldProc, $hWnd, $iMsg, $wParam, $lParam) EndFunc Func CreateDots($iWidth, $iHeight, $iBackgroundColor, $iDotsColor) Local $hBitmap = _GDIPlus_BitmapCreateFromScan0($iWidth, $iHeight) Local $hGraphics = _GDIPlus_ImageGetGraphicsContext($hBitmap) Local $hBrush = _GDIPlus_BrushCreateSolid($iDotsColor) _GDIPlus_GraphicsClear($hGraphics, $iBackgroundColor) _GDIPlus_GraphicsFillRect($hGraphics, $iWidth - 4, $iHeight - 12, 2, 2, $hBrush) _GDIPlus_GraphicsFillRect($hGraphics, $iWidth - 4, $iHeight - 8, 2, 2, $hBrush) _GDIPlus_GraphicsFillRect($hGraphics, $iWidth - 4, $iHeight - 4, 2, 2, $hBrush) _GDIPlus_GraphicsFillRect($hGraphics, $iWidth - 8, $iHeight - 8, 2, 2, $hBrush) _GDIPlus_GraphicsFillRect($hGraphics, $iWidth - 8, $iHeight - 4, 2, 2, $hBrush) _GDIPlus_GraphicsFillRect($hGraphics, $iWidth - 12, $iHeight - 4, 2, 2, $hBrush) _GDIPlus_BrushDispose($hBrush) _GDIPlus_GraphicsDispose($hGraphics) Return $hBitmap EndFunc By the way, this definition for $tagPAINTSTRUCT must be changed from Global Const $tagPAINTSTRUCT = 'hwnd hDC;int fErase;dword rPaint[4];int fRestore;int fIncUpdate;byte rgbReserved[32]' to Global Const $tagPAINTSTRUCT = 'hwnd hDC;int fErase;long Left;long Top;long Right;long Bottom;int fRestore;int fIncUpdate;byte rgbReserved[32]'
    1 point
×
×
  • Create New...