- This topic has 0 replies, 1 voice, and was last updated 16 years ago by Departure.
-
AuthorPosts
-
July 6, 2008 at 12:11 pm #191149DepartureMember
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.
-
AuthorPosts
Related
- You must be logged in to reply to this topic.