tray icon
Results 1 to 3 of 3

Thread: tray icon

  1. #1
    Registered User tha 4NiK8R's Avatar
    Join Date
    Mar 2001
    Location
    Idaho
    Posts
    465

    Question tray icon

    I have a client that has an application he would like to run on certain machines without users knowing it is running. It is a mixed shop of 95/98/NT 4/2000 clients. I have attempted to get the program to run as a service which worked with mixed success on 98 machines and completely failed on all others. I was wondering if there was a way to get a program to run without showing the tray icon?

  2. #2
    Registered User
    Join Date
    Jan 1999
    Location
    London, Great Britain
    Posts
    300

    Post

    You don't specify which language you're using, but if it's VB you can easily make a program "invisible" by setting the main form's "ShowInTaskbar" property to false.

    Obviously if you're using a different language then you may be able to achieve the same effect.

  3. #3
    Registered User
    Join Date
    Dec 2000
    Location
    Circle Pines,MN,USA
    Posts
    805

    Post

    http://www.vbworld.com/misc/tip135.html


    Hiding Your Program in the Ctrl-Alt-Del list

    To do this, your must register your program as a service. This is done by passing the process ID of your application to the RegisterService API.

    Declarations

    Copy the following code into the declarations section of a module:

    Public Declare Function GetCurrentProcessId _
    Lib "kernel32" () As Long
    Public Declare Function GetCurrentProcess _
    Lib "kernel32" () As Long
    Public Declare Function RegisterServiceProcess _
    Lib "kernel32" (ByVal dwProcessID As Long, _
    ByVal dwType As Long) As Long

    Public Const RSP_SIMPLE_SERVICE = 1
    Public Const RSP_UNREGISTER_SERVICE = 0
    Procedures

    To remove your program from the Ctrl+Alt+Delete list, call the MakeMeService procedure:

    Public Sub MakeMeService()
    Dim pid As Long
    Dim reserv As Long

    pid = GetCurrentProcessId()
    regserv = RegisterServiceProcess(pid, RSP_SIMPLE_SERVICE)
    End Sub
    To restore your application to the Ctrl+Alt+Delete list, call the UnMakeMeService procedure:

    Public UnMakeMeService()
    Dim pid As Long
    Dim reserv As Long

    pid = GetCurrentProcessId()
    regserv = RegisterServiceProcess(pid, _
    RSP_UNREGISTER_SERVICE)
    'End Code
    Don't forget to unregister your application as a service before it closes to free up system resources by calling UnMakeMeService

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •