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
|
|
0
|
|
|
|
Reply
|
Noixe
|
1/14/2010 9:38:53 AM |
|
On 14 jan, 10:38, "Noixe" <no...@TOGLIMIemail.it> wrote:
> int ExtendedStyle = GetWindowLong(Application->Handle, GWL_EXSTYLE);
> SetWindowLong(Application->Handle, GWL_EXSTYLE, ExtendedStyle |
> WS_EX_TOOLWINDOW & ~WS_EX_APPWINDOW);
> But don't work!
What doesn't work ?
If I do :
int ExtendedStyle = GetWindowLong(hWnd, GWL_EXSTYLE);
SetWindowLong(hWnd, GWL_EXSTYLE, ExtendedStyle | WS_EX_TOOLWINDOW &
~WS_EX_APPWINDOW);
SetWindowPos(hWnd, 0, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOSIZE |
SWP_NOMOVE | SWP_NOZORDER);
it works.
(Owned windows also don't appear on Alt-Tab...)
|
|
0
|
|
|
|
Reply
|
Christian
|
1/14/2010 6:02:36 PM
|
|
"Christian ASTOR" <castorix@club-internet.fr> ha scritto:
> What doesn't work ?
> If I do :
>
> int ExtendedStyle = GetWindowLong(hWnd, GWL_EXSTYLE);
> SetWindowLong(hWnd, GWL_EXSTYLE, ExtendedStyle | WS_EX_TOOLWINDOW &
> ~WS_EX_APPWINDOW);
> SetWindowPos(hWnd, 0, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOSIZE |
> SWP_NOMOVE | SWP_NOZORDER);
>
> it works.
> (Owned windows also don't appear on Alt-Tab...)
I use Application->Handle, not hWnd. However this code don't work:
int ExtendedStyle = GetWindowLong(Application->Handle, GWL_EXSTYLE);
SetWindowLong(Application->Handle, GWL_EXSTYLE, ExtendedStyle |
WS_EX_TOOLWINDOW & ~WS_EX_APPWINDOW);
SetWindowPos(Application->Handle, 0, 0, 0, 0, 0, SWP_FRAMECHANGED |
SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER);
I see application in alt+tab list
Have you used C++ builder 6?
My operating system is windows 7 64bit
|
|
0
|
|
|
|
Reply
|
Noixe
|
1/14/2010 8:11:21 PM
|
|
Hi!
Am Thu, 14 Jan 2010 21:11:21 +0100 schrieb Noixe:
> "Christian ASTOR" <castorix@club-internet.fr> ha scritto:
>
>> What doesn't work ?
>> If I do :
>>
>> int ExtendedStyle = GetWindowLong(hWnd, GWL_EXSTYLE);
>> SetWindowLong(hWnd, GWL_EXSTYLE, ExtendedStyle | WS_EX_TOOLWINDOW &
>> ~WS_EX_APPWINDOW);
>> SetWindowPos(hWnd, 0, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOSIZE |
>> SWP_NOMOVE | SWP_NOZORDER);
>>
>> it works.
>> (Owned windows also don't appear on Alt-Tab...)
>
> I use Application->Handle, not hWnd. However this code don't work:
> int ExtendedStyle = GetWindowLong(Application->Handle, GWL_EXSTYLE);
> SetWindowLong(Application->Handle, GWL_EXSTYLE, ExtendedStyle |
> WS_EX_TOOLWINDOW & ~WS_EX_APPWINDOW);
> SetWindowPos(Application->Handle, 0, 0, 0, 0, 0, SWP_FRAMECHANGED |
> SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER);
>
> I see application in alt+tab list
>
> Have you used C++ builder 6?
It is important to use the handle of the main *window*.
In a C++ Builder main form TAppForm method you can use simply Handle.
E.g.:
__fastcall TSDIAppForm::TSDIAppForm(TComponent *AOwner)
: TForm(AOwner)
{
int ExtendedStyle = GetWindowLong(Handle, GWL_EXSTYLE);
SetWindowLong(Handle, GWL_EXSTYLE, ExtendedStyle |
WS_EX_TOOLWINDOW & ~WS_EX_APPWINDOW);
SetWindowPos(Handle, 0, 0, 0, 0, 0, SWP_FRAMECHANGED |
SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER);
}
Note that the style of a window is not like a C++ Builder property;
changing it is without effect, until the window is updated in some way.
Therefore Christian added SetWindowPos to the code.
hth,
Friedel
|
|
0
|
|
|
|
Reply
|
Friedel
|
1/15/2010 6:53:24 AM
|
|
"Friedel Jantzen" <nospam_plz@freenet.de> ha scritto:
> It is important to use the handle of the main *window*.
> In a C++ Builder main form TAppForm method you can use simply Handle.
> E.g.:
> __fastcall TSDIAppForm::TSDIAppForm(TComponent *AOwner)
> : TForm(AOwner)
> {
>
> int ExtendedStyle = GetWindowLong(Handle, GWL_EXSTYLE);
> SetWindowLong(Handle, GWL_EXSTYLE, ExtendedStyle |
> WS_EX_TOOLWINDOW & ~WS_EX_APPWINDOW);
> SetWindowPos(Handle, 0, 0, 0, 0, 0, SWP_FRAMECHANGED |
> SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER);
>
> }
>
> Note that the style of a window is not like a C++ Builder property;
> changing it is without effect, until the window is updated in some way.
> Therefore Christian added SetWindowPos to the code.
I can't find SDIAppForm Event.
Where is it?
|
|
0
|
|
|
|
Reply
|
Noixe
|
1/15/2010 9:54:17 AM
|
|
I inserted this two type of code in OnFormCreate event:
1.
SetWindowLong((Application->Handle, GWL_EXSTYLE,
GetWindowLong(Application->Handle, GWL_EXSTYLE) |
WS_EX_TOOLWINDOW & ~WS_EX_APPWINDOW);
2. (the difference is only the first parameter of SetWindowLong
SetWindowLong((Form1->Handle, GWL_EXSTYLE,
GetWindowLong(Application->Handle, GWL_EXSTYLE) |
WS_EX_TOOLWINDOW & ~WS_EX_APPWINDOW);
In the first case, the program appears in ALT+TAB list but don't appears in
taskbar.
In the second case, the program's icon appears in taskbar but don't appears
in ALT+TAB list
I want both result, it must disappears from ALT+TAB list and taskbar.
Note that the first parameter of GetWindowLong can be Application->Handle or
Form1->Handle, the result is the same.
|
|
0
|
|
|
|
Reply
|
Noixe
|
1/15/2010 10:37:55 AM
|
|
"Noixe" <noixe@TOGLIMIemail.it> ha scritto nel messaggio
news:4b504583$0$1111$4fafbaef@reader4.news.tin.it...
> I inserted this two type of code in OnFormCreate event:
Using both type of code seems work!
Thanks
|
|
0
|
|
|
|
Reply
|
Noixe
|
1/15/2010 11:28:45 AM
|
|
Hi!
Am Fri, 15 Jan 2010 12:28:45 +0100 schrieb Noixe:
> "Noixe" <noixe@TOGLIMIemail.it> ha scritto nel messaggio
> news:4b504583$0$1111$4fafbaef@reader4.news.tin.it...
>
>> I inserted this two type of code in OnFormCreate event:
>
> Using both type of code seems work!
>
> Thanks
It often is a mess to do something extra when using a RAD system like BCB.
I even had problems with German Umlaute (���...) in menus.
There are special newsgroups for BCB: borland.public.bccbuilder.*
Perhaps there is someone who knows a better way to do it.
Regards,
Friedel
|
|
0
|
|
|
|
Reply
|
Friedel
|
1/15/2010 2:21:38 PM
|
|
"Friedel Jantzen" <nospam_plz@freenet.de> ha scritto:
> It often is a mess to do something extra when using a RAD system like BCB.
> I even had problems with German Umlaute (���...) in menus.
> There are special newsgroups for BCB: borland.public.bccbuilder.*
> Perhaps there is someone who knows a better way to do it.
In those newsgroup I haven't found nobody
|
|
0
|
|
|
|
Reply
|
Noixe
|
1/15/2010 3:57:10 PM
|
|
|
8 Replies
519 Views
(page loaded in 0.035 seconds)
Similiar Articles: [C++ Builder] Hide application from activities list - comp.os.ms ...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 ... Unhide columns in a datasheet form - comp.databases.ms-access ...[C++ Builder] Hide application from activities list - comp.os.ms ... Unhide columns in a datasheet form - comp.databases.ms-access ... [C++ Builder] Hide application from ... Where did Fortran go? - comp.lang.fortranI find that coupled with a nice GUI builder, it is ... was asking about a system for building GUI applications in Fortran. C ... Hide quoted text - > > - Show quoted text - I ... improve strlen - comp.lang.asm.x86... to begin with, unless it is very special application ... si++" at the end of the for argument list. Written in standard C ... for programmers to write code, also hide the ... Sampling: What Nyquist Didn't Say, and What to Do About It - comp ...... and insecure bloatware, and spreads itself over far too much of your system (hint to Adobe - it's been a decade since it was acceptable for a simple application to ... RESIGNATION OF STEVE JOBS!! - comp.sys.mac.systemGPU and Core Image will hide most of that anyhow ... we really need is a way of running Windows [applications ... Linux boxes should 'just work', because the builders ... Solutions Manuals, Instructor Manuals, Test Banks collection 2011 ...... Relations: Interpersonal and Organizational Applications ... Elementary Structures for Architects and Builders, 5th ... in Conceptual Chemistry: A Student Activity Manual ... [comp.publish.cdrom] CD-Recordable FAQ, Part 1/4 - comp.publish ...Archive-name: cdrom/cd-recordable/part1 Posting-Frequency: monthly Last-modified: 2008/10/09 Version: 2.71 Send corrections and updates to And... Solutions Manual & Test Banks - comp.lang.java.programmer ...... Explorations in Conceptual Chemistry: A Student Activity ... DeSimone, Test Bank Human Resource Management Applications: Cases_Exercises_Incidents_and Skill Builders ... [C++ Builder] Hide application from activities list - comp.os.ms ...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 ... Hide application from Android application list - Android ForumsHello all, Is there any way to hide an application icon from Android applications list ? ... intent.category.LAUNCHER" /> element from all of your activity ... 7/22/2012 2:03:11 AM
|