Articles   Members Online:
-Article/Tip Search
-News Group Search over 21 Million news group articles.
-Delphi/Pascal
-CBuilder/C++
-C#Builder/C#
-JBuilder/Java
-Kylix
Member Area
-Home
-Account Center
-Top 10 NEW!!
-Submit Article/Tip
-Forums Upgraded!!
-My Articles
-Edit Information
-Login/Logout
-Become a Member
-Why sign up!
-Newsletter
-Chat Online!
-Indexes NEW!!
Employment
-Build your resume
-Find a job
-Post a job
-Resume Search
Contacts
-Contacts
-Feedbacks
-Link to us
-Privacy/Disclaimer
Embarcadero
Visit Embarcadero
Embarcadero Community
JEDI
Links
How to change the system colours Turn on/off line numbers in source code. Switch to Orginial background IDE or DSP color Comment or reply to this aritlce/tip for discussion. Bookmark this article to my favorite article(s). Print this article
10-Oct-02
Category
System
Language
Delphi 2.x
Views
75
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
DSP, Administrator
Reference URL:
DKB
			 Author: Jonas Bilinkevicius

How to change the system colours

Answer:

Solve 1:
1   
2   procedure TMainForm.Button4Click(Sender: TObject);
3   var
4     nColorIndex: array[1..2] of integer;
5     nColorValue: array[1..2] of longint;
6   begin
7     nColorIndex[1] := COLOR_ACTIVECAPTION;
8     nColorIndex[2] := COLOR_BTNFACE;
9     nColorValue[1] := clBlue; {define the color you want}
10    nColorValue[2] := clRed; {in that case is the caption bar and button color}
11    SetSysColors(2, nColorIndex, nColorValue);
12    PostMessage(HWND_BROADCAST, WM_SYSCOLORCHANGE, 0, 0);
13  end;


You could have a look into the "Win32 API reference", under the "SetSysColors" 
section. There, if you directly go to "GetSysColors" you'll get alist of the places 
where you can change the colors. (e.g taskbar, borders, etc). In your case use 
COLOR_BACKGROUND and COLOR_DESKTOP.


Solve 2:
14  
15  procedure TForm1.Button1Click(Sender: TObject);
16  const
17    ColCount = 2;
18    Elements: array[0..ColCount - 1] of Integer = (COLOR_WINDOW, COLOR_WINDOWTEXT);
19    Colors: array[0..ColCount - 1] of TColorRef = (clBlue, clYellow);
20  begin
21    if not SetSysColors(ColCount, Elements[0], Colors[0]) then
22      RaiseLastWin32Error;
23  end;


			
Vote: How useful do you find this Article/Tip?
Bad Excellent
1 2 3 4 5 6 7 8 9 10

 

Advertisement
Share this page
Advertisement
Download from Google

Copyright © Mendozi Enterprises LLC