How can I have my app resize the screen
to make the app fit then.. when its
done change it back??
Printable View
How can I have my app resize the screen
to make the app fit then.. when its
done change it back??
I have had this problem to deal with for a project of mine, I built a resolution changing module to do the work but I couldnt stop people from changing the resolution once the app had been activated. The code is quite lengthy so I will email it to you.
Incidentally, if anyone knows how to 'fix' the resolution whilst my app is running I would be interested to know how!
It's probably not a good Idea to change the resolution from your app, if the users monitor can't cope with it for some reason then they'll have to try and sort it out with a blank screen. Not good
I agree with you totally Sam, I dont think an application should alter with any of your windows settings as such. unfortunatly my clients dont share that view at all!
Finally I get to help someone else.
There is an ocx that you can download which is great for this. I am out of town on my laptop, but when I get home tomorrow I will give you the information. You might be able to find it by looking up posts with my name. I had a similar problem and someone told me about this active x control.
It is awesome, all you have to do is put it on your form, no code or anything. The user can adjust his form by just resizing it with the border, and all objects resize.
It is magic.
Good Luck,
Sal
Cool!
But can I tell it to resize everything
acording to the screen width, and heighth?
(Its a screensaver)
Or you could make your app have no borders and then just resize the user's resolution, you can check to see if directx can resize or not, if something happens, for example if some kinda error happens and it doesn't resize, you could do a error checking thing in the code and tell the user that it's not able to run on their computer, cause it needs to be run in 800x600 enviorment, here's some code for ya to resize the screen.. u have to have dirextx7 and need to include it in your project.
and that's it.. to make them not able to set their display mode to anything else, just make your program, borderless, controlboxless.. and stuff like that... Well all of my programs are graphically rich, so doing this usually doesn't hurt me, since it looks to the user as if the 'application' is a 'game', but it usually also worx with non graphically rich application...Code:Dim dx As New DirectX7
Dim dd As DirectDraw7
Private Sub Form_Load()
Set dd = dx.DirectDrawCreate("")
dd.SetCooperativeLevel Me.hwnd, DDSCL_FULLSCREEN Or DDSCL_EXCLUSIVE Or DDSCL_ALLOWMODEX
dd.SetDisplayMode 800, 600, 16, 0, DDSDM_DEFAULT
End Sub
Private Sub Form_Unload(Cancel As Integer)
dd.RestoreDisplayMode
Set dx = Nothing
Set dd = Nothing
End Sub
I need something to use that code.
Umm do you need a controll..
It says Custom type not defined..
What do I do?
Yea, you need to have DirectX7, and if you have it, all you do is goto, Project->Refrences and add DirectX7TypeLibrary or something like that, to your project, and that way it'll work...
Hey Sal-
I REALLY need that OCX. Can you email it to me?
mailto:[email protected]
BTW, You never called me...
It is called the Resize OCX and the website is http://www.lyoung.com
The phone number for registering the OCX is United States 888-850-9911
I think it is the best thing since sliced bread.
Good Luck!
Sal