FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Change/save Screen-resolution to Applic.-resol. at Runtime ?
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
Re: Changing Screen-resolution to Applic.-resol. at Runtime ?
Posted: Fri Apr 01, 2011 08:38 PM
Bayron wrote:Maybe it has something to do that I have 2 monitors???


yes maybe... i'll test in my home tonight...
Posts: 883
Joined: Thu Dec 24, 2009 12:46 AM
Re: Changing Screen-resolution to Applic.-resol. at Runtime ?
Posted: Fri Apr 01, 2011 08: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
xBasePHP.com
(215)2226600 Philadelphia,PA, USA
MayaBuilders@gMail.com
Guatemala

FWH25.06--Harbour 3.0.0--BCC7.7--UEstudio 10.10
Windows 10

FiveWin, One line of code and it's done...

Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Changing Screen-resolution to Applic.-resol. at Runtime ?
Posted: Sat Apr 02, 2011 09: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



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



Best regards
Uwe :-)
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.
Posts: 77
Joined: Sun Aug 26, 2007 11:53 PM
Re: Changing Screen-resolution to Applic.-resol. at Runtime ?
Posted: Wed Apr 06, 2011 04: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 (fw): Select all Collapse
   IF nScrwidth <> 1024 .and. nScrheight <> 768
      // Copyright   2010 by Jamie O'Connell <!-- m --><a class="postlink" href="http://www.midiox.com">http://www.midiox.com</a><!-- m -->
      WaitRun(cINIPath+'DesktopCmd save /y' )
      CHANGEDISLPAYRESOLUTION( 1024, 768 )
   ENDIF

and the following trigered by closing the window 'VALID' (passing nScrwidth, nScrheight)
Code (fw): Select all Collapse
   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! :-)

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

Jonathan
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Changing Screen-resolution to Applic.-resol. at Runtime ?
Posted: Thu Apr 07, 2011 08: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.
Posts: 77
Joined: Sun Aug 26, 2007 11:53 PM
Re: Change/save Screen-resolution to Applic.-resol. at Runtime ?
Posted: 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

Continue the discussion