forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Change Screen resolution

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
marcelo
Contributor
Contributor


Joined: 10 May 2008
Posts: 155

PostPosted: Wed Dec 29, 2010 6:54 pm    Post subject: Change Screen resolution Reply with quote

Hi, is there any way to change windows screen resolution in VDS 5?
I have a script working perfect in a 1024x768 fullscreen and i want to run it with a new monitor configured in other resolution.
I need to set to 1024 when program starts and set to original resolution when program ends.
Is this possible? Is there any DLL, EXE, or something to do this?

Thans a lot and have a happy new year!!!

Marcelo
Back to top
View user's profile Send private message
Tdk161
Valued Contributor
Valued Contributor


Joined: 08 Feb 2005
Posts: 399
Location: ITALY

PostPosted: Thu Dec 30, 2010 4:49 pm    Post subject: Reply with quote

Hi Marcelo Smile

You can use this little utility
http://www.snapfiles.com/downloads/qres/dlqres.html
it's very little and maybe can help you

Enjoy Wink
Back to top
View user's profile Send private message Send e-mail
Hooligan
VDS Developer
VDS Developer


Joined: 28 Oct 2003
Posts: 480
Location: California

PostPosted: Fri Dec 31, 2010 7:45 am    Post subject: Reply with quote

VDSUtil.dll will do that....

Hooligan

_________________
Hooligan

Why be normal?
Back to top
View user's profile Send private message
marcelo
Contributor
Contributor


Joined: 10 May 2008
Posts: 155

PostPosted: Mon Jan 03, 2011 12:04 am    Post subject: Reply with quote

I find a tool to change the resolution, it's called Qres.exe and it works fine.
I will try vdsutil too.
Thanks a lot!!!!!
Back to top
View user's profile Send private message
marcelo
Contributor
Contributor


Joined: 10 May 2008
Posts: 155

PostPosted: Tue Jan 04, 2011 3:18 am    Post subject: Reply with quote

Sorry Tdk161, I didnt read your message Confused Thanks a lot for the suggestion!!
I'm reading the vdsutil documentation but i cant find the way to know the actual screen resolution on the system.
Is there a way to know the windows screen resolution?
Back to top
View user's profile Send private message
Hooligan
VDS Developer
VDS Developer


Joined: 28 Oct 2003
Posts: 480
Location: California

PostPosted: Tue Jan 04, 2011 4:17 pm    Post subject: Reply with quote

This post will show you how to read the resolution and color depth:
http://www.vdsworld.com/forum/viewtopic.php?t=3701

Hooligan

_________________
Hooligan

Why be normal?
Back to top
View user's profile Send private message
wolfsoft
Newbie


Joined: 28 Apr 2004
Posts: 2

PostPosted: Wed Jan 05, 2011 6:48 am    Post subject: Re: Change Screen resolution Reply with quote

Hi,
Last year I wrote a small program for changing display settings on the fly using API calls from user32.dll. This is probably exactly what you are looking for.
For better understanding visit:
http://msdn.microsoft.com/en-us/library/dd183411%28VS.85%29.aspx
and:
http://msdn.microsoft.com/en-us/library/dd162611%28v=VS.85%29.aspx
Greetings, wolfsoft

