Article View: microsoft.public.vb.general.discussion
Article #1Re: Screen Rotation
From: ObiWan
Date: Mon, 05 Oct 2026 07:12
Date: Mon, 05 Oct 2026 07:12
72 lines
2443 bytes
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
Technical Details
Message-ID:
<119vil6$rjgk$1@solani.org>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mailReferences:
<118onm2$l2d$1@solani.org>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail From: ObiWan <obiwan@mvps.org.invalid> Newsgroups: microsoft.public.vb.general.discussion Subject: Re: Screen Rotation Date: Mon, 5 Oct 2026 09:12:38 +0200 Organization: n/a Message-ID: <119vil6$rjgk$1@solani.org> References: <118onm2$l2d$1@solani.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Injection-Date: Mon, 5 Oct 2026 07:12:38 -0000 (UTC) Injection-Info: solani.org; logging-data="904724"; mail-complaints-to="abuse@news.solani.org" Cancel-Lock: sha1:/F6A98oZOae7uay1xtPkCEubgAo= X-User-ID: eJwNxcEBwEAEBMCWECuUc9bpv4RkPoMnNPh6IByLde+jgpxhmupaFnkdQdiVbftrqa66Myf5ARwbEY8=