Sorry for the delay, I have been really busy with school and making my space shoot'em up game. Here is the code for making your eVB app full screen.
- Code:
'=======================================
Const SW_HIDE = 0
Const SW_SHOWNORMAL = 1
Const SHFS_SHOWTASKBAR = &H1;
Const SHFS_HIDETASKBAR = &H2;
Const SHFS_SHOWSIPBUTTON = &H4;
Const SHFS_HIDESIPBUTTON = &H8;
Const SHFS_SHOWSTARTICON = &H10;
Const SHFS_HIDESTARTICON = &H20;
Const HWND_TOPMOST = -1
Const HWND_NOTOPMOST = -2
Const SWP_SHOWWINDOW = &H40;
Const SM_CXSCREEN = &H0;
Const SM_CYSCREEN = &H1;
Const HHTASKBARHEIGHT = 26
'===================================================
Dim bShowMenu As Boolean
Dim bShowStart As Boolean
Dim bShowTaskbar As Boolean
Dim bFullScreen As Boolean
Dim lHwnd As Long
'=======================================
Declare Function GetSystemMetrics Lib "Coredll" ( _
ByVal nIndex As Long) As Long
Declare Function SHFullScreen Lib "aygshell" ( _
ByVal hwndRequester As Long, _
ByVal dwState As Long) As Boolean
Declare Function MoveWindow Lib "Coredll" ( _
ByVal hWnd As Long, _
ByVal X As Long, _
ByVal Y As Long, _
ByVal nWidth As Long, _
ByVal nHeight As Long, _
ByVal bRepaint As Long) As Long
Declare Function SetForegroundWindow Lib "Coredll" ( _
ByVal hWnd As Long) As Boolean
Declare Function GetLastError Lib "Coredll" () As Long
Declare Function ShowWindow Lib "Coredll" ( _
ByVal hWnd As Long, _
ByVal nCmdShow As Long) As Long
Declare Function FindWindow Lib "Coredll" Alias "FindWindowW" ( _
ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long
'=======================================
'=======================================
Private Sub Full_Screen()
Dim lret
If bFullScreen Then
lret = FindWindow("menu_worker", "")
If lret <> 0 Then 'window found
ShowWindow lret, SW_SHOWNORMAL
End If
lret = SetForegroundWindow(Me.hWnd)
lret = MoveWindow(Me.hWnd, 0, HHTASKBARHEIGHT, _
GetSystemMetrics(SM_CXSCREEN), _
GetSystemMetrics(SM_CYSCREEN), True)
Else
'show form full screen
lret = FindWindow("menu_worker", "")
If lret <> 0 Then 'window found
ShowWindow lret, SW_HIDE
End If
lret = SetForegroundWindow(Me.hWnd)
lret = MoveWindow(Me.hWnd, 0, 0, _
GetSystemMetrics(SM_CXSCREEN), _
GetSystemMetrics(SM_CYSCREEN) + HHTASKBARHEIGHT, 0)
End If
bFullScreen = Not bFullScreen
End Sub
'=======================================
Private Sub StartFullScreen()
'Nedanstående fixar fullscreen
bShowMenu = True
bShowStart = True
bShowTaskbar = True
bFullScreen = False
lHwnd = Form1.hWnd
Call Full_Screen
Call Hide_Menu
Call Hide_Start
Call Hide_Taskbar
End Sub
'=======================================
Private Sub Hide_Menu()
Dim lret
lret = SetForegroundWindow(lHwnd)
If bShowMenu Then
lret = SHFullScreen(lHwnd, SHFS_HIDESIPBUTTON)
Else
lret = SHFullScreen(lHwnd, SHFS_SHOWSIPBUTTON)
End If
bShowMenu = Not bShowMenu
End Sub
'=======================================
'=======================================
Private Sub Hide_Start()
Dim lret
lret = SetForegroundWindow(lHwnd)
If bShowStart Then
lret = SHFullScreen(lHwnd, SHFS_HIDESTARTICON)
Else
lret = SHFullScreen(lHwnd, SHFS_SHOWSTARTICON)
End If
bShowStart = Not bShowStart
End Sub
'=======================================
'=======================================
Private Sub Hide_Taskbar()
Dim lret
lret = SetForegroundWindow(lHwnd)
If bShowTaskbar Then
lret = SHFullScreen(lHwnd, SHFS_HIDETASKBAR)
Else
lret = SHFullScreen(lHwnd, SHFS_SHOWTASKBAR)
End If
bShowTaskbar = Not bShowTaskbar
End Sub
Private Sub Timer1_Timer()
Call StartFullScreen
End Sub
Yeah you have to use a timer to call StartFullScreen, over and over. If you don't and you launch another app while yours is running it will return to part screen.
If you're serious about making PPC games with eVB, I would highly reccomend the ASpriteCE ActiveX control. I's a hybrid of C++ and Evb and gives you the speed of a C++ app. I just got it a month or so ago, and I love it! The speed is incredible! And no flickering, yay!