|
-
Apr 2nd, 2003, 03:08 PM
#1
Thread Starter
Member
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)
-
Apr 2nd, 2003, 05:16 PM
#2
Junior Member
I think this API should do it;
VB Code:
Declarations:
Public Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Code:
Dim window As Long
window = FindWindow("window", vbNullString)
Call ShowWindow(window, SW_HIDE)
I am kinda new to API, but something along those lines!
-
Apr 2nd, 2003, 07:22 PM
#3
Thread Starter
Member
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...
-
Apr 2nd, 2003, 07:31 PM
#4
Junior Member
Sorry forgot your constants;
Constants:
VB Code:
Public Const SW_HIDE = 0
Public Const SW_MAXIMIZE = 3
Public Const SW_MINIMIZE = 6
Public Const SW_NORMAL = 1
Public Const SW_SHOW = 5
Code to show the window again;
VB Code:
Call ShowWindow(window, SW_SHOW)
Hope this helps.
-
Apr 2nd, 2003, 07:46 PM
#5
Thread Starter
Member
now it sez that constants are not allowed to be public... is this suppose to be in a modual?
-
Apr 3rd, 2003, 12:23 AM
#6
Thread Starter
Member
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.
-
Apr 3rd, 2003, 12:56 AM
#7
Thread Starter
Member
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.
-
Apr 3rd, 2003, 12:16 PM
#8
Thread Starter
Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|