View previous topic :: View next topic |
Author |
Message |
awans
Joined: 25 Dec 2007 Posts: 3
|
Posted: Tue Dec 25, 2007 7:46 pm Post subject: Explorer-style ListView |
|
|
I'm trying to make an "explorer style" listview in a DFL app. So the underlying win32 method I need to call is "SetWindowTheme" in uxtheme.dll. While the DFL internal.winapi file has "GetWindowTheme," the other is absent.
Any guidance on how I might be able to either access the uxtheme dll directly/have the function added to the DFL winapi? |
|
Back to top |
|
|
awans
Joined: 25 Dec 2007 Posts: 3
|
Posted: Tue Dec 25, 2007 11:06 pm Post subject: |
|
|
Never mind -- the function is already in the newest snapshot! |
|
Back to top |
|
|
awans
Joined: 25 Dec 2007 Posts: 3
|
Posted: Wed Dec 26, 2007 2:51 pm Post subject: |
|
|
Just thought I'd post my code in case anyone else is trying to build one:
Code: |
class ListViewEx : ListView
{
protected override void onHandleCreated(EventArgs ea)
{
super.onHandleCreated(ea);
DWORD LVS_EX_DOUBLEBUFFER = 0x00010000;
Message m = Message(handle, LVM_SETEXTENDEDLISTVIEWSTYLE,
cast(WPARAM) LVS_EX_DOUBLEBUFFER,
cast(LPARAM) LVS_EX_DOUBLEBUFFER);
prevWndProc(m);
HMODULE hmuxt;
hmuxt = GetModuleHandleA("uxtheme.dll");
if(hmuxt)
{
auto setWinTheme = cast(typeof(&SetWindowTheme))
GetProcAddress(hmuxt, "SetWindowTheme");
assert(setWinTheme);
setWinTheme(handle, "Explorer"w.ptr, null);
}
}
}
|
|
|
Back to top |
|
|
jicman
Joined: 22 Dec 2004 Posts: 298 Location: Rochester, NY
|
Posted: Thu Jan 03, 2008 1:33 pm Post subject: |
|
|
Thanks. Just save me 4 hours of reading materials. .-)
jose |
|
Back to top |
|
|
|