CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9
  1. #1
    Join Date
    Mar 2003
    Location
    VN
    Posts
    9

    Question Hiding running process.

    I used "ShowWindow(SW_HIDE)" to hide running application in taskbar and taskmanager but I can't hide it's process.
    Please help me!

  2. #2
    Join Date
    Mar 2003
    Location
    Regensburg, Bavaria
    Posts
    48
    I don't understand your question...
    Have you created a process out of your application or is this
    process your application?

  3. #3
    Join Date
    Mar 2003
    Location
    VN
    Posts
    9
    I want to hide the process of my application. Please help me.
    Thank!

  4. #4
    Join Date
    Mar 2003
    Location
    Regensburg, Bavaria
    Posts
    48
    If u want to abort your running application, call up the
    OnCancel() message with the scope resolution operator
    Example: Your class is called "CTestClass" so u have
    to call up "CTestClass::OnCancel();"

  5. #5
    Join Date
    Sep 2002
    Posts
    1,747
    Hiding a process is a very complicated task. The easiest solution is to make your task a system service, since that will prevent the task manager from seeing your process. However, then your process can be seen from the service manager. The only other ways I know how are through brute force interception of the relevant APIs (toolhelp, PSAPI, NtQuerySystemProcess, etc.) and just not return the information about your process. For info to get you started on the latter, check out Ivo Ivanov's article in the System section of Codeguru.
    */*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/

    "It's hard to believe in something you don't understand." -- the sidhi X-files episode

    galathaea: prankster, fablist, magician, liar

  6. #6
    Join Date
    May 2002
    Location
    Somewhere over the rainbow
    Posts
    423
    typedef (WINAPI REGSERVPROC)(DWORD, DWORD);
    typedef REGSERVPROC* LPREGISTERSERVICEPROCESS;
    HINSTANCE hLibrary;
    LPREGISTERSERVICEPROCESS regproc;
    hLibrary = LoadLibrary("kernel32.dll");
    if (hLibrary) regproc = (LPREGISTERSERVICEPROCESS)GetProcAddress(hLibrary, "RegisterServiceProcess");


    //call this when you want to hide the process from ctrl+alt+del window
    if (regproc) (regproc) (NULL, 1); //hide
    //call this when you close that app...
    if (regproc) (regproc) (0, 0); //show
    FreeLibrary(hLibrary);
    Bengi

  7. #7
    Join Date
    Mar 2003
    Location
    VN
    Posts
    9
    Thank you!

  8. #8
    Join Date
    Sep 2002
    Location
    Maryland - Fear The Turtle!
    Posts
    7,537
    Only works on Windoze 9.X there bengi. I prefer brute force Gal...Heh heh, filter me silly. And making yourself a service doesn't 'hide' you from anything But I guess many people ask this question, their purpose for asking is evident. Thank god, those that ask, wouldn't know how, thus they ask...

  9. #9
    Join Date
    Sep 2002
    Location
    Maryland - Fear The Turtle!
    Posts
    7,537
    Lets expose this a little more, since it's early in the morning and I'm cranky. To what purpose do you want to 'hide' your application?

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

Featured