News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Changing Video Resolution Quickly

Started by Bill Cravener, February 18, 2009, 05:13:46 PM

Previous topic - Next topic

Bill Cravener

I made these two simple examples up so I could quickly switch from 1280x1024 video resolution (my default setting) and 1024x768 video resolution on my LCD.

Being an asm programmer and a website developer I like to see how things look in these two different resolution settings. I have an icon for each resolution setting on my desktop so I just double click the icon to change the resolution setting I want to see.

Using Windows Control Panel/Display applet sucks when you wish to change display settings. These two simple examples make it quick and easy.

But, before using these two examples make sure your monitor supports the values I am using within the source codes for pixel width, pixel height and monitor frequency.



[attachment deleted by admin]
My MASM32 Examples.

"Prejudice does not arise from low intelligence it arises from conservative ideals to which people of low intelligence are drawn." ~ Isaidthat

GregL

Cycle Saddles,

Thanks, could come in handy.  :thumbu


PBrennick

It never occurred to me to make something like that. I do some webpage development on the side, I am always switching res when testing them. Thanx for the cool idea.

Paul
The GeneSys Project is available from:
The Repository or My crappy website

drhowarddrfine

The web developer toolbar in Firefox sizes the browser for you to any resolution you wish.

PBrennick

That's nice to know. If I ever use FireFox, I will use that. I use K-Meleon, not really sure why, Doc.

Cycle saddles,
Since you are sure of your Display driver capabilities, that method is fine but as you hinted at, others may have problems (and you could, also, if you try the same values on another machine.

I would recommend using EnumDisplaySettings to initialize DEVMODE instead of manually doing it. makes sure the settings are valid.

There is also, as I am sure you are aware, the CDS_TEST   Flag that will cause the system to do that test thing. Again, if you are always working on the same system, it is not necessary; but, if you carry these programs in your toolbox - that Flag and EnumDisplaySettings would be the way to go, I think.

Paul
The GeneSys Project is available from:
The Repository or My crappy website

drhowarddrfine

Quote from: PBrennick on February 19, 2009, 02:25:41 AM
That's nice to know. If I ever use FireFox, I will use that.
It's not a question of which one you regularly surf with.  All web designers use the many dev tools available on FF for checking such things.  Opera, too, has some great stuff.  I usually surf with Firefox because I always have it up while working, but I also have Opera, Safari, Chrome, Konqueror and Lynx installed.

donkey

My display looks awful in anything but 1920x1200, well 1024x768 isn't bad but lacks real estate, way too busy of a desktop for that small a resolution. Nice utility for the toolbox though.
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

Bill Cravener

Well thanks fellows, I think !? :bg

I do not have much free time to post here on the board. Thankfully I have a full time job and a couple things going on the side as well. So at the least I like to post useful source code here primarily pointed towards those who are learning or wish to learn assembly.

I do not create these simple examples to be deep or complicated they are purposely kept simple for the new learner to grasp. I think you'll find that all my examples, and there are many, are all simplistic and to the point.

If anyone wishes to build on any of my examples here on the board please do.
My MASM32 Examples.

"Prejudice does not arise from low intelligence it arises from conservative ideals to which people of low intelligence are drawn." ~ Isaidthat

PBrennick

Cycle Saddles,

Quote
If anyone wishes to build on any of my examples here on the board please do.

Since you mention that, I will work on a simple dialog box that the user can use to switch modes instead of using one program for each mode. I'll use Radio Buttons. I played with the idea last night because when working on a project, I rest my brain by switching to another project temporarily. Anyway, I was not sure how you would react to it so I deleted it all. I will do it again and post it here. Others may or may not do the same. There is nothing big about the doing of it and all of us can do this type of thing in our sleep. I just like the idea of being able to have it all in one app which I will leave running while testing.

It will probably become a K-Meleon add-in.
Paul
The GeneSys Project is available from:
The Repository or My crappy website

Bill Cravener

Quote from: PBrennick on February 19, 2009, 02:41:18 PM
Since you mention that, I will work on a simple dialog box that the user can use to switch modes instead of using one program for each mode.It will probably become a K-Meleon add-in.
Paul

Paul,

Sounds interesting, I await your endeavor. :bg
My MASM32 Examples.

"Prejudice does not arise from low intelligence it arises from conservative ideals to which people of low intelligence are drawn." ~ Isaidthat

NightWare

Quote from: Cycle Saddles on February 19, 2009, 09:42:27 AM
If anyone wishes to build on any of my examples here on the board please do.
hi, i play with this too (make a tray/context menu tool), but have a problem... when i enumerate the displays, i have always 3 results (except for the larger display) for the same resolution... since EnumDisplaySetting only define 5 dwords of the DEVMODE structure (and no difference in those elements), is someone have an idea to filter this ? or am i reduced to search an already existing resolution ?

PBrennick

I am not sure what you are getting at. I am going to have to figure this out, myself, Donkey probably has the answer. I know that there are several Graphics modes for each display adapter. You would start with a zero setting for iModeNum and then increment by one and test. Repeat this process until the return value in eax is false. Once that happens, you will know how many modes your adapter has.

Paul
The GeneSys Project is available from:
The Repository or My crappy website

PBrennick

Nightware,
My display adapter has 65 modes of operation. Since I always use True Color and will never use 640x480, I can narrow this to 15. Chances are I will not use 800x600, either, but my final program will include this because lots of people on the Internet use it.

Cycle Saddles,
I am posting a program that does what you are doing. You will need to make two changes for it to work on your machine, though. You need to set the dmDisplayFrequency back to 70 (my machine required different values there).

When the program is totally done, it will look similar to what it is now but will have many more options. This works fine, though, and can be a starting point for anyone else's dream.

Paul


[attachment deleted by admin]
The GeneSys Project is available from:
The Repository or My crappy website

Bill Cravener

Quote from: PBrennick on February 20, 2009, 03:59:03 PM
Cycle Saddles,
You need to set the dmDisplayFrequency back to 70 (my machine required different values there).

I chose 70 cause it seems to be supported by must any crt or lcd monitor.

If I had the time I'd make a tray utility that you right clicked on that then listed the video systems possible resolutions that you could then click on to instantly set. I'm forgetting things but seems to me there was once a utility that did just that but can't remember, it was a tray utility I do remember that.
My MASM32 Examples.

"Prejudice does not arise from low intelligence it arises from conservative ideals to which people of low intelligence are drawn." ~ Isaidthat

evlncrn8

i think something similar was in win 9x.. maybe part of the plus pack...