I can't seem to find any function which will allow me to obtain the Windows screen resolution and/or set it in C++.
I would like to be able to change it, then change it back.

Thanx

Thanx. Now I just have to figure out how to use it. I will, eventually.

I'm also trying to do the same thing and i'm running on windows xp. i kind of understand the links you gave RFBourquin except i'm pretty new to C++, only using it in a class for the past 6 weeks. I'm having trouble understanding how to use the commands from http://msdn.microsoft.com/en-us/library/dd183413.aspx. i was hoping someone could give an example of using the commands from that page and change the resolution to 800 x 600 as an example please. thank you.

(First, declare the device mode class)
DEVMODE NewDevice;

(The members of this class you will need)
NewDevice.dmSize = sizeof(DEVMODE);
NewDevice.dmPelsWidth = 1024;
NewDevice.dmPelsHeight = 768;


(In the main program)
ChangeDisplaySettings(&NewDevice, 0);

You may want to have a look at WMI (windows management instrumentation). It provides an extensive API for accessing your systems information.

I get the following errors please help

Error 1 error LNK2028: unresolved token (0A0000AD) "extern "C" long __stdcall ChangeDisplaySettingsW(struct _devicemodeW *,unsigned long)" (?ChangeDisplaySettingsW@@$$J18YGJPAU_devicemodeW@@K@Z) referenced in function "private: void __clrcall UI::Form1::About_Click(class System::Object ^,class System::EventArgs ^)" (?About_Click@Form1@UI@@$$FA$AAMXP$AAVObject@System@@P$AAVEventArgs@4@@Z) C:\Users\7sedam7\documents\visual studio 2010\Projects\UI\UI\UI.obj


Error 2 error LNK2019: unresolved external symbol "extern "C" long __stdcall ChangeDisplaySettingsW(struct _devicemodeW *,unsigned long)" (?ChangeDisplaySettingsW@@$$J18YGJPAU_devicemodeW@@K@Z) referenced in function "private: void __clrcall UI::Form1::About_Click(class System::Object ^,class System::EventArgs ^)" (?About_Click@Form1@UI@@$$FA$AAMXP$AAVObject@System@@P$AAVEventArgs@4@@Z) C:\Users\7sedam7\documents\visual studio 2010\Projects\UI\UI\UI.obj

Error 1 error LNK2028: unresolved token (0A0000AD)

This article has been dead for over six months. Start a new discussion instead.