Windows 8 Gui MonthCal
- PuzzledGreatly
- Posts: 1303
- Joined: 29 Sep 2013, 22:18
Windows 8 Gui MonthCal
On Windows 7 if I set the font size before adding a Calendar the size of the calendar matches the font. This doesn't seem to be the case with Windows 8. My Calendar is turning up at the default font size which is tiny. Can anyone confirm this problem. Is there a solution? It doesn't seem easy to get an AHK GUI to show up at the same relative size on different computers. Thanks.
Re: Windows 8 Gui MonthCal
hmm, i dont know.. i dont use win8, but some code or screenshots.. would be nice & helpful ![Wink ;)](./images/smilies/icon_e_wink.gif)
![Wink ;)](./images/smilies/icon_e_wink.gif)
![Image](https://joedf.github.io/assets/img/user/ahkneedhelp.gif)
![Image](https://joedf.github.io/assets/img/user/ahkfoundation.gif)
![Image](https://joedf.github.io/assets/img/user/mitlicense.gif)
![Image](https://joedf.github.io/assets/img/user/+greenpeace.gif)
![Image](https://joedf.github.io/assets/img/user/githubahkscript.gif)
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
- PuzzledGreatly
- Posts: 1303
- Joined: 29 Sep 2013, 22:18
Re: Windows 8 Gui MonthCal
Thanks for the reply, I forgot I can post images to this forum. Here's some code for the GUI, followed by a rough screenshot showing the difference between Windows 7 (left) and Windows 8 (right:
Code: Select all
Gui, 2:-Caption ToolWindow
Gui, 2:margin, 25,25
Gui, 2:Color, 20A2DA
Gui, 2:font, s20 bold, Humnst777 BlkCn BT Black ; Gui, 1:font, s19 bold c141E78, Humnst777 BlkCn BT Black
Gui, 2:Add, Picture, x0 y0 w630 h390, pics\cBord2.png
Gui, 2:Add, MonthCal, x25 y25 vDate
Gui, 2:font, s20 bold, Humnst777 BlkCn BT Black
Gui, 2:margin, 0,0
Gui, 2:add, text, x+25, Minutes:
Gui, 2:font, s45 bold, Humnst777 BlkCn BT Black ; Gui, 1:font, s19 bold c141E78, Humnst777 BlkCn BT Black
Gui, 2:add, edit, y+5 w125 vMinutes +Number +Right
Gui, 2:font, s20 bold, Humnst777 BlkCn BT Black
Gui, 2:add, text, y+15, Calories:
Gui, 2:font, s45 bold, Humnst777 BlkCn BT Black ; Gui, 1:font, s19 bold c141E78, Humnst777 BlkCn BT Black
Gui, 2:add, edit, y+5 w125 vCalories +Number +Right
Gui, 2:font, s25 bold, Humnst777 BlkCn BT Black ; Gui, 1:font, s19 bold c141E78, Humnst777 BlkCn BT Black
Gui, 2:add, Button, y+15 w125 gTime, OK
Gui, 2:font, s16 bold cWhite, Humnst777 BlkCn BT Black ; Gui, 1:font, s19 bold c141E78, Humnst777 BlkCn BT Black
Gui, 2:margin, 25,25
Re: Windows 8 Gui MonthCal
I'm using windows 7 pro and the font isn't being applied to the calendar (ie looks like the picture on the right).
- PuzzledGreatly
- Posts: 1303
- Joined: 29 Sep 2013, 22:18
Re: Windows 8 Gui MonthCal
Perhaps it has something to do with the theme? I'm using Windows Classic on my Windows 7 and I don't know what on Windows 8 but not Windows Classic. Are you using an Aero theme? How to set the size for a MonthCal control so that the size can be set regardless of which PC is being used?
Re: Windows 8 Gui MonthCal
Interestingly, MS added the MCM_SIZERECTTOMIN message with Win Vista. It seems to calculate the width and height needed to show one month in a non-themed MonthCal control using the specified font. At least it's somewhat working on Win 7 x64 for me:
Code: Select all
#NoEnv
; ======================================================================================================================
; Win Vista+
; Calculate the size of a non-themed MonthCal using a specified font
; MCM_SIZERECTTOMIN = 0x101D -> http://msdn.microsoft.com/en-us/library/bb761020(v=vs.85).aspx
Gui, MC:font, s20 bold, Arial
Gui, MC:Add, MonthCal, x25 y25 w-2 vDate -Theme hwndHMC
VarSetCapacity(RECT, 16, 0)
SendMessage, 0x101D, 0, &RECT, , ahk_id %HMC% ; MCM_SIZERECTTOMIN
MCWidth := NumGet(RECT, 8, "Int")
MCHeight := NumGet(RECT, 12, "Int")
Gui, MC:Destroy
; ======================================================================================================================
Gui, 2:-Caption ToolWindow
Gui, 2:margin, 25,25
Gui, 2:Color, 20A2DA
Gui, 2:font, s20 bold, Arial
Gui, 2:Add, Picture, x0 y0 w630 h390, pics\cBord2.png
Gui, 2:Add, MonthCal, x25 y25 w%MCWidth% h%MCHeight% vDate -Theme
Gui, 2:font, s20 bold, Arial
Gui, 2:margin, 0,0
Gui, 2:add, text, x+25, Minutes:
Gui, 2:font, s45 bold, Arial
Gui, 2:add, edit, y+5 w125 vMinutes +Number +Right
Gui, 2:font, s20 bold, Arial
Gui, 2:add, text, y+15, Calories:
Gui, 2:font, s45 bold, Arial
Gui, 2:add, edit, y+5 w125 vCalories +Number +Right
Gui, 2:font, s25 bold, Arial
Gui, 2:add, Button, y+15 w125 gTime, OK
Gui, 2:font, s16 bold cWhite, Arial
Gui, 2:margin, 25,25
Gui, 2:Show
Return
Esc::
Time:
ExitApp
Who is online
Users browsing this forum: DecimalTurn, Google [Bot], macromint, peter_ahk and 350 guests