🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: microsoft.public.vb.general.discussion
1 messages
1 total messages Started by ObiWan Mon, 05 Oct 2026 07:12
Re: Screen Rotation
#1
Author: ObiWan
Date: Mon, 05 Oct 2026 07:12
72 lines
2443 bytes
:: On Sun, 20 Sep 2026 09:39:14 -0400
:: (microsoft.public.vb.general.discussion)
:: <118onm2$l2d$1@solani.org>
:: StanWeiss <srweiss1@comcast.net> wrote:

> How on lets say a Surface some after loading my program, they rotate
> the Surface from Horizontal to Vertical. How can my program get a 
> notification so it can handle the change?

create a new Vb6 project (standard exe)

menu -> Project -> Components

select "Microsoft SysInfo Control 6.0 (SP6)" from the list and click ok

from the palette, select the sysinfo control ad add it rto the form

now add the following code to the form

Option Explicit

Dim gscrSiz(3) As Long
Dim gnewSiz(3) As Long

' init
Private Sub Form_Load()
  Dim sz(3) As Long
  Dim i As Integer

  With SysInfo1
    sz(0) = .WorkAreaWidth
    sz(1) = .WorkAreaHeight
    sz(2) = .WorkAreaLeft
    sz(3) = .WorkAreaTop
  End With
  For i = 0 To 3
    gscrSiz(i) = sz(i)
  Next
  
  ' do whatever needed

End Sub

' display changed
Private Sub SysInfo1_DisplayChanged()
  Static bWorking As Boolean
  Dim sz(3) As Long
  Dim i As Integer
  
  If bWorking Then Exit Sub
  bWorking = True
  
  With SysInfo1
    sz(0) = .WorkAreaWidth
    sz(1) = .WorkAreaHeight
    sz(2) = .WorkAreaLeft
    sz(3) = .WorkAreaTop
  End With

  For i = 0 To 3
    gnewSiz(i) = sz(i)
  Next
  
  ' now process changes
  
  ' all done
  bWorking = False
End Sub



Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads