Why the forms gets transformed when in game and not restored back when in desktop?
I have an application that must works in background of a gamming enviroment.
The problem by example, I have some window sized like 1000x400,
continuing with the example, run a game that switch to 800x600 truecolor video mode. Ok?
now, when the game is closed, all my VB forms are CLIPPED to 800 width visualy.
why it happens?, what have to do any low resolution games old or new, with VB desktop apps anyway?
how to fix this issue, is there a way to know using an event when the screen resolution is changed? or I must test screen size each second.
It is a full resize reflecting it on the width/height properties? or it is like a windows bug or something?
Re: Why the forms gets transformed when in game and not restored back when in desktop
Probably a game bug. They are supposed to use a custom Desktop and not change the resolution on the default Desktop.
If the same thing happens to other programs (Notepad, etc.) I think you're stuck.
Re: Why the forms gets transformed when in game and not restored back when in desktop
You could try subclassing your Form and watching for WM_DISPLAYCHANGE messages.
Re: Why the forms gets transformed when in game and not restored back when in desktop
But is normal behavior, I mean, by example, you can't create a VB FORM Large than the screen resolution, WHY??????? how can be.!
if then the screen resolution changes , all forms gets clipped, I mean it is the usual, I always had that problem, in any VB app.
Atleast in WinXP.
Only that right now I am tired about that *misbehaviour* and want to fix it in a particular APP for gamers.
Re: Why the forms gets transformed when in game and not restored back when in desktop
Quote:
Originally Posted by
Bonnie West
Or just use the SysInfo Control and its DisplayChanged Event which does the same thing w/o manually subclassing.
Re: Why the forms gets transformed when in game and not restored back when in desktop
Code:
Select Case uMsg
Case WM_EXITSIZEMOVE
'Save the Form's newest position and size
Case WM_DISPLAYCHANGE
'If Form.WindowState = vbNormal Then
'restore previous position and size,
'but only if screen dimensions allow
End Select
Re: Why the forms gets transformed when in game and not restored back when in desktop
Testing, I thinks are more a thing when you are in 1024x768 destop, execute counter strike 1.6, it switch 800x600, then exits sometimes it don't restore th desktop correctly (only the monitor is switch back to 1024x768).
So it happens sometimes, not always.
Buy anyway, why when you create & resize VB forms, they are limited to the screen resolution as maximun size?
OLD Tries: I remember sometime, I was thinking in creating a big BIG in width vb form. And to do an effect like a slider related to the mouse position, so VBform.LEFT must go from = -me.width/2 to me.width/2, was something like that, but impossible to create large vbforms without borders, titlebar etc. that slides/hides from the upper part, and slides horizontally. Dropped the idea by that reason.
Anyway stupid approach, but again, why a limit?
Re: Why the forms gets transformed when in game and not restored back when in desktop
Quote:
Originally Posted by
flyguille
Buy anyway, why when you create & resize VB forms, they are limited to the screen resolution as maximun size?
... but again, why a limit?
From GetSystemMetrics function:
SM_CXMAXTRACK
59 |
The default maximum width of a window that has a caption and sizing borders, in pixels. This metric refers to the entire desktop. The user cannot drag the window frame to a size larger than these dimensions. A window can override this value by processing the WM_GETMINMAXINFO message. |
SM_CYMAXTRACK
60 |
The default maximum height of a window that has a caption and sizing borders, in pixels. This metric refers to the entire desktop. The user cannot drag the window frame to a size larger than these dimensions. A window can override this value by processing the WM_GETMINMAXINFO message. |
From MINMAXINFO structure:
ptMaxTrackSize
Type:
POINT
The maximum tracking width (
x member) and the maximum tracking height (
y member) of the window. This value is based on the size of the virtual screen and can be obtained programmatically from the system metrics
SM_CXMAXTRACK and
SM_CYMAXTRACK (see the
GetSystemMetrics function).