Jump to content

ahmet

Active Members
  • Posts

    281
  • Joined

  • Last visited

  • Days Won

    1

ahmet last won the day on May 6 2012

ahmet had the most liked content!

About ahmet

  • Birthday 08/18/1992

Profile Information

  • Location
    Bosnia and Herzegovina

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

ahmet's Achievements

  1. 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 ;==>_drawUAHMenuNCBottomLine
  2. That line needs to be redrawn even on restore from minimize state. Once you find out when an update is neccessary you draw the line again.
  3. 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
  4. What is FF when converted to decimal? You have minimum of zero in hexadecimal that matches 0 in dec. You also have FF in hexadecimal that matches to what in decimal? Then map (0,100) in decimal to (0,FF) afte you have converted it to decimal.
  5. Can you share the code that works where you set text color of an edit box inside AutoIt's GUI?
  6. Can you try creating an edit box within your GUI? Then try to apply those functions to your edit box.
  7. What about sqlite database? You can have table names with prefixes or sufixes, ie. Calcultor_perApp, Class1_perClass, OtherClass_perClass. You can embed needed dll into script and load it from memory without writing to disk anything if the licence permits it.
  8. Hi, I have no experinece with virtaul desktops but it is advisable to post runnable code. That way somenone trying to help you has to do a lot less work.
  9. What happens if you use windows title? Show the code you are using. It might be easier someone to help you that way. If you copy handle from AutoIt info tool are you able to get any data for window?
  10. Here are my results on Win 10.
  11. What about Subrogation? You can embed your dll file in your include script and load it from memory?
  12. Then most probably solution from @Dan_555 will work for you.
  13. Hi, do you need something like following #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> Example() Func Example() Global $sPreviousSelection="";new variable that holds info about last selection ; Create a GUI with various controls. Local $hGUI = GUICreate("Example", 300, 200) ; Create a combobox control. Local $idComboBox = GUICtrlCreateCombo("Item 1", 10, 10, 185, 20) Local $idButton_Close = GUICtrlCreateButton("Close", 210, 170, 85, 25) ; Add additional items to the combobox. GUICtrlSetData($idComboBox, "Item 2|Item 3", "Item 2") ; Display the GUI. GUISetState(@SW_SHOW, $hGUI) Local $sComboRead = "" ; Loop until the user exits. $sPreviousSelection=GUICtrlRead($idComboBox);update variable with the currently selected item While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $idButton_Close ExitLoop Case $idComboBox $sComboRead = GUICtrlRead($idComboBox) ;MsgBox($MB_SYSTEMMODAL, "", "The combobox is currently displaying: " & $sComboRead, 0, $hGUI) If $sComboRead<>$sPreviousSelection Then MsgBox(0,"Combobox","Selection changed") $sPreviousSelection=$sComboRead EndIf EndSwitch WEnd ; Delete the previous GUI and all controls. GUIDelete($hGUI) EndFunc ;==>Example When you ask for help it would be good to post runnable code.
  14. There is GUICtrlSetState function.
×
×
  • Create New...