Colour Black Nicks [Delphi]

Here you can talk about C++ And C# And Other languages programming.

Colour Black Nicks [Delphi]

Postby Departure » Sun Jul 06, 2008 7:11 am


I thought I would add some small snippets of code considering I am moderator and have'nt been contributing to this catagory very much.

The following code will change all black nickname to desired RGB colour.

Add a Button to a form and do the following

implementation

const
LVM_SETTEXTCOLOR : Integer = $1000 + 36; //Set Text colour
{$R *.dfm}
function EnumChildProc(AHandle: hWnd): BOOL; stdcall;
// callback for EnumChildWindows.
var
tmpS: string;
theClassName: string;
clrText: Integer;
begin
Result := True;
SetLength(theClassName, 256);
GetClassName(AHandle, PChar(theClassName), 255);
tmpS := PChar(theClassName);
if Pos('SysListView32', tmpS) > 0 then // If SysListView is found (RoomList)
begin
clrText := RGB(170,000,000); // Desired text color (RGB)
SendMessage(AHandle, LVM_SETTEXTCOLOR, 0, clrText);
end;
end;


procedure
TForm1.Button1Click(Sender: TObject);
var
WndClass: array[0..50] of char;
h: THandle;
begin
WndClass := 'DlgGroupChat Window Class'; //Paltalk IM window Class Name
h := FindWindow(@WndClass[0], nil);
EnumChildWindows(h, @EnumChildProc, 0);
SendMessage(HWND_BROADCAST, WM_SETTINGCHANGE, 0, 0);
end;

This could be modifyed and code added to make a totally new program to colour peoples nicknames, Also you will learn about EmumChild which is the better way to find a handle of a control with in an app.
User avatar
Departure
Global Moderator
Global Moderator
 
Posts: 996
Joined: Thu Mar 17, 2005 11:26 am
Location: Australia

Return to C++, C# And Others Programming

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 0 guests