Solved

Windows resolution

Posted on 1998-10-25
7
224 Views
Last Modified: 2010-04-06
Is there a function that returns the actual windows
resolution ( 640x480,800x600,1024x768, etc .. ) ?

bryan
0
Comment
Question by:bryan7
  • 3
  • 3
7 Comments
 

Accepted Solution

by:
ShadowHawk071998 earned 10 total points
ID: 1344310
I'm Not Too Sure if that's what you intended, but you can get the SCREEN size, by simlpy
using Screen :
  Screen.Width or
  Screen.Height
This will get you the Screen's Height and Width. But I don't know what will happen on Virtual or 'Panning' Desktops. I guess it shouldn't matter, because a person that uses a virtual desktop expects your software to think it has a bigger desktop, so it should work fine.
Look at
   http://www.pinpub.com/vcd/vcd9802i/vcd98b6.html
for some info on screen resolution (It's in C++, but it can easily be converted to Delphi, I think)
0
 

Expert Comment

by:ShadowHawk071998
ID: 1344311
P.S.
  If you're thinking about writing forms in diffrent resolutions, check this:
http://www.inprise.com/devsupport/delphi/techdocs/tis/ti2861.html
it might be interesting (Didn't read it all myself :))


0
 
LVL 3

Author Comment

by:bryan7
ID: 1344312
screen.height and screen.width is what I needed.
but..

Virtual Desktops ?

what's that ?

bryan
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 10

Expert Comment

by:viktornet
ID: 1344313
Here is how you do that...

var
  XRes, YRes : Integer;
  ScreenDC : hDC;
begin
  ScreenDC := CreateDC('DISPLAY', nil, nil, nil);
  xRes := GetDeviceCaps(ScreenDC, HORZRES);
  yRes := GetDeviceCaps(ScreenDC, VERTRES);
  DeleteDC(ScreenDC);
  ShowMessage(Format('%d x %d',[xRes, yRes]));
end;

Cheers,
Viktor
0
 
LVL 3

Author Comment

by:bryan7
ID: 1344314
What's the difference ?
Can I get the coor depth too with hDC ?

bryan

0
 

Expert Comment

by:ShadowHawk071998
ID: 1344315
What I ment about Virtual Desktops:
(It's just me thinking, I haven't checked it):
There are programs that allow you to have a bigger desktop, then your 'viewport'. The Viewport is the actual Resolution. Let's say you're using 800x600. That is your ViewPort. But you can have a desktop of 1024x768, but then you only view a part of it (In the size of 800x600). The program would allow you to pan around, so you can view the entire screen. It's very nice. Most video-cards today offer these capabilities.
THe info I'm missing, is whether screen.height in that case will return 1024 or 800.
YOu should also decide what do you WANT it to report in that case (Depending on your application needs).
Anyway. About getting the Screen's colour depth:
You CAN use devcaps to get it (Take a look at :
http://www.inprise.com/devsupport/delphi/qanda/750.html
).
Those questions are a good source of answers, BTW. And you might also check out:
http://infomaster.net/external/efg/Library/Delphi/Graphics/Win32API.htm
which is another good source for tips (Note that many of the links go to the inprise site).
Enjoy!
0
 
LVL 3

Author Comment

by:bryan7
ID: 1344316
ok, thanx

bryan =)

0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Delphi selector screen 2 92
oracle global variables 4 80
TEMBEDDEDWB how can i change its user agent ? 8 83
Twebbrowser add css to the header 3 39
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question