Where is the code of this function?
I don't found it in fwh\source, and It does not works as expected.
In this code:
- Code: Select all Expand view RUN
- #include 'fivewin.ch'
function main()
local oDlg, data := cToD( " / / " ), oPK, nVal := 0, cVal := Replicate(" ",100), oGetN, oTC, oI
DEFINE WINDOW oDlg FROM 0,0 TO 500,400 PIXEL TITLE "Test"
@ 1,1 TREEVIEW oTC
oI := oTC:Add("first")
oI:Add("test 1")
oI:Add("test 2")
oI:Add("test 3")
oI := oTC:Add("second")
oI:Add("test 4")
oI:Add("test 5")
oI:Add("test 6")
SetWindowTheme( oTC:hWnd, AnsiToWide( "Explorer" ), AnsiToWide( "" ) )
@ 1,30 TREEVIEW oTC BORDER
oI := oTC:Add("first")
oI:Add("test 1")
oI:Add("test 2")
oI:Add("test 3")
oI := oTC:Add("second")
oI:Add("test 4")
oI:Add("test 5")
oI:Add("test 6")
SetWindowTheme_MY(oTC:hWnd,"Explorer")
ACTIVATE DIALOG oDlg CENTERED
return nil
#pragma BEGINDUMP
#include <Windows.h>
#include <hbapi.h>
#include <Uxtheme.h>
LPWSTR AnsiToWide( LPSTR cAnsi );
HB_FUNC( SETWINDOWTHEME_MY )
{
typedef HRESULT ( FAR PASCAL *LPSETWINDOWTHEMEDATA )( HWND hwnd, LPCWSTR, LPCWSTR);
HRESULT hRes = 3;
HINSTANCE hLib;
LPSETWINDOWTHEMEDATA SetWindowTheme;
LPWSTR pW2, pW3;
#ifdef _WIN64
HWND hWnd = ( HWND ) hb_parnll( 1 );
#else
HWND hWnd = ( HWND ) hb_parnl( 1 );
#endif
if( IsWindow( hWnd ) )
{
hLib = LoadLibrary( "uxtheme.dll" );
if ( hLib )
{
pW2 = HB_ISCHAR( 2 ) ? AnsiToWide(( char * ) hb_parc( 2 )) : NULL;
pW3 = HB_ISCHAR( 3 ) ? AnsiToWide(( char * ) hb_parc( 3 )) : NULL;
SetWindowTheme = (LPSETWINDOWTHEMEDATA) GetProcAddress( hLib, "SetWindowTheme" );
hRes = SetWindowTheme ( hWnd, pW2, pW3 );
if(pW2) hb_xfree( pW2 );
if(pW3) hb_xfree( pW3 );
FreeLibrary( hLib );
}
}
hb_retnl(hRes);
}
#pragma ENDDUMP
I have only the my one with the correct theme: