SetWindowTheme

SetWindowTheme

Postby AntoninoP » Wed Jun 10, 2015 8: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: Select all  Expand view
#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:
Image
AntoninoP
 
Posts: 375
Joined: Tue Feb 10, 2015 9:48 am
Location: Albenga, Italy

Re: SetWindowTheme

Postby Silvio.Falconi » Wed Jun 10, 2015 9:50 am

nice very nice
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 6768
Joined: Thu Oct 18, 2012 7:17 pm

Re: SetWindowTheme

Postby Antonio Linares » 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
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: SetWindowTheme

Postby Antonio Linares » 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
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: SetWindowTheme

Postby Antonio Linares » Wed Jun 10, 2015 12:40 pm

I have included this new test in next FWH:

themes.prg
Code: Select all  Expand view
#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
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: SetWindowTheme

Postby Silvio.Falconi » Wed Jun 10, 2015 2: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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 6768
Joined: Thu Oct 18, 2012 7:17 pm

Re: SetWindowTheme

Postby Antonio Linares » Wed Jun 10, 2015 4: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
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: SetWindowTheme

Postby AntoninoP » Wed Jun 10, 2015 4: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
AntoninoP
 
Posts: 375
Joined: Tue Feb 10, 2015 9:48 am
Location: Albenga, Italy

Re: SetWindowTheme

Postby Antonio Linares » Wed Jun 10, 2015 4:43 pm

You are right, sorry :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: SetWindowTheme

Postby Silvio.Falconi » 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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 6768
Joined: Thu Oct 18, 2012 7:17 pm

Re: SetWindowTheme

Postby AntoninoP » Thu Jun 11, 2015 4:57 pm

Hello,
Please don't talk about TExplorerBar http://forums.fivetechsupport.com/viewtopic.php?f=3&t=30258&start=0 :shock:
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
AntoninoP
 
Posts: 375
Joined: Tue Feb 10, 2015 9:48 am
Location: Albenga, Italy

Re: SetWindowTheme

Postby Silvio.Falconi » Fri Jun 12, 2015 8: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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 6768
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Jimmy and 60 guests

cron