Results 1 to 8 of 8

Thread: Hideing OTHER prgms

  1. #1

    Thread Starter
    Member awuh0's Avatar
    Join Date
    Feb 2003
    Posts
    53

    Hideing OTHER prgms

    how would i hide another prgm ... right now i have it able to put itself to the sys tray and get all other running programs in a list...
    so id like to highlight it and hide it kinda like the

    me.WindowState = vbMinimized
    me.Hide

    but i dunno how to do this with other programs...
    ( i can get the caption of the program and the process ID)

  2. #2
    Junior Member
    Join Date
    Jan 2002
    Posts
    28
    I think this API should do it;


    VB Code:
    1. Declarations:
    2. Public Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
    3. Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
    4.  
    5. Code:
    6. Dim window As Long
    7. window = FindWindow("window", vbNullString)
    8. Call ShowWindow(window, SW_HIDE)

    I am kinda new to API, but something along those lines!

  3. #3

    Thread Starter
    Member awuh0's Avatar
    Join Date
    Feb 2003
    Posts
    53
    well.... other than the fact that it pretended SW_HIDE was a variable it did allright i guess...

    also... im gona need to know how to un hide it...

  4. #4
    Junior Member
    Join Date
    Jan 2002
    Posts
    28
    Sorry forgot your constants;

    Constants:
    VB Code:
    1. Public Const SW_HIDE = 0
    2. Public Const SW_MAXIMIZE = 3
    3. Public Const SW_MINIMIZE = 6
    4. Public Const SW_NORMAL = 1
    5. Public Const SW_SHOW = 5

    Code to show the window again;
    VB Code:
    1. Call ShowWindow(window, SW_SHOW)


    Hope this helps.

  5. #5

    Thread Starter
    Member awuh0's Avatar
    Join Date
    Feb 2003
    Posts
    53
    now it sez that constants are not allowed to be public... is this suppose to be in a modual?

  6. #6

    Thread Starter
    Member awuh0's Avatar
    Join Date
    Feb 2003
    Posts
    53
    well i put them down as private const

    but it sez i need a function 4 the Call ShowWindow

    .... ie sub function not defined
    Last edited by awuh0; Apr 3rd, 2003 at 12:31 AM.

  7. #7

    Thread Starter
    Member awuh0's Avatar
    Join Date
    Feb 2003
    Posts
    53
    okay... mabey im not being specific enough... my app makes a list of all da running programs... i select one and then can do a variety to things to it (right now only killing it works...) but i would like to make it so i could make it disapear from the tast bar and then be unhidden at a latter time.
    Last edited by awuh0; Apr 3rd, 2003 at 12:15 PM.

  8. #8

    Thread Starter
    Member awuh0's Avatar
    Join Date
    Feb 2003
    Posts
    53
    anyone?

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