Results 1 to 6 of 6

Thread: Forcing a Window to minimize

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2005
    Posts
    107

    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 . 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

  2. #2
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    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.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Feb 2005
    Posts
    107

    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....

  4. #4
    Frenzied Member dis1411's Avatar
    Join Date
    Mar 2001
    Posts
    1,048

    Re: Forcing a Window to minimize

    Me.WindowState = vbMinimized ?

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Feb 2005
    Posts
    107

    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

  6. #6
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Forcing a Window to minimize

    Try this:
    VB Code:
    1. Option Explicit
    2.  
    3. Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, _
    4. ByVal nCmdShow As Long) As Long
    5. Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
    6. (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
    7.  
    8. Private Const SW_MINIMIZE = 6
    9.  
    10. Private Sub Command1_Click()
    11. Dim lHandle As Long
    12.  
    13. lHandle = FindWindow(vbNullString, "Caption Of Window To Be Minimized")
    14. If lHandle = 0 Then Exit Sub
    15. Call ShowWindow(lHandle, SW_MINIMIZE)
    16. End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width