Leaderboard
Popular Content
Showing content with the highest reputation on 08/03/2025 in all areas
-
Here is new script. It is neccessary to catch WM_NCPAINT and do drawing there. Coordinates are issue again. #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include <WinAPITheme.au3> #include "GUIDarkMode_v0.02mod.au3" #include "ModernMenuRaw.au3" #include <GuiMenu.au3> #include <Array.au3> #include <WinAPIDiag.au3> #include <WinAPIConv.au3> #include <WinAPIGdiDC.au3> ;~ DllCall("User32.dll", "bool", "SetProcessDpiAwarenessContext", "HWND", "DPI_AWARENESS_CONTEXT" - 4) _SetMenuBkColor(0x202020) _SetMenuIconBkColor(0x202020) _SetMenuIconBkGrdColor(0x202020) _SetMenuSelectBkColor(0x202020) _SetMenuSelectRectColor(0x202020) _SetMenuSelectTextColor(0xFFFFFF) _SetMenuTextColor(0xFFFFFF) Example() Func Example() $hGUI = GUICreate("My GUI", 300, 200) ;Local $idFileMenu = GUICtrlCreateMenu("&File") Local $idFileMenu = _GUICtrlCreateODTopMenu("&File", $hGUI) GUICtrlCreateMenuItem("&Open", $idFileMenu) GUICtrlCreateMenuItem("&Save", $idFileMenu) GUICtrlCreateMenuItem("", $idFileMenu) Local $idOptionsMenu = GUICtrlCreateMenu("O&ptions", $idFileMenu) GUICtrlCreateMenuItem("View", $idOptionsMenu) GUICtrlCreateMenuItem("", $idOptionsMenu) GUICtrlCreateMenuItem("Tools", $idOptionsMenu) GUICtrlCreateMenuItem("", $idFileMenu) Local $idExitItem = GUICtrlCreateMenuItem("&Exit", $idFileMenu) ;Local $idHelpMenu = GUICtrlCreateMenu("&?") Local $idHelpMenu = _GUICtrlCreateODTopMenu("&?", $hGUI) Local $idAboutItem = GUICtrlCreateMenuItem("&About", $idHelpMenu) Local $idEndBtn = GUICtrlCreateButton("End", 110, 140, 70, 20) Global $hSolidBrush = _WinAPI_CreateBrushIndirect($BS_SOLID, 0xFF00FF) GUIRegisterMsg($WM_NCPAINT, WM_NCPAINT) ;~ GUIRegisterMsg($WM_ERASEBKGND,WM_ERASEBKGND) ;~ GUIRegisterMsg($WM_PAINT,WM_PAINT) ;~ GUIRegisterMsg($WM_DRAWITEM, WM_DRAWITEM2) GuiDarkmodeApply($hGUI) GUISetState(@SW_SHOW) ;_drawUAHMenuNCBottomLine($hGUI) Local $idMsg ; Loop until the user exits. While 1 $idMsg = GUIGetMsg() Switch $idMsg Case $idExitItem, $idEndBtn, $GUI_EVENT_CLOSE _WinAPI_DeleteObject($hSolidBrush) ExitLoop Case $idAboutItem MsgBox($MB_SYSTEMMODAL, "About...", "Colored menu sample") EndSwitch WEnd EndFunc ;==>Example Func WM_DRAWITEM2($hWnd, $iMsg, $wParam, $lParam) ConsoleWrite("WM_DRAWITEM" & @CRLF) ConsoleWrite("$hwnd=" & $hWnd & @CRLF) ;~ ConsoleWrite("$hDC=" & $wParam & @CRLF) WM_DRAWITEM($hWnd, $iMsg, $wParam, $lParam) ;~ _WinAPI_DefSubclassProc($hWnd, $iMsg, $wParam, $lParam) ;~ _WinAPI_DefWindowProc($hWnd, $iMsg, $wParam, $lParam) ;~ _drawUAHMenuNCBottomLine($hWnd) Return True EndFunc ;==>WM_NCPAINT Func WM_PAINT($hWnd, $iMsg, $wParam, $lParam) ConsoleWrite("WM_PAINT" & @CRLF) ConsoleWrite("$hwnd=" & $hWnd & @CRLF) ;~ ConsoleWrite("$hDC=" & $wParam & @CRLF) _WinAPI_DefWindowProc($hWnd, $iMsg, $wParam, $lParam) _drawUAHMenuNCBottomLine($hWnd) Return 0 EndFunc ;==>WM_NCPAINT Func WM_ERASEBKGND($hWnd, $iMsg, $wParam, $lParam) ConsoleWrite("WM_ERASEBKGND" & @CRLF) ConsoleWrite("$hwnd=" & $hWnd & @CRLF) ConsoleWrite("$hDC=" & $wParam & @CRLF) ;_WinAPI_DefWindowProc($hWnd, $iMsg, $wParam, $lParam) _drawUAHMenuNCBottomLine($hWnd) Return 1 EndFunc ;==>WM_NCPAINT Func WM_NCPAINT($hWnd, $iMsg, $wParam, $lParam) ConsoleWrite("$hwnd=" & $hWnd & @CRLF) ConsoleWrite("$wParam=" & $wParam & @CRLF) _WinAPI_DefWindowProc($hWnd, $iMsg, $wParam, $lParam) _drawUAHMenuNCBottomLine($hWnd) Return 0 EndFunc ;==>WM_NCPAINT Func _drawUAHMenuNCBottomLine($hWnd) $aMenuBarInfo = _GUICtrlMenu_GetMenuBarInfo($hWnd, 0, 1) ;_ArrayDisplay($aMenuBarInfo) $rcClient = _WinAPI_GetClientRect($hWnd) ;_WinAPI_DisplayStruct($rcClient, $tagRECT, "rcClinet before") ;CHAT GPT Local $aCall = DllCall("user32.dll", "int", "MapWindowPoints", _ "hwnd", $hWnd, _ ; hWndFrom "hwnd", 0, _ ; hWndTo "ptr", DllStructGetPtr($rcClient), _ "uint", 2) ;number of points - 2 for RECT structure If @error Then ;MsgBox($MB_ICONERROR, "Error", @error) Exit EndIf ;_WinAPI_DisplayStruct($rcClient, $tagRECT, "rcClinet after") $rcWindow = _WinAPI_GetWindowRect($hWnd) _WinAPI_OffsetRect($rcClient, -$rcWindow.left, -$rcWindow.top) $rcAnnoyingLine = DllStructCreate($tagRECT) $rcAnnoyingLine.left = $rcClient.left $rcAnnoyingLine.top = $rcClient.top $rcAnnoyingLine.right = $rcClient.right $rcAnnoyingLine.bottom = $rcClient.bottom ;~ _WinAPI_DisplayStruct($rcAnnoyingLine, $tagRECT) $rcAnnoyingLine.bottom = $rcAnnoyingLine.top $rcAnnoyingLine.top = $rcAnnoyingLine.top - 1 ;~ _WinAPI_DisplayStruct($rcAnnoyingLine, $tagRECT,"annoying line") ;~ $rcAnnoyingLine.left = 0 ;~ $rcAnnoyingLine.top = 0 ;~ $rcAnnoyingLine.right = 100 ;~ $rcAnnoyingLine.bottom = 200 $hRgn=_WinAPI_CreateRectRgn(0,0,1000,500) ;~ $hDC = _WinAPI_GetDC($hWnd) $hDC=_WinAPI_GetDCEx($hWnd,$hRgn, BitOR($DCX_WINDOW,$DCX_INTERSECTRGN)) If $hDC=0 Then ConsoleWrite("hDC=0" & @CRLF) EndIf _WinAPI_FillRect($hDC, $rcAnnoyingLine, $hSolidBrush) _WinAPI_ReleaseDC($hWnd, $hDC) ;_WinAPI_DisplayStruct($rcAnnoyingLine, $tagRECT, "annoying line") EndFunc ;==>_drawUAHMenuNCBottomLine2 points
-
Hello everyone, I'm excited to share a new AutoIt UDF library: SafeArray UDF. This library simplifies working with COM SafeArrays and VARIANT structures, making it easier to interact with COM objects (like Excel, ADO, or other applications) in AutoIt scripts. Key Features Bidirectional Conversion: Convert AutoIt arrays to COM SafeArrays and vice versa (up to 5 dimensions). SafeArray Management: Create, modify, access, and destroy SafeArrays using functions like _SafeArrayCreate, _SafeArrayGetElement, _SafeArrayPutElement, and _SafeArrayDestroy. VARIANT Support: Convert AutoIt data (integers, strings, arrays, COM objects) to VARIANTs and back with _VariantSet and _VariantRead. BSTR Handling: Allocate, read, and free COM strings with _SysAllocString, _SysReadString, and _SysFreeString. 32/64-bit Compatibility: Works with AutoIt 3.3+ without external dependencies, except Date.au3 for $VT_DATE types. Error Handling: Uses @error to report issues (e.g., invalid pointers, incorrect dimensions). Why Use This UDF? SafeArrays are a standard for passing multi-dimensional arrays in COM interfaces. This UDF streamlines their use in AutoIt, eliminating the complexity of direct DLL calls. It’s perfect for working with COM applications like Excel or databases via ADO that rely on SafeArrays. Simple Example #include "SafeArray.au3" Func Example_VT_FILETIME() Local $tVar = DllStructCreate($tagVARIANT) Local $tSystemTime = _Date_Time_GetSystemTime() Local $tFileTime = _Date_Time_SystemTimeToFileTime($tSystemTime) ; Set the FILETIME into the VARIANT _VariantSet(DllStructGetPtr($tVar), $tFileTime, $VT_FILETIME) ; Read the FILETIME from the VARIANT Local $sDateTime = _VariantRead(DllStructGetPtr($tVar)) ConsoleWrite("VT_FILETIME: " & $sDateTime & @CRLF) ; Should display current date/time ; Clean up _VariantClear(DllStructGetPtr($tVar)) EndFunc ;==>Example_VT_FILETIME ; Run the example Example_VT_FILETIME() #include "SafeArray.au3" Func Example_VariantTypes1() Local $tVar = DllStructCreate($tagVARIANT) ; Test VT_DATE _VariantSet(DllStructGetPtr($tVar), "2025/08/03 12:34:56", $VT_DATE) ConsoleWrite("VT_DATE: " & _VariantRead(DllStructGetPtr($tVar)) & @CRLF) ; Devrait afficher 2025/08/03 12:34:56 ; Test VT_IDISPATCH Local $oObj = ObjCreate("Scripting.Dictionary") _VariantSet(DllStructGetPtr($tVar), $oObj, $VT_DISPATCH) Local $oRead = _VariantRead(DllStructGetPtr($tVar)) ConsoleWrite("VT_IDISPATCH IsObj: " & IsObj($oRead) & @CRLF) _VariantClear(DllStructGetPtr($tVar)) EndFunc ;==>Example_VariantTypes1 Example_VariantTypes1() #include "SafeArray.au3" #include<WinAPICom.au3> Func _VariantTypes() Local $tVar = DllStructCreate($tagVARIANT) ; Test VT_DATE _VariantSet(DllStructGetPtr($tVar), "2025/08/03 12:34:56", $VT_DATE) ConsoleWrite("VT_DATE: " & _VariantRead(DllStructGetPtr($tVar)) & @CRLF) ; Devrait afficher 2025/08/03 12:34:56 ;VT_CLSID Local $oGUID = _WinAPI_CreateGUID() _VariantSet(DllStructGetPtr($tVar), $oGUID, $VT_CLSID) Local $oGUIDRead = _VariantRead(DllStructGetPtr($tVar)) ConsoleWrite("VT_CLSID : " & $oGUIDRead & @CRLF) _VariantClear(DllStructGetPtr($tVar)) EndFunc ;==>Example_VariantTypes _VariantTypes() SafeArray.zip SafeArray.au31 point
-
au3Stripper help and SingleInstance help
argumentum reacted to sl23 for a topic
As there is an option to not show the tray icon, I amended the message to say Check the tray or Task Manager. Started off about au3 stripper though But I'll amend it to cover both!1 point -
AutoIt error getting current time?
Trong reacted to argumentum for a topic
I opened a trac ticket to fix it.1 point -
Getting Mouse actions to play nice with result of ImageSearch
argumentum reacted to Somerset for a topic
Uninstalls everything on @argumentum's computer to find that damnable icon.1 point -
User Interface Builder Overview Use this tool to visually design Windows applications with a focus on Metro windows, standard windows, and Tool windows. This is for users who want a faster and simpler development tool. Drag-and-drop GUI creation, code generation, and easy control alignment tools. No more clicking through property sheets to set variable names, sizes, and the control’s text. Please replace "MetroUDF-Required\SSCtrlHover.au3" within the metro UDF files to see more meaningful messages in the console. The following line was inserted into the function. This prevents crashing on syntax and logical errors while Metro buttons are in use. Func _cHvr_Register($idCtrl, $fnHovOff = '', $fnHoverOn = '', $fnClick = '', $fnDblClk = '', $HoverData = 0,$ClickData = 0,$fnRightClick = '') If $BLOCK_HOVER_REGISTRATION Then Return Unfortunately, the following will have to added to your scripts if you already use Metro UDF and you replace "SSCtrlHover.au3". Global $BLOCK_HOVER_REGISTRATION = False #include "MetroGUI_UDF.au3" #include "MetroGUI_UDF_xpk.au3" #include "_GUIDisable.au3" ; For dim effects when msgbox is displayed Features Metro Controls for all window types WYSIWYG real-time preview Generates AutoIt GUI and message loop code Multiple control selection and manipulation Make additional selections with the CTRL key Accelerated control movements with the SHIFT key Change controls position with mouse or arrow keys Double click a control to precisely set its size and text Save/load GUI layouts and Control layouts to files Custom styles/themes and Controls using Metro Snap-to-guide, and toolbar alignment aids Drag down guides from the top and left sides of the Designer window Copy-n-paste between different window types Technical Details .Gui/.Ctrls file is a simple delimited text file Copy-n-paste is a similar file without the window specifications The application is meant to be portable, so it is one file The only Custom UDFs in use is Metro 5.1, and my Metro Expansion pack The script uses Label controls for everything. No GDI was used. Every control handle is saved in an array Maps are used in Metro and in future UDFs containing new controls You need Metro 5.1 UDF Limitations and known issues Resizing the Metro window with the mouse is flaky Changing control and window styles is not implemented Window size cannot be changed precisely Undo functionality might cause problems with code generation No Redo implemented Thank you BB19 and everyone that contributed to Metro UDF. MetroGUI_UDF_xpk.au3 SSCtrlHover.au3 UserInterfaceBuilder.au31 point
-
User Interface Builder - GUI Designer
argumentum reacted to 0xC0FFEE for a topic
Added a theme picker for Metro windows. I changed $BLOCK_HOVER_REGISTRATION back to False so it would draw the controls with the correct colors. Please change it back to True if you are having trouble starting the application. Global $BLOCK_HOVER_REGISTRATION = False #include "MetroGUI_UDF.au3" #include "MetroGUI_UDF_xpk.au3" #include "_GUIDisable.au3" ; For dim effects when msgbox is displayed1 point -
🕑 Analog Clock
argumentum reacted to ioa747 for a topic
New release 0.11 Basic changes • Now the clock is updated with a timer and not in the main loop, or with AdlibRegister, so that it does not freeze with the tray menu or the settings GUIs • The movement of the hands is done in an analog manner and does not jump from minute to minute or hour to hour. • Now moving the clock can also be done with a long press on the center of the clock. • You don't need an additional image because it does it by itself, but it can also accept an external image. • I put a settings GUI for selecting clock colors. (if the changes concern the background image, they will be applied after deleting the background image) • Ability to change the size of the clock, through the ini file I made it Swiss update in the first post Please, every comment is appreciated! leave your comments and experiences here! Thank you very much1 point -
interesting accident
Parsix reacted to pixelsearch for a topic
Maybe this explanation ? 1) Button when no style is indicated at creation (-1) , WS_TABSTOP will be forced (help file) Button style becomes 0x50010000 WS_CHILD, WS_VISIBLE, WS_TABSTOP [0x40000000, 'WS_CHILD'] [0x10000000, 'WS_VISIBLE'] [0x00010000, 'WS_TABSTOP'] 2) Button created with 0xFF0000 style Button style becomes 0x50FF0000 WS_CHILD, WS_VISIBLE, WS_OVERLAPPEDWINDOW, WS_VSCROLL, WS_HSCROLL [0x40000000, 'WS_CHILD'] [0x10000000, 'WS_VISIBLE'] [0x00CF0000, 'WS_OVERLAPPEDWINDOW'] [0x00200000, 'WS_VSCROLL'] [0x00100000, 'WS_HSCROLL'] 'WS_OVERLAPPEDWINDOW' means (WS_CAPTION | WS_SYSMENU | WS_SIZEBOX | WS_MINIMIZEBOX | WS_MAXIMIZEBOX)1 point