FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour SetWindowTheme
Posts: 375
Joined: Tue Feb 10, 2015 09:48 AM
SetWindowTheme
Posted: Wed Jun 10, 2015 08:34 AM
Hello,
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 (fw): Select all Collapse
#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:
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM
Re: SetWindowTheme
Posted: Wed Jun 10, 2015 09:50 AM

nice very nice

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: SetWindowTheme
Posted: Wed Jun 10, 2015 12:17 PM

Antonino,

You are totally right, our code was wrong.

Your code is a very good one, many thanks :-)

Included for the next build

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: SetWindowTheme
Posted: Wed Jun 10, 2015 12:18 PM

We don't provide several sources of FWH to avoid that the libraries can be completely rebuilt, so original FWH libs are required.

Anyhow if you need some sopecific module, you can ask us and we will provide it to you.

thanks

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: SetWindowTheme
Posted: Wed Jun 10, 2015 12:40 PM
I have included this new test in next FWH:

themes.prg
Code (fw): Select all Collapse
#include 'fivewin.ch'

function main()

   local oDlg, oTC1, oTC2

   DEFINE DIALOG oDlg FROM  0,0 TO 500,400 PIXEL TITLE "Test"
      
   @ 1,  2 TREEVIEW oTC1 SIZE 70, 100
   
   @ 1, 16 TREEVIEW oTC2 SIZE 70, 100
   
   ACTIVATE DIALOG oDlg CENTERED ;
      ON INIT FillTrees( oTC1, oTC2 )   

return nil

function FillTrees( oTC1, oTC2 )

   local oItem

   oItem := oTC1:Add( "first" )
   oItem:Add( "test 1" )
   oItem:Add( "test 2" )
   oItem:Add( "test 3" )
   oItem := oTC1:Add("second")
   oItem:Add( "test 4" )
   oItem:Add( "test 5" )
   oItem:Add( "test 6" )
   SetWindowTheme( oTC1:hWnd, "Explorer" )

   oItem := oTC2:Add( "first" )
   oItem:Add( "test 1" )
   oItem:Add( "test 2" )
   oItem:Add( "test 3" )
   oItem := oTC2:Add( "second" )
   oItem:Add( "test 4" )
   oItem:Add( "test 5" )
   oItem:Add( "test 6" )
   SetWindowTheme( oTC2:hWnd, "Explorer" )  

return nil
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM
Re: SetWindowTheme
Posted: Wed Jun 10, 2015 02:26 PM

Dear antonino
can you write me on private mail I wish ask you a tecnical question
silvio[dot]falconi[at]gmail[dot]com

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: SetWindowTheme
Posted: Wed Jun 10, 2015 04:17 PM

Dear Silvio,

I prefer if you post here your technical questions, its easier and I don't get my email account filled with
tech questions :-)

thanks!

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 375
Joined: Tue Feb 10, 2015 09:48 AM
Re: SetWindowTheme
Posted: Wed Jun 10, 2015 04:29 PM
Antonio: I think he is talking with me :-)
Silvio: do you see this http://forums.fivetechsupport.com/viewtopic.php?f=22&t=30403#p177672 ?

Antonino
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: SetWindowTheme
Posted: Wed Jun 10, 2015 04:43 PM

You are right, sorry :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM
Re: SetWindowTheme
Posted: Thu Jun 11, 2015 10:50 AM

Antonio,
do you remember I Trying some years ago to make a listbox with checkboxes array ?
now it is possible... thanks to AntoninoP

and then ....

your Fivetech Explorerbar class can be changed

C5_OpenThemeData(::hWnd, "EXPLORERBAR")

define EBP_NORMALGROUPBACKGROUND 5

define EBP_NORMALGROUPCOLLAPSE 6

define EBP_NORMALGROUPEXPAND 7

define EBP_NORMALGROUPHEAD 8

define EBP_SPECIALGROUPBACKGROUND 9

define EBP_SPECIALGROUPCOLLAPSE 10

define EBP_SPECIALGROUPEXPAND 11

define EBP_SPECIALGROUPHEAD 12

I think we can change also the speed to open the explorerbar but I not found the value

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 375
Joined: Tue Feb 10, 2015 09:48 AM
Re: SetWindowTheme
Posted: Thu Jun 11, 2015 04:57 PM
Hello,
Please don't talk about TExplorerBar http://forums.fivetechsupport.com/viewtopic.php?f=3&t=30258&start=0 :-)
The FWV version copies the WindowsXP theme Luna, but in XP there is a lot of themes, and the others?
look at http://www.vbaccelerator.com/home/VB/Code/Controls/Explorer_Bar_Control/article.asp
or http://www.codeproject.com/Articles/7247/Themed-Windows-XP-style-Explorer-Bar
But, I want to know, where is used the explorer bar in windows 7?
In our program substituted the explorer bar with tool windows.
Antonino
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM
Re: SetWindowTheme
Posted: Fri Jun 12, 2015 08:43 AM

Yes I nee the style for windows seven
tool window ?
and how ?

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com

Continue the discussion