VS6 SP5: Problem when screen size changes while VB prog runs 
Author Message
 VS6 SP5: Problem when screen size changes while VB prog runs

I am using Visual Basic 6.0 SP5
When I run a VB prog and change the screen resolution while it runs
(e.g. using QuickRes),
Screen.height is still the same value and screen.width is the HEIGHT of
the new resolution.
When I use GetSystemMetrics, it works fine. (see example below)

In the VB IDE, sometimes it works and sometimes it doesn't. But when I
compile the prog, it never works correctly.

Does anyone know a patch that solves that or a workaround w/o using api
functions?

Michael Schierl

=================================================================
VERSION 5.00
Begin VB.Form Form1
   Caption         =   "Form1"
   ClientHeight    =   3195
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   ScaleHeight     =   3195
   ScaleWidth      =   4680
   StartUpPosition =   3  'Windows-Standard
   Begin VB.CommandButton Command1
      Caption         =   "Refresh"
      Height          =   375
      Left            =   1560
      TabIndex        =   2
      Top             =   1920
      Width           =   2055
   End
   Begin VB.Label Label3
      Caption         =   "Label3"
      Height          =   375
      Left            =   360
      TabIndex        =   3
      Top             =   1440
      Width           =   2175
   End
   Begin VB.Label Label2
      Caption         =   "Label2"
      Height          =   255
      Left            =   360
      TabIndex        =   1
      Top             =   840
      Width           =   3255
   End
   Begin VB.Label Label1
      Caption         =   "Label1"
      Height          =   255
      Left            =   360
      TabIndex        =   0
      Top             =   480
      Width           =   3135
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As
Long) As Long
Private Const SM_CXSCREEN = 0
Private Const SM_CYSCREEN = 1

Private Sub Command1_Click()
Label1 = (Screen.Width / Screen.TwipsPerPixelX)
Label2 = (Screen.Height / Screen.TwipsPerPixelY)
Label3 = GetSystemMetrics(SM_CXSCREEN) & "x" &
GetSystemMetrics(SM_CYSCREEN)
End Sub

Private Sub Form_Load()
Command1_Click
End Sub



Wed, 08 Oct 2003 01:43:46 GMT  
 VS6 SP5: Problem when screen size changes while VB prog runs

Quote:

> I am using Visual Basic 6.0 SP5
> When I run a VB prog and change the screen resolution while it runs
> (e.g. using QuickRes),
> Screen.height is still the same value and screen.width is the HEIGHT of
> the new resolution.

Hey man, I haven't ever seen this.

But just a thought, since no one else has responded -- do you have the
latest
graphics drivers on your machine?

Regards,

    -djm
--



Fri, 10 Oct 2003 15:13:34 GMT  
 VS6 SP5: Problem when screen size changes while VB prog runs

Quote:
> But just a thought, since no one else has responded -- do you have the
> latest
> graphics drivers on your machine?

No, i'm sorry, ATI recommends for Rage II+ cards not to install the
driver from 1998
because it is so buggy. I should install the one from 1997 w/o multi
monitor support.

ATI does not want to support this card because it is already 6 (!!!)
years old.
So I have to use the old one (the new one crashes too often, even at 0%
hardware acceleration.)

And i do not think it's the graphics driver because GetSystemMetrics
gets the correct values AND
it only happens when I change the resolution *while* the prog is running
and not *before*

Michael Schierl



Wed, 15 Oct 2003 04:41:47 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Changing Screen Saver password via a VB prog

2. VS6 SP5 setup missing ?

3. slipstream SP5 into VS6?

4. DBGrid32.ocx only works in VS6 (SP5) Development Environments

5. DBGrid32.ocx only works in VS6 (SP5) Development Environments

6. controls to change when screen resolution or form size is changed

7. HELP!! Changing Screen Size from withing VB

8. HELP!! Changing Screen Size from withing VB

9. Running prog on other PC problem....any help appreciated :O)

10. VB 6 SP5 does not refresh changes made outside of the IDE

11. Changing Screen Size / # of colors

12. Changing Screen size

 

 
Powered by phpBB® Forum Software