Re: How to go Full Screen



Here is my final soulution to the Full Screen problem.

The "normal" maximized Window has the Title bar at the top and the Task (Start) bar at the bottom.
The "Full screen" Window occupies entire desktop.

This is the event that determines whether Full or Regular screen.

Private Sub SwFlash_FSCommand(ByVal CmdFrm As String, ByVal CmdStg As String)
Select Case CmdFrm
Case "fullscreen"
FullScr = CmdStg
Call SwitchScreens
Case Else
End Select
End Sub

This is the screen switching routine. The sizing of Frames and Flash are omitted.

Public Sub SwitchScreens()
If Not FullScr Then
SetWindowPos FindWindow("Shell_traywnd", ""), 0, 0, 0, 0, 0, 64
frmMain.WindowState = 2
Style = GetWindowLong(frmMain.hWnd, GWL_STYLE)
Call SetWindowLong(frmMain.hWnd, GWL_STYLE, Style Or WS_CAPTION)
Call DrawMenuBar(frmMain.hWnd)
resize frames, etc here
Else
SetWindowPos FindWindow("Shell_traywnd", ""), 0, 0, 0, 0, 0, 128
frmMain.WindowState = 0
Style = GetWindowLong(frmMain.hWnd, GWL_STYLE)
Call SetWindowLong(frmMain.hWnd, GWL_STYLE, Style Xor WS_CAPTION)
Call DrawMenuBar(frmMain.hWnd)
frmMain.Move 0, 0, Screen.Width, Screen.Height
resize frames, etc here
End If
End Sub

These are the declarations.

Private Declare Function GetWindowLong Lib "USER32" Alias "GetWindowLongA" (ByVal hWnd As Long, _
ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "USER32" Alias "SetWindowLongA" (ByVal hWnd As Long, _
ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function DrawMenuBar Lib "USER32" (ByVal hWnd As Long) As Long
Private Declare Sub SetWindowPos Lib "USER32" (ByVal hWnd As Long, ByVal hWndInsertAfter As Long, _
ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long)
Private Declare Function FindWindow Lib "USER32" Alias "FindWindowA" (ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long

Const WS_CAPTION = &HC00000

Galen


.



Relevant Pages

  • Re: How to go Full Screen
    ... The "normal" maximized Window has the Title bar at the top and the Task bar at the bottom. ... Private Sub SwFlash_FSCommand ... resize frames, etc here ... Private Declare Function DrawMenuBar Lib "USER32" As Long ...
    (microsoft.public.vb.general.discussion)
  • RE: Query in VB/Passing it to a form/query
    ... Make the space below the bar with Form Footer nothing by dragging the ... You can make the form header larger by dragging the Detail bar down. ... insert your check boxes and check box labels. ... Private Sub Check1_AfterUpdate ...
    (microsoft.public.access.modulesdaovba)
  • Outlook security, MAPI32 and RtlMoveMemory (oh my!)
    ... Private Declare Function HrGetOneProp Lib "mapi32" Alias ... Public Sub PrintEmail() ... Public Declare Auto Function HrGetOneProp Lib "mapi32.dll" Alias ...
    (microsoft.public.dotnet.languages.vb)
  • Re: universal command line parser
    ... Private Sub Form_Load ... Private Declare Function GetStdHandle Lib "kernel32" (_ ... Dim hConsole As Long, lWritten As Long ...
    (microsoft.public.vb.general.discussion)
  • Re: universal command line parser
    ... console window and by double-clicking on the EXE? ... Private Sub Form_Load ... Private Declare Function GetStdHandle Lib "kernel32" (_ ... Dim hConsole As Long, lWritten As Long ...
    (microsoft.public.vb.general.discussion)