Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Screen Information

Status
Not open for further replies.

BeerFizz

Technical User
Jan 23, 2004
28
Hi,

How can I query the resolution of the screen (ie 1024x768 etc) and if required cause a resolution change.

Thanks
phil
 
If you are in MFC and you use the CDC class, then you can use the function in that class called int CDC::GetDeviceCaps(int nIndex). For the screen resolution nIndex is HORZRES and VERTRES. Check out MSDN for the full list of nIndexes if you are curious.

-Bones
 
Thank your for the response. Is that the only way it can be queried and or changed? What about if you have a CDialog app?

Thanks
Phil
 
It can work in a dialog application, just declare a CDC. I'm certain there is another way, but am not sure exactly what it is.

-Bones
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top