Solved

Windows resolution

Posted on 1998-10-25
7
225 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 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
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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
Tviruailstringtree sort multi columns on header click 1 93
Performance of SQL statement 37 145
Delphi: Connect to running MS Outlook 4 204
TAction.OnAfterExecute? 2 31
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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

739 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