Change/save Screen-resolution to Applic.-resol. at Runtime ?

Re: Changing Screen-resolution to Applic.-resol. at Runtime ?

Postby Daniel Garcia-Gil » Fri Apr 01, 2011 8:38 pm

Bayron wrote:Maybe it has something to do that I have 2 monitors???


yes maybe... i'll test in my home tonight...
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: Changing Screen-resolution to Applic.-resol. at Runtime ?

Postby Bayron » Fri Apr 01, 2011 8:42 pm

Thanks Uwe and Daniel,

I compiled this example, but it does not do anything at all other than blinking the screen once each time I press the button.

By the way I unplugged the extra monitors and only left one working, and still does not do anything... (this is weird, since I realize that it is Windows API that is asked to do the changes)

Daniel, I am just providing feedback, I do not use this functions, so do not set It's priority level too high, since it is already working for Uwe; I know you are working in a lot of kool and usefull things for FiveWin!!!
=====>

Bayron Landaverry
(215)2226600 Philadelphia,PA, USA
+(502)46727275 Guatemala
MayaBuilders@gMail.com

FWH12.04||Harbour 3.2.0 (18754)||BCC6.5||UEstudio 10.10||
Windows 7 Ultimate

FiveWin, One line of code and it's done...
User avatar
Bayron
 
Posts: 815
Joined: Thu Dec 24, 2009 12:46 am
Location: Philadelphia, PA

Re: Changing Screen-resolution to Applic.-resol. at Runtime ?

Postby ukoenig » Sat Apr 02, 2011 9:23 am

I still have a Question about the Position of Desktop-Icons.

After changing the Screen-resolution it is possible, that Icons are displayed on different Places.
For that Reason, there are some Freeware-prog*s available ( external ) to save and restore Icon-positions.
Is it maybe possible, to do this from inside a FWH-application as well ?
It would make Daniel's Solution complete.

A standalone Application to save / restore the Desktop-icon-positions => Download :
http://www.softpedia.com/get/Desktop-En ... Save.shtml

Image

I still found another one. Maybe a better Solution.
Autorestore, in case of a changed Screen-resolution ( saving to a File ).

Image

Best regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Changing Screen-resolution to Applic.-resol. at Runtime ?

Postby Jonathan Hodder » Wed Apr 06, 2011 4:33 am

Uwe

This is great!
I downloaded a command line desktop restor from http://www.midiox.com/desktoprestore.htm
and used the following at the start
Code: Select all  Expand view

   IF nScrwidth <> 1024 .and. nScrheight <> 768
      // Copyright   2010 by Jamie O'Connell http://www.midiox.com
      WaitRun(cINIPath+'DesktopCmd save /y' )
      CHANGEDISLPAYRESOLUTION( 1024, 768 )
   ENDIF
 

and the following trigered by closing the window 'VALID' (passing nScrwidth, nScrheight)
Code: Select all  Expand view

   IF nScrwidth <> 1024 .and. nScrheight <> 768
        CHANGEDISLPAYRESOLUTION( nScrwidth, nScrheight )
        WaitRun(cINIPath+'DesktopCmd restore /y' )
   ENDIF
 

This is its simplest form.
Can be optimised in case the resolution gets changed back by the user while still in your program.
Thanks Daniel! :wink:

Bayron have you got the resolution to change on one? or two screens?

Jonathan
Jonathan Hodder
 
Posts: 77
Joined: Sun Aug 26, 2007 11:53 pm

Re: Changing Screen-resolution to Applic.-resol. at Runtime ?

Postby ukoenig » Thu Apr 07, 2011 8:15 am

Jonathan,

Thank You very much.
This Solution works fine for me.
Do You know, if the existing Resolution is written to a File or Registry ?
With 2 Monitors, I couldn't test.

Best Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Change/save Screen-resolution to Applic.-resol. at Runtime ?

Postby Jonathan Hodder » Thu Apr 07, 2011 10:29 pm

Uwe

Do You know, if the existing Resolution is written to a File or Registry ?

Reg => HKEY_CURRENT_USER\Software\JOConnell\DeskTop
You can define a registry storage name too.
More info in the rtf info in the download.
I have just been looking at some of Jamie oConnell's code on the website - undocumented windows - clever!


With 2 Monitors, I couldn't test.

I dont have 2 screens. I will test at a customer site next week with 2 screens.
Maybe dependant upon screen driver, resolutions.
It would be nice to have a command to return the resolutions available?
Bayron have you got any results with 2 screens?

Jonathan
Jonathan Hodder
 
Posts: 77
Joined: Sun Aug 26, 2007 11:53 pm

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 72 guests