I recently discovered that you can use some of Windows' own classes for things to get your own guis to look more like windows explorer windows:
Code: Select all
SetWindowTheme(hListView, "ItemsView") ;or "Explorer"
;...
SetWindowTheme(hwnd, str) {
Return DllCall("uxtheme\SetWindowTheme", "Uint", hwnd, "Str", str, "Ptr", 0)
}
I found a thread about it:
https://groups.google.com/forum/#!topic ... Kg3t1GNiLo
that says to use class named "ItemsView" and draw the rectangle with DrawThemeBackground (on part id 3 and state id 1 or 2). I'm trying to make sense of this (and get DrawThemeBackground working to draw a uxThemed button, but thats another issue) and i think i have to OnMessage WM_NCPAINT and do the drawing there, but i'm in over my head.
If anyone has any tips or insight it would be greatly appreciated
Code: Select all
WM_NCPAINT( wP, lP, msg, hwnd ) { ;not working attempt
hDC := DllCall("GetDC", "UInt", hwnd)
hTheme := DllCall("UxTheme.dll\OpenThemeData", uInt, hwnd, Str, "ItemsView" )
if(hTheme)
{
VarSetCapacity(pRect, 16, 0) ;replace with getRect...
NumPut(0, pRect, 0, "Int")
NumPut(0, pRect, 4, "Int")
NumPut(100, pRect, 8, "Int")
NumPut(100, pRect, 12, "Int")
DllRet := DllCall("UxTheme.dll\DrawThemeBackground", Ptr, hTheme, Ptr, hDC, uInt, PartID:=3, uInt, StateID:=1 , Ptr, pRect, Ptr, 0, uInt)
}
DllCall("ReleaseDC", "UInt", hwnd, "UInt", hDC)
Return
}
Normal:
The focus rectangle I want:
The focus rectangle I get: