?
Solved

Windows resolution

Posted on 1998-10-25
7
Medium Priority
?
229 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
[X]
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
  • 3
  • 3
7 Comments
 

Accepted Solution

by:
ShadowHawk071998 earned 40 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
Independent Software Vendors: 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses
Course of the Month15 days, 4 hours left to enroll

771 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