kid sinister Posted February 2, 2009 Posted February 2, 2009 (edited) Could someone else running Windows Vista please confirm the help file example for _GUICtrlMonthCal_SetColor does not in face change the calendar's background color? I'm thinking it might be Vista related because I ran the same code in a VM of Windows XP, and it changed the color just fine... here's the help file example for the lazy: expandcollapse popup#AutoIt3Wrapper_au3check_parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 #include <GuiConstantsEx.au3> #include <GuiMonthCal.au3> #include <WindowsConstants.au3> #include <Constants.au3> Opt('MustDeclareVars', 1) $Debug_MC = False; Check ClassName being passed to MonthCal functions, set to True and use a handle to another control to see it work Global $iMemo _Main() Func _Main() Local $hMonthCal ; Create GUI GUICreate("Month Calendar Set Color", 400, 300) $hMonthCal = GUICtrlCreateMonthCal("", 4, 4, -1, -1, $WS_BORDER, 0x00000000) ; Create memo control $iMemo = GUICtrlCreateEdit("", 4, 168, 392, 128, 0) GUICtrlSetFont($iMemo, 9, 400, 0, "Courier New") GUISetState() ; Get/Set calendar color MemoWrite("Background: 0x" & Hex(_GUICtrlMonthCal_GetColor($hMonthCal, $MCSC_MONTHBK), 6)) _GUICtrlMonthCal_SetColor($hMonthCal, $MCSC_MONTHBK, $CLR_MONEYGREEN) MemoWrite("Background: 0x" & Hex(_GUICtrlMonthCal_GetColor($hMonthCal, $MCSC_MONTHBK), 6)) ; Loop until user exits Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc;==>_Main ; Write message to memo Func MemoWrite($sMessage) GUICtrlSetData($iMemo, $sMessage & @CRLF, 1) EndFunc;==>MemoWrite Edited February 2, 2009 by kid sinister
GaryFrost Posted February 2, 2009 Posted February 2, 2009 (edited) expandcollapse popup#include <GuiConstantsEx.au3> #include <GuiMonthCal.au3> #include <WindowsConstants.au3> #include <Constants.au3> Opt('MustDeclareVars', 1) $Debug_MC = False; Check ClassName being passed to MonthCal functions, set to True and use a handle to another control to see it work _ThemeLevel(1) Global $iMemo _Main() Func _Main() Local $hMonthCal ; Create GUI GUICreate("Month Calendar Set Color", 400, 300) $hMonthCal = GUICtrlCreateMonthCal("", 4, 4, -1, -1, $WS_BORDER, 0x00000000) ; Create memo control $iMemo = GUICtrlCreateEdit("", 4, 168, 392, 128, 0) GUICtrlSetFont($iMemo, 9, 400, 0, "Courier New") GUISetState() ; Get/Set calendar color MemoWrite("Background: 0x" & Hex(_GUICtrlMonthCal_GetColor($hMonthCal, $MCSC_MONTHBK), 6)) _GUICtrlMonthCal_SetColor($hMonthCal, $MCSC_MONTHBK, $CLR_MONEYGREEN) MemoWrite("Background: 0x" & Hex(_GUICtrlMonthCal_GetColor($hMonthCal, $MCSC_MONTHBK), 6)) ; Loop until user exits Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>_Main ; Write message to memo Func MemoWrite($sMessage) GUICtrlSetData($iMemo, $sMessage & @CRLF, 1) EndFunc ;==>MemoWrite ; Functionality : ; just info about possibility to turn off theme-using in scripts/compiled-exe with using GUI stuff ; This info was produced by Holger Func _ThemeLevel($nFlag = 0) ; $nFlag = 0 ; Visual styles are completely disabled in the running script ; $nFlag = 1; Nonclient areas of the GUI can use visual styles ; $nFlag = 2; Controls can use visual styles (like Buttons, Progressbar, Group-ctrl's, etc.) ; $nFlag = 4; Web content displayed ??? (info from MSDN) can use visual styles ; ; These flags can be combined with BitOr(...) DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", $nFlag) EndFunc ;==>_ThemeLevel Edited February 2, 2009 by GaryFrost abberration 1 SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
KaFu Posted February 2, 2009 Posted February 2, 2009 Will come in handy, thanks for the info ... OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2025-May-18) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now