The Design of Software (CLOSED)

A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.

The "Design of Software" discussion group has been merged with the main Joel on Software discussion group.

The archives will remain online indefinitely.

VB6 application window size limit

Hello all.

I'm supporting an older app that looks like it was done in VB6. It runs in full screen mode in XP, and when run on a widescreen laptop, the graphics don't align correctly.

What I would like to do is run the app in a sandbox that would limit the window to a 4:3 aspect ratio. Has anybody done anything like this before, or know of a product or utility?

anon this time around
Tuesday, August 19, 2008
Wouldn't it be easier to check why the graphics don't align as expected?

You could try to put all controls inside a centered PictureBox which resizes in a 4:3 way inside the main form too.
Rafa Vargas Send private email
Tuesday, August 19, 2008
I've seen display problems related to a different DPI than you're expecting, so you may want to check that as well - there's a chance that just being in a 4:3 window wouldn't fix the display.
D. Lambert Send private email
Tuesday, August 19, 2008
A quick search turned up which says it supports creating a virtual desktop at a different resolution to the normal one.

The obvious cheaper option is to run it in a virtual machine, which is set to an appropriate screen resolution.
Tuesday, August 19, 2008
VB6 didn't support automatic control resizing.  You have to write the code yourself (or use a third-party tool).

Maybe the resize code can't handle the widescreen resolutions?
Eric D. Burdo Send private email
Wednesday, August 20, 2008
Sorry guys, I wasn't clear enough. I'm not maintaining the code, just supporting the app in an IT fashion.

A virtual machine isn't really an option, but some sort of window manager is possible, if one exists.
anon this time around
Thursday, August 21, 2008
Virtual PC?

Then you can control the window size.
Eric D. Burdo Send private email
Friday, August 22, 2008
Eli Golovinsky, a poster on this forum, created a small window manager he called Spleet, last year.  I think it would do exactly what you want.  Do a search on the archives here, then contact him.  I just found the archive myself and he hasn't done anything with it since I played with it then, but there were also some other options listed by others - and they might also do what you want.

Basically, these are windowing systems that allow you to drag your app into a window that acts kind of like a virtual desktop - sort-of.  But it's not a virtual machine so it might work for you.

I think your basic problem is that the developer of your app turned on the "stretch" function of the graphics control, so if the app runs in an aspect ration other than the 4:3 ratio expected from older monitors everything gets elongated horizontally.
Karl Perry Send private email
Sunday, August 24, 2008
You can try Spleet, but I think a much simpler solution would work for your particular case. You can use Win32 API to resize a window even if it is maximized, and it's not as hard as it may sound.

Here are three lines of Python code that resize a Notepad window to 1024x768 even when it's maximized.

from ctypes import windll
hwnd = windll.user32.FindWindowA("Notepad", None)
windll.user32.MoveWindow(hwnd, 0, 0, 1024, 768, True)
Eli Golovinsky (Testuff) Send private email
Monday, August 25, 2008
I suggest you get an elastic OCX and embed in your VB form. They can resize the controls dynamically...
Friday, September 05, 2008

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
Powered by FogBugz