AutoHotkey Community

It is currently May 27th, 2012, 11:48 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: July 12th, 2010, 7:05 am 
Offline

Joined: March 9th, 2007, 2:47 am
Posts: 509
Location: Unknown
How can I change the size of the header of a ListView control? I need to do this because I am making the font of the GUI very large and in Windows XP it does not adjust the size of the header (it does in Windows 7).
Thanks!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 13th, 2010, 5:53 pm 
Offline

Joined: October 7th, 2006, 4:50 pm
Posts: 3157
Location: MN, USA
Googling reveals this is a known bug in WinXP when themes are enabled. You can verify this by switching a WinXP box to classic theme and then enlarging a ListView (works fine).

So... the obvious workaround is to turn off the theme for your ListView (at least temporarily) however, AHK does not turn off the theme for the header control in that case. Here you can see the ListView loses its theme, but not its header control.
Code:
Gui, -Theme
Gui, Add, ListView, r10, Column1
Loop, *.*
 LV_Add("",A_LoopFileName)

Gui, Show
return
GuiClose:
 ExitApp


So... the remaining problem is to discover how to disable (and then re-enable) the theme of a control after it has been created. You will probably need the header's hWnd for this, which can be retrieved with a simple message.
Code:
Gui, Add, ListView, r10 vLV HWNDhLV, Column1
Loop, *.*
 LV_Add("",A_LoopFileName)
Gui, Add, Edit, vEdit Number, 100
Gui, Add, Button, x+10 Default, Resize

SendMessage, 0x101F,,,,ahk_id %hLV%  ;LVM_GETHEADER
hWnd := ErrorLevel

Gui, Show
return
GuiClose:
 ExitApp

ButtonResize:
 Gui, Submit, NoHide
 ControlMove,,,,,%Edit%, ahk_id %hWnd%
 GuiControl, MoveDraw, LV
return

I got as far as Header Control Styles, which seems like a dead end. :?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 13th, 2010, 6:20 pm 
Offline

Joined: March 9th, 2007, 2:47 am
Posts: 509
Location: Unknown
And jaco0646 saves the day! If I get it working I will post it here.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 13th, 2010, 7:19 pm 
Offline

Joined: March 9th, 2007, 2:47 am
Posts: 509
Location: Unknown
It is isn't the best way to do it, but I think I will just set the height of the header manually and add a few blank rows so it doesn't cover any data.
I can't thank you enough for all the help!


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey, MSN [Bot] and 16 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group