Forcing a Window to minimize
Hello,
I'm currently having problems making a DirectX game window minimise. I can make it maximise but not minimise :mad: . I've seen it done before so I know it's possible. I had a brief moment of success by making the window maximise and then minimise but it's not reliable as it hardly ever works......
Please help :)
Re: Forcing a Window to minimize
Most DirectX games are made to run in full screen mode only. They do not run in windowed mode, unless they were made that way, in which case they don't run in full-screen mode. I don't think you CAN minimize a full-screen app. Sorry.
Re: Forcing a Window to minimize
I know you can :P. If you press Alt-Tab on this game you can make hotkeys for your programme to work. I can maximise but the minimise doesn't work....
Re: Forcing a Window to minimize
Me.WindowState = vbMinimized ?
Re: Forcing a Window to minimize
Quote:
Originally Posted by dis1411
Me.WindowState = vbMinimized ?
It isn't me and it's a fullscreen directX app
Re: Forcing a Window to minimize
Try this:
VB Code:
Option Explicit
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, _
ByVal nCmdShow As Long) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Const SW_MINIMIZE = 6
Private Sub Command1_Click()
Dim lHandle As Long
lHandle = FindWindow(vbNullString, "Caption Of Window To Be Minimized")
If lHandle = 0 Then Exit Sub
Call ShowWindow(lHandle, SW_MINIMIZE)
End Sub