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 get the position of the Windows Taskbar 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
02-Oct-02
Category
System
Language
Delphi 2.x
Views
65
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
DSP, Administrator
Reference URL:
DKB
			 Author: Jonas Bilinkevicius

I want to get some desktop settings in variables, like background color etc. But I 
don't want to use the registry, does anybody know a different way? I also want to 
know the height of the taskbar, and the position of the taskbar (top of the screen, 
bottom, left or right).

Answer:

For the following example put a RadioGroup on your form and give it 5 items:

1   implementation
2   
3   type
4     TTaskBarPosition = (tpHide, tpBottom, tpLeft, tpRight, tpTop);
5   
6   function FindTaskBarPos(aWorkArea: TRect): TTaskBarPosition;
7   begin
8     if aWorkArea.Left <> 0 then
9     begin
10      Result := tpLeft;
11      Exit;
12    end;
13    if aWorkArea.Top <> 0 then
14    begin
15      Result := tpTop;
16      Exit;
17    end;
18    if aWorkArea.Right <> Screen.Width then
19    begin
20      Result := tpRight;
21      Exit;
22    end;
23    if aWorkArea.Bottom <> Screen.Height then
24    begin
25      Result := tpBottom;
26      Exit;
27    end;
28    Result := tpHide;
29  end;
30  
31  procedure TForm1.FormCreate(Sender: TObject);
32  var
33    WorkArea: TRect;
34  begin
35    Color := clBackground;
36    SystemParametersInfo(SPI_GETWORKAREA, 0, @WorkArea, 0);
37    RadioGroup1.ItemIndex := Ord(FindTaskBarPos(WorkArea));
38  end;
39  
40  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