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?
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?