Here is initial version. Coordinates are wrong. I need to do other things now.
#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)
GuiDarkmodeApply($hGUI)
GUISetState(@SW_SHOW)
$aMenuBarInfo = _GUICtrlMenu_GetMenuBarInfo($hGUI, 0, 1)
_ArrayDisplay($aMenuBarInfo)
$rcClient = _WinAPI_GetClientRect($hGUI)
_WinAPI_DisplayStruct($rcClient, $tagRECT,"rcClinet before")
;CHAT GPT
Local $aCall = DllCall("user32.dll", "int", "MapWindowPoints", _
"hwnd", $hGUI, _ ; 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($hGUI)
_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")
$hDC = _WinAPI_GetDC($hGUI)
$hSolidBrush=_WinAPI_CreateBrushIndirect($BS_SOLID, 0xFF00FF)
_WinAPI_FillRect($hDC, $rcAnnoyingLine, $hSolidBrush)
_WinAPI_ReleaseDC($hGUI, $hDC)
_WinAPI_DisplayStruct($rcAnnoyingLine, $tagRECT,"annoying line")
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