%T = Change Display Settings
title %T
option fieldsep,x
option errortrap,error
%2 = 0
%D = @binary(LARGEINT,0)
repeat
%D = %D@binary(LARGEINT,0)
%2 = @succ(%2)
until @equal(%2,15)
loadlib user32.dll
%%top = @regread(curuser,Software\Wolfsoft\%T,Top)
%%left = @regread(curuser,Software\Wolfsoft\%T,Left)
if @null(%1)
if @not(@numeric(%%top))@not(@numeric(%%left))
dialog create,%T,-1,0,200,70,smallcap,nomin,ontop,snap
else
dialog create,%T,%%top,%%left,200,70,smallcap,nomin,ontop,snap
end
dialog add,combo,c1,5,5,190,20,,,list
dialog add,button,b1,35,50,100,30,&Change
else
if @equal(%1,tray)
dialog create,%T
dialog add,taskicon,tray,,%T
else
parse "%3;%4;%5;%6",%1
if @null(%3)@null(%4)@null(%5)@null(%6)
if @msgbox(Wrong parameters.,%T,$10)
goto close
end
end
end
list create,1
end
%2 = 0
repeat
%A = @lib(user32,EnumDisplaySettingsA,INT:,0,INT:%2,INT:@addr("%D"))
if @null(%1)
list add,c1,@val(@substr(%D,105))x@val(@substr(%D,109,110))x@val(@substr(%D,113,114))x@val(@substr(%D,121))
else
list add,1,@val(@substr(%D,105))x@val(@substr(%D,109,110))x@val(@substr(%D,113,114))x@val(@substr(%D,121))
end
%2 = @succ(%2)
until @zero(%A)
%A = @lib(user32,EnumDisplaySettingsA,INT:,0,INT:-1,INT:@addr("%D"))
%C = @val(@substr(%D,105))x@val(@substr(%D,109,110))x@val(@substr(%D,113,114))x@val(@substr(%D,121))
%2 = 0
if @null(%1)
repeat
list seek,c1,%2
if @equal(@item(c1),%C)
%2 = -1
end
%2 = @succ(%2)
until @zero(%2)
dialog show
else
if @unequal(%1,tray)
repeat
list seek,1,%2
if @equal(@item(1),%1)
%2 = -1
end
%2 = @succ(%2)
until @zero(%2)@equal(@count(1),%2)
if @equal(@count(1),%2)
if @msgbox(Illegal values submitted.,%T,$10)
goto close
end
end
%D = @substr(%D,1,104)@binary(BYTE,%3)@substr(%D,106,108)@binary(WORD,%4)@substr(%D,111,112)@binary(WORD,%5)@substr(%D,115,120)@binary(BYTE,%6)@substr(%D,122,128)
%A = @lib(user32,ChangeDisplaySettingsA,INT:,INT:@addr("%D"),INT:0)
goto close
end
%2 = 0
repeat
%I = @item(1,%2)
parse "%3;%4;%5;%6",%I
parse "%3;%4;%5;%7",%C
if @equal(%6,%7)
%M = %M%I|
end
%2 = @succ(%2)
until @equal(@count(1),%2)
end

:evloop
wait event
%E = @event()
%F = @lower(@substr(%E,1,@diff(@len(%E),4)))
if @equal(@substr(%F,2),x)@equal(@substr(%F,3),x)
if @unequal(%F,exit)
parse "%3;%4;%5;%6",%F
%E = fromTRAY
end
end
goto %E

:trayCLICK
if @equal(@click(B),RIGHT)
if @equal(@regread(curuser,Software\Microsoft\Windows\CurrentVersion\Run,%T),@shortname(%0)@chr(32)tray)
dialog popup,Do not start with Windows|-|Exit
else
dialog popup,Start with Windows|-|Exit
end
end
if @equal(@click(B),LEFT)
dialog popup,%M
end
goto evloop

Very Happyo not start with WindowsMENU
registry delete,curuser,Software\Microsoft\Windows\CurrentVersion\Run,%T
goto evloop

:Start with WindowsMENU
registry write,curuser,Software\Microsoft\Windows\CurrentVersion\Run,%T,@shortname(%0)@chr(32)tray
goto evloop

:b1BUTTON
parse "%3;%4;%5;%6",@dlgtext(c1)
:fromTRAY
%D = @substr(%D,1,104)@binary(BYTE,%3)@substr(%D,106,108)@binary(WORD,%4)@substr(%D,111,112)@binary(WORD,%5)@substr(%D,115,120)@binary(BYTE,%6)@substr(%D,122,128)
%A = @lib(user32,ChangeDisplaySettingsA,INT:,INT:@addr("%D"),INT:0)
goto evloop

:exitMENU
:closeMENU
:error
freelib user32.dll
if @null(%1)
registry write,curuser,Software\Wolfsoft\%T,Top,@dlgpos(,T)
registry write,curuser,Software\Wolfsoft\%T,Left,@dlgpos(,L)
end
exit
Back to top
View user's profile Send private message Send e-mail Visit poster's website
marcelo
Contributor
Contributor


Joined: 10 May 2008
Posts: 155

PostPosted: Thu Jan 06, 2011 3:03 pm    Post subject: Reply with quote

EXCELLENT!!!
Thanks a lot!!!
I think this is all i need!!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group