Re: How to go Full Screen



My program interfaces a Flash.swf program and a USB device. There is no GUI per se. Just a Frame
that hosts the Flash.swf.

Show me the 5 lines of code and I'll try it.

Galen

"Sneha Menon" <spiderangelo@xxxxxxxxx> wrote in message
news:1157130212.414165.219260@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi Galen
I am wondering Why!!!
Full Screen is child's play with 5 lines of code
Has using API became a fad?

Sneha
------------------------------------------------------------------------------------------------

Galen Somerville wrote:
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

  • Generalising macro 2 cycle thru checkboxes in frames/pages on User
    ... I have designed a simple prototype in Excel, ... The user checks the checkbox for the step they have just ... a number of pages (each with their own frames and checkboxes). ... Sub PopulateCbxValuesOnInitialise() ...
    (microsoft.public.excel.programming)
  • Re: Checking Options in UserForms Collection
    ... Private Sub cmdOK_Click ... > Dim myOption As Control ... > ' repeat for all frames on the form ... >> Now, if you meant to place the regular macro in the form's code sheet, ...
    (microsoft.public.excel.programming)
  • Re: Checking Options in UserForms Collection
    ... although the form has currently 4 frames (with ... Sub CheckOptions ... >> Dim myOption As Control ...
    (microsoft.public.excel.programming)
  • Re: Word VBA and Web Pages
    ... if the thing has three frames then this routine fires three ... Private Sub Form_Load ... Private Sub Form_Resize ...
    (microsoft.public.word.vba.beginners)