Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hide application from task manager WinXP

Status
Not open for further replies.

mironto

Programmer
May 12, 2001
26
SK
I'm trying to write and application that will be hidden from task manager (won't appear in task bar + will not be visible when switching with ALT+TAB). On internet I found this example

WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
DWORD dwExStyle = GetWindowLong(Application->Handle, GWL_EXSTYLE);
dwExStyle |= WS_EX_TOOLWINDOW;
SetWindowLong(Application->Handle, GWL_EXSTYLE, dwExStyle);

try
{
Application->Initialize();
Application->CreateForm(__classid(TForm1), &Form1);
Application->Run();
}
catch (Exception &exception)
{
Application->ShowException(&exception);
}
return 0;
}

but in WinXP the application is hidden only in task bar, I can still switch to it through ALT+TAB. How can I achieve that the app is visible only in processes list?
I found another example for delphi, where they are adding some other window property (or removing, according to AND NOT)

SetWindowLong(Application.Handle, GWL_EXSTYLE, ExtendedStyle OR WS_EX_TOOLWINDOW AND NOT WS_EX_APPWINDOW);

I realized that in C++ dwExStyle |= WS_EX_TOOLWINDOW; is the same as in delphi OR WS_EX_TOOLWINDOW but I cannot implement that AND NOT WS_EX_APPWINDOW bit. Any ideas?
 
Well, i might not understand what you're looking for but if I should hide a application i would in the first place make it without forms, it's a lot easier to hide if there's nothing to be seen.....

Pascal C
AND NOT WS_EX_APPWINDOW = & ^WS_EX_APPWINDOW

Totte
 
Hi, I was wondering how to hide an application in the task menu from Windows , if it is possible for all versions of windows 9x to 2000 including XP and NT.
In C++ of course.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top