Solved

Automatically change Resolution in Win98

Posted on 2000-04-04
4
192 Views
Last Modified: 2010-04-10
I want to write a small app for windows 98, 95, and NT, that will automatically change the screen resolution.
Probably in Visual c++
Requirements:
- no restarts
- no prompts
- just changes the resolution when run
Can anyone help please?
0
Comment
Question by:wilbot
  • 3
4 Comments
 
LVL 2

Expert Comment

by:dhymes
Comment Utility
Give this a try.

BOOL EnumDisplaySettings(LPCTSTR pszDeviceName, DWORD iModeNum, PDEVMODE lpDevMode);

Regards,
Dave
0
 
LVL 2

Expert Comment

by:dhymes
Comment Utility
Sorry, use

EnumDisplaySettings(LPCTSTR pszDeviceName, DWORD iModeNum, PDEVMODE lpDevMode);

to get the current and supported settings, then use

 LONG ChangeDisplaySettings(LPDEVMODE lpDevMode, DWORD dwflags);

To change the setting.
0
 
LVL 14

Accepted Solution

by:
AlexVirochovsky earned 250 total points
Comment Utility
You can simple change resolution
and launch Apps:
To get current resolution:

int cx = GetSystemMetrics(SM_CXSCREEN),
cy = GetSystemMetrics(SM_CYSCREEN));

To change resolution:
  DEVMODE dm; dm.dmPelsWidth=cx; dm.dmPelsHeight=cy;
  dm.dmSize = sizeof(dm);
  dm.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT;
  ChangeDisplaySettings(&dm, 0);
Alex
0
 
LVL 2

Expert Comment

by:dhymes
Comment Utility
Alex,

I could of submitted mine as answers also, why are you jumping out there when I am already working on this problem with wilbot? This is not the way we play the game out here so please go and read the rules.

Regards,
Dave
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

762 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