Results 1 to 2 of 2

Thread: Hideing a window

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2000
    Location
    Texas
    Posts
    313

    Question

    is there a win api function to hide a window? if you just know either the name or the handle?

  2. #2
    Guest
    Here is how to find the window by it's caption and then hide it:

    Code:
    Private Declare Function FindWindow Lib "user32.dll" Alias "FindWindowA" (ByVal lpClassName As Any, ByVal lpWindowName As Any) As Long
    Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As
    Long) As Long
    
    Public Const SW_SHOW = 5
    Public Const SW_HIDE = 0
    
    h = FindWindow(vbNullString, "Calculator")
    
    If h <> 0 Then
    'To show the window again, change SW_HIDE to SW_SHOW
    ShowWindow h, SW_HIDE 
    Else
    MsgBox "Window was not found!", 16
    End If

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