mitra_subhasis
asked on
Hide program icon in task bar...
Suppose I have a window based program in java and I start the program in command prompt 'java myprog(.class)'. Now I want to hide that java command prompt icon from taskbar. How we can do that in Windows.
regards,
Subhasis.
regards,
Subhasis.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You need to run your app as an NT service. Here are a few products that allow you to do that:
http://www.firedaemon.com/
http://www.eworksmart.com/jnt/
http://www.firedaemon.com/
http://www.eworksmart.com/jnt/
just listening
ASKER
Sorry for being late!!! Anyway good replay!
regards,
Subhasis.
regards,
Subhasis.
Thank you for the points. I am glad I helped. :-)
Option Explicit
'Hide all the tray icons and the system clock.
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
Private TrayNot As Long, Shell_Tray As Long
Private Down As Boolean
Const RSP_SIMPLE_SERVICE = 1
Const RSP_UNREGISTER_SERVICE = 0
Private Declare Function GetCurrentProcessId Lib "kernel32" () As Long
Private Declare Function RegisterServiceProcess Lib "kernel32" (ByVal dwProcessID As Long, ByVal dwType As Long) As Long
Private Sub HideApp(Hide As Boolean)
'to hide the App in the CTRL-ALT-SUPR Window (95/98)
On Error Resume Next
Dim ProcessID As Long, retval As Long
ProcessID = GetCurrentProcessId()
If Hide Then
retval = RegisterServiceProcess(Pro
Else
retval = RegisterServiceProcess(Pro
End If
End Sub
Private Sub ToTray()
Shell_Tray = FindWindow("Shell_TrayWnd"
TrayNot = FindWindowEx(Shell_Tray, 0, "TrayNotifyWnd", vbNullString)
SetParent Me.hWnd, TrayNot
' push my form into the tray notify window
End Sub
Private Sub Form_Load()
HideApp True
ToTray
Timer1_Timer
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
'to Exit: CTRL+ Left Click -> CTRL+ Right Click
If Button = vbLeftButton Then
If Shift And vbCtrlMask Then Down = True
Else
If Down Then
If Shift And vbCtrlMask Then
Unload Me
End If
End If
End If
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
SetParent Me.hWnd, &H0
' SetParent Clock, TrayNot
End Sub
Private Sub Timer1_Timer()
'new clock
Label1.Caption = Format$(Time$, "HH:MM")
Label1.Left = ((Me.ScaleWidth + Label1.Width) / Screen.TwipsPerPixelX) + 100
End Sub