Does someone know how to change the title bar of a windows application using the SetSysColors of Lib "user32". I'm using XP.
Thanks in advance
Otto
Does someone know how to change the title bar of a windows application using the SetSysColors of Lib "user32". I'm using XP.
Thanks in advance
Otto
#INCLUDE "FiveWin.ch"
#define COLOR_ACTIVECAPTION 2
STATIC odlg
//-------------------------------------------------------------//
FUNCTION Main()
// local oDlg
DEFINE DIALOG oDlg FROM 6, 6 TO 20, 60 TITLE "Hide and Show Taskbar"
@ 2, 2 BUTTON "&Hide" OF oDlg ;
ACTION task_bar_on(.f.)
@ 4, 2 BUTTON "&Show" OF oDlg ;
ACTION task_bar_on(.t.)
@ 4, 12 BUTTON "&Show" OF oDlg ;
ACTION msginfo(GetSysColor(COLOR_ACTIVECAPTION)) //returns ---> 13743257
ACTIVATE DIALOG oDlg ;
VALID MsgYesNo( "Want to end ?" )
return(NIL)
function task_bar_on(ison)
local hwnd
hwnd= FindWndByClass("Shell_TrayWnd", "")
SetSysColors(1,COLOR_ACTIVECAPTION, 13743257 )
//SetSysColors(1,COLOR_ACTIVECAPTION, nRGB( 219, 230, 244 ) )
If ison
ShowWindow(hwnd,5)
Else
ShowWindow(hwnd,0)
End If
return(NIL)
DLL32 Function ShowWindow(hwnd as LONG, nCmdShow as LONG) AS LONG ;
PASCAL FROM "ShowWindow" Lib "user32.dll"
DLL32 Function FindWndByClass(wndClass AS LPSTR,WndName as LPSTR) AS LONG ;
PASCAL FROM "FindWindowA" LIB "user32.dll"
DLL32 Function SetSysColors ( nChanges As LONG, lpSysColor As LONG, lpColorValues As LONG) As Long;
PASCAL FROM "SetSysColors" Lib "user32"DLL32 Function SetSysColors ( nChanges As LONG, lpSysColor As LONG, lpColorValues As LONG) As LONG ;
PASCAL FROM "SetSysColors" Lib "user32"Hello Antonio,
thank you.
I read somewhere that if XP Themes is on the caption is a bitmap?
I don't know it I understood this well nor what to do.
Best regards,
Otto
I am testing it in W7 and it properly hides the taskbar, but I don't see any color change
#include 'fivewin.ch'
function Main()
msginfo( 'start' )
clrtest( CLR_YELLOW, CLR_HRED )
msginfo( 'done' )
return nil
#pragma BEGINDUMP
#include <hbapi.h>
#include <windows.h>
HB_FUNC( CLRTEST )
{
int aElements[2] = { COLOR_CAPTIONTEXT, COLOR_ACTIVECAPTION };
DWORD aColors[2];
aColors[ 0 ] = hb_parnl( 1 );
aColors[ 1 ] = hb_parnl( 2 );
SetSysColors( 2, aElements, aColors );
}
//----------------------------------------------------------------------------//
#pragma ENDDUMPHello Mr. Rao,
your source is working. But this seems not to be a solution. The COLOR_CAPTIONTEXT of all applications is changed.
COLOR_ACTIVECAPTION on my VISTA PC works only with classic view.
Thank you for your help and best regards,
Otto
SetSysColors() API function changes settings for the entire system.
If you intend to change only for one application, then SetSysColors() is not the way.