From: Noixe on
Hello,

I'm italian, sorry for my bad english :D

I'm using C++ builder 6 on Windows 7 64bit

I want that my application don't appears in activities list (that you can
view with ALT+TAB)

I can't use bsToolWindow property beacause it must be bsNone.

I tried also:
Form1->BorderStyle = bsNone & bsToolWindow
and
Form1->BorderStyle = bsNone | bsToolWindow

But don't work.

Is there a way to do this?

Searching with google, I found this link:
http://www.delphicorner.f9.co.uk/articles/apps3.htm

That show a solution for Delphi.

var
ExtendedStyle : Integer;

begin
Application.Initialize;

//Get the Extended Styles of the Application, by passing its
//handle to GetWindowLong
ExtendedStyle := GetWindowLong(Application.Handle, GWL_EXSTYLE);

//Now, set the Extended Style by doing a bit masking operation.
//OR in the WS_EX_TOOLWINDOW bit, and AND out the WS_EXAPPWINDOW bit
//This effectively converts the application from an App Windows to a
//Tool Window.
SetWindowLong(Application.Handle, GWL_EXSTYLE, ExtendedStyle OR
WS_EX_TOOLWINDOW
AND NOT WS_EX_APPWINDOW);
Application.CreateForm(TForm1, Form1);
Application.Run;
end.


I have adapted it for C++ builder in this way:

Between Application->Initialize() and
Application->CreateForm(__classid(TForm1), &Form1):

int ExtendedStyle = GetWindowLong(Application->Handle, GWL_EXSTYLE);
SetWindowLong(Application->Handle, GWL_EXSTYLE, ExtendedStyle |
WS_EX_TOOLWINDOW & ~WS_EX_APPWINDOW);

But don't work!

Can you help me?

Thanks