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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

changing system screen resolution 1

Status
Not open for further replies.

jebo100

Technical User
May 11, 2007
52
PH
is there a way to change the system screen resolution programatically from within the VPF?
 
is there a way to change the system screen resolution programatically from within the VPF?

Mike has given you the information you need to do this. However, just because you can do something doesn't mean you should.

Users have their resolution set for a reason - it is their preference. Your program is a guest on the user's computer and it should behave like a good guest. What would you do if you invited someone to your home and the first thing they did was to start re-arranging the furniture?

What you should look at doing instead is to resize your forms appropriately for whatever resolution the user is running at. Thee are various re-sizers available for download from many VFP web sites. Or, if you want to roll your own, see SYSMETRIC() in the on-line help to start you on youor way.

Marcia G. Akins
 
thanks for the tip Marcia,

the reason why i wanted to change the system resolution is;

i am trying to develop a POS that will display in full screen on whatever computer it runs, and then restores the screen upon exit.



 
In your startup program:

_screen.windowstate = 2 &&&& Maximized

This will open the POS in full screen in whatever resolution the user has set. I agree with Marcia, you should Not change the user defined display or resolution...
 
Jebo,

Do you really mean full screen, as opposed to simply maximised? That is, no title bar, window frame, task bar, etc. visible?

If so, do as Imaginecorp suggested. In addition, set _SCREEN.TitleBar to 0, and _SCREEN's width and height to match SYSMETRIC(1) and SYSMETRIC(2) respectively.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
to Imaginecorp,MikeLewis, Marcia G. Akins

thanks for the tips, and yes i know that changing the user defined resolution of someones computer is improper.
but in my case, i think this does not apply because the POS i am trying to develop or maybe distribute is going to be installed on new computers which will be used as stand alone POS system/s.

i dont really know if i am doing the right thing here:). i just got the idea in some game softwares that changes the screen resolution when launch.

i think i'll do Mike's tip, and i better study/learn visual c++ fast! :)

Thanks friends!!!
 
Mike,

i meant for example;
my computer screen is 1280x1024 and i designed all my forms in 1024x768. I wanted my computer screen resolution to change into 1024x768 when the POS launch, then restore back to its original resolution on quit.

i think proper way is "ChangeDisplaySettings() API function" and i am now into learning visual c++ :)


thanks!
 
Jeb,

i think proper way is "ChangeDisplaySettings() API function" and i am now into learning visual c++ :)

I don't want to discourage you from learning C++, but do you realise that you don't need to do that merely to call the ChangeDisplaySettings() API? You can do that from right here in VFP. Let us know if you need any help to do that.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Mike,

I would really appreciate any help you could extend Mike.
but still, i'm going to continue learning C++.
maybe someday i'm going to need some basic knowhow writing C++ .

Thanks again.

 
Jebo,

The original reference I gave you contains a link to example code in VFP (but you have to register with the site in order to see it).

I also found the following in MSDN:

If you are comfortable with Pascal, you could also try:

No doubt there are other examples on various sites.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
my computer screen is 1280x1024 and i designed all my forms in 1024x768. I wanted my computer screen resolution to change into 1024x768 when the POS launch, then restore back to its original resolution on quit.

What happens when the target machine does not support the video resolution you're forcing?

If any application changed my video resolution I would immediately uninstall it.
 
danfreeman,

as i have said, "changing the resolution ... is improper" would not apply in my case because the POS i am trying to develop is going to be installed on 'NEW' computers which will be used as a stand alone POS system/s.

i dont think that todays new computers would not support this resolution.

thanks dan
 
the POS i am trying to develop is going to be installed on 'NEW' computers which will be used as a stand alone POS system/s.

Then why on earth wouldn't the computers be built to the appropriate specifications in the first place?

pamela
 
Jebo,

I've hesitated to jump into this discussion, but I have to say I agree with Dan, Pamela and the others.

If you definitely have to run your app at a particular resolution, you should state that fact as part of the specification (just as you would state that it needs so many gigabytes of disk space or whatever).

At most, you should then check the resolution on startup, and if it is below what you expect, you should display a warning message, but let the user continue of they want to.

I can't see the fact of these being new computers making any difference.

Or, did you mean that you want to change the resolution on your computer, to match that of your users? If so, that would make much more sense.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Mike, Pam, Dan

Its just that I have downloaded a demo POS software called Registware from Microworks and i was just curious how it changed the resolution when the software runs. :)

i'll take your advice friends. I'll put in a select button on startup asking the user if they would like to run in full screen or windowed mode.

i really appreciate the help and advices.

Thanks friends.
Jebo...


 
Jebo:

The "New" computers are the ones associated with cash registers with little screens, if so, as far as I know, you cannot change the resolution.
If they are regular computers, an 800X600 resolution works perfect. Not too small Not too big.
If these computers are dedicated to your POS app, during setup change the resolution, manually through Windows Display.... Or let your startup program do it programmatically with API calls after checking for current resolution. Once set it will never change as these are dedicated machines.
Yes its bad form etc,etc...But "Good form" does not put bread on the table, Happy Clients do...

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top