Solved

Windows resolution

Posted on 1998-10-25
7
220 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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

747 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now