Results 1 to 4 of 4

Thread: Hiding-Unhiding an app. (EXTERNAL application)

  1. #1

    Thread Starter
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808

    Question Hiding-Unhiding an app. (EXTERNAL application)

    What's the way to hide and unhide an external application, such as Outlook. I mean, I want the program to be running, but on the background and that could not get focus unless you unhide it. Am I clear?
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  2. #2
    Fanatic Member Kings's Avatar
    Join Date
    Aug 2001
    Posts
    673
    Use this code,


    put this in a module:
    VB Code:
    1. Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
    2. Declare Function ShowWindow Lib "user32" (ByVal hWnd As Long, ByVal nCmdShow As Long) As Long
    3. Public Const WM_CLOSE = &H10

    and put this under a command button

    VB Code:
    1. sdf = FindWindow(vbNullString, "AppNameHere") 'find the window
    2. If sdf = 0 Then
    3. MsgBox "Couldn't find App"
    4. Else
    5. retval = ShowWindow(sdf, SW_HIDE)  ' the command to hide the window
    6. End If


    I think that should work, if you get any errors tell me
    K i n g s

  3. #3
    Fanatic Member Kings's Avatar
    Join Date
    Aug 2001
    Posts
    673
    oh and you can show it using this code

    VB Code:
    1. sdf = FindWindow(vbNullString, "AppNameHere") 'find the window
    2. If sdf = 0 Then
    3. MsgBox "Couldn't find App"
    4. Else
    5. retval = ShowWindow(sdf, SW_SHOW)  ' the command to show the window
    6. End If
    K i n g s

  4. #4

    Thread Starter
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808
    Thanks a lot, Kings. I've already figured out the "show" way, with your first message ;-)
    That DID hide and show the outlook.
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

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