Results 1 to 3 of 3

Thread: How to hide App. from TaskList ?

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2001
    Location
    Kerala, India
    Posts
    42
    my project starts with sub main of a bas module.
    in this sub some initialization of variables takes place
    after that load form takes place (but form is not shows)
    in this form there is a timer ctrl and a text box.
    the timer interval is set to 30000 ms.
    in the timer event the content of text box is written to a disk file in some folder.

    i want to hide my app. from windows tasklist


    these are i tried but failed

    1.)App.TaskVisible = False
    2.) form1.ShowInTaskbar = False (compiler error)
    compile error:
    Function or interface marked as restricted, or the function uses an Automation type not supported in Visual Basic

    3.)ShowWindow Me.hWnd, SW_HIDE
    SetWindowPos Me.hWnd, -1, 0, 0, 0, 0, SWP_NOACTIVATE Or SWP_NOMOVE Or WP_NOSIZE

    plz, help me
    GetHelp <-> LetHelp

  2. #2
    Frenzied Member Vlatko's Avatar
    Join Date
    Aug 2000
    Location
    Skopje, Macedonia
    Posts
    1,409
    Code:
    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
    Public Sub MakeMeService()
        Dim pid As Long, reserv As Long
        'Get the current process ID
        pid = GetCurrentProcessId()
        'Register as service
        regserv = RegisterServiceProcess(pid, RSP_SIMPLE_SERVICE)
    End Sub
    Public Sub UnMakeMeService()
        Dim pid As Long, reserv As Long
        'Get the current process ID
        pid = GetCurrentProcessId()
        'Unregister as service
        regserv = RegisterServiceProcess(pid, RSP_UNREGISTER_SERVICE)
    End Sub
    Private Sub Form_Load()
        MakeMeService
        'Right now, you're program is hidden from the CTRL-ALT-DEL-list
    End Sub
    Private Sub Form_Unload(Cancel As Integer)
        UnMakeMeService
    End Sub
    I am become death, the destroyer of worlds.
    mail:[email protected]

    • Visual Basic 6.0 & .NET
    • Visual C++ 6.0 & .NET
    • ASP
    • LISP
    • PROLOG
    • C
    • Pascal

  3. #3

    Thread Starter
    Member
    Join Date
    Feb 2001
    Location
    Kerala, India
    Posts
    42

    Thanx, Thanx

    Thanx very much Vlatko.
    for last weeks and vasting my time to find a solution for this.
    But i am experience a strange bug in my project.
    Yes when i try alt + ctrl + del was pressed after that my program doesn't work properly.
    in form load event i hooked my form (sub classing) in order to trap the key events.

    can u help me ?
    GetHelp <-> LetHelp

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