Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Windows resolution

Posted on 1998-10-25
7
223 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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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.

 
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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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
indy Tidtcpserver best  way to brodcast message to multiable clients 1 162
Help on project with Soap 10 57
Printing problem 2 101
Firemonkey allowing RTL on android 6 43
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

790 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