Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Screen resolution
Message
From
08/09/2015 09:46:53
Metin Emre
Ozcom Bilgisayar Ltd.
Istanbul, Turkey
 
 
To
08/09/2015 00:24:47
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01624301
Message ID:
01624364
Views:
125
This message has been marked as the solution to the initial question of the thread.
you just put the name of .prg files as changeres...

>thanks metin. the restore feature may very well work but the changeres() is not recognized syntax in .prg so I have no way to test either.
>thanks for the input.
>
>k
>
>
>
>>>Just bought new mini laptop 13.3 with optimal screen resolution 1920x1080. However I need to change that setting to 1280x800 to view all data in VFP window.
>>>
>>>Is there an initial setting I can change in VFP settings or set up programmatically so that when I start VFP it will change the screen resolution to 1280x800 either for VFP alone or for the whole laptop configuration.
>>>
>>>tnx k
>>
>>Use this, it works perfect for me:
>>
>>
>>Lparameters lnWidth, lnHeight
>>If Pcount() # 2
>>	If Vartype(_Screen.LastWidth)="U"
>>		Return
>>	Else
>>		lnWidth=_Screen.LastWidth
>>		lnHeight=_Screen.lastHeight
>>	Endif
>>Endif
>>Clear
>>#Define ENUM_CURRENT_SETTINGS -1
>>#Define CDS_UPDATEREGISTRY = 0x01
>>#Define CDS_TEST 0x02
>>#Define DISP_CHANGE_SUCCESSFUL 0
>>#Define DISP_CHANGE_RESTART 1
>>#Define DISP_CHANGE_FAILED -1
>>#Define DM_PELSWIDTH 0x00080000
>>#Define DM_PELSHEIGHT 0x00100000
>>
>>Declare Integer EnumDisplaySettings In win32API ;
>>	string deviceName,;
>>	integer modeNum, ;
>>	string @ lpdevMode
>>
>>Declare Long ChangeDisplaySettings In win32API ;
>>	string lpDevMode, ;
>>	integer dwflags
>>
>>lpdevMode = Replicate(Chr(0),512)
>>
>>EnumDisplaySettings(0,ENUM_CURRENT_SETTINGS,@lpdevMode)
>>
>>* Save previous resolution
>>
>>_Screen.AddProperty("LastWidth",CToBin(Substr(m.lpdevMode,109,4),"4RS"))
>>_Screen.AddProperty("LastHeight",CToBin(Substr(m.lpdevMode,113,4),"4RS"))
>>* Check if not the same, no use to change when the same
>>If _Screen.LastWidth # m.lnWidth or _Screen.LastHeight # m.lnHeight
>>	Wait Window "Ekran çözünürlüğü ayarlanıyor..." At Srows()/2,Scols()/2-10 Nowait
>>	lpdevMode = Stuff(m.lpdevMode,41,4,BinToC(DM_PELSWIDTH+DM_PELSHEIGHT,"4RS"))
>>	lpdevMode = Stuff(m.lpdevMode,109,4,BinToC(lnWidth,"4RS"))
>>	lpdevMode = Stuff(m.lpdevMode,113,4,BinToC(lnHeight,"4RS"))
>>	result = ChangeDisplaySettings(m.lpdevMode,CDS_TEST)
>>	If !( result = DISP_CHANGE_SUCCESSFUL )
>>*Wait Window "Mode not supported." Timeout 1
>>		Return .F.
>>	Else
>>		ChangeDisplaySettings(m.lpdevMode,0)
>>	Endif
>>Endif
>>Return
>>Endfunc
>>
>>*!*    Source Code From Cetin BASOZ
>>*!*	To use it, just place it somewhere in your app like this:
>>*!*	ChangeRes(1024,768)
>>*!*	That means I am forcing the screen to have a resolution of 1024x768. When I exit my main form, in the unload event I place this:
>>*!*	ChangeRes(_Screen.LastWidth,_Screen.lastHeight)
>>*!*	And that would restore the previous screen resolution.
>>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform