Hi,
This is really just a theoretical question for my own interest, and not for
any nefarious purpose... :-)
Say we have three applications running - Notepad, Wordpad and Excel - and
each window is in its "normal" state i.e. not maximised, and not minimised
to the taskbar.
We click each of the three taskbar buttons in turn and, of course, the three
applications receive focus one after the other... We click on the Notepad
taskbar button, and Notepad receives focus. Obviously!
Similarly, if we click each of the applications in turn, their associated
taskbar button appears indented, i.e. as if it has been clicked.
My question is, how does Windows relate an application to its associated
taskbar button? I.e. when you click on Notepad, how does Windows "know"
which of the taskbar buttons to indent? I'm assuming it must use a hWnd...?
Assuming it does, is there any way to discover an application's taskbar
button's hWnd from the hWnd of the application itself?
Any assistance gratefully received.
--
Mark Rae
ASP.NET MVP http://www.markrae.net 10 2482
"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
My question is, how does Windows relate an application to its associated
taskbar button? I.e. when you click on Notepad, how does Windows "know"
which of the taskbar buttons to indent? I'm assuming it must use a
hWnd...?
Assuming it does, is there any way to discover an application's taskbar
button's hWnd from the hWnd of the application itself?
Hmmm, unfortunately there's no microsoft.public.win32.programmer.shell
group, so the closest thing might be microsoft.public.win32.programmer.ui.
I've seen tray questions there, so perhaps a taskbar question would be
well-suited there too. I definitely think you need to ask outside of the
..NET groups on this one. But please report your findings! I, too, find this
interesting on a theoretical level. I can't even think of how I might ever
use it, but it'd be cool to know.
However, my prediction is that the info is stored in an internal structure
and is not exposed. A cursory glance of the appbar-related stuff doesn't
reveal any functions or messages that relate to buttons.
"Jeff Johnson" <i.***@enough.spamwrote in message
news:OG**************@TK2MSFTNGP03.phx.gbl...
>My question is, how does Windows relate an application to its associated taskbar button? I.e. when you click on Notepad, how does Windows "know" which of the taskbar buttons to indent? I'm assuming it must use a hWnd...?
Assuming it does, is there any way to discover an application's taskbar button's hWnd from the hWnd of the application itself?
Hmmm, unfortunately there's no microsoft.public.win32.programmer.shell
group, so the closest thing might be microsoft.public.win32.programmer.ui.
I've seen tray questions there, so perhaps a taskbar question would be
well-suited there too. I definitely think you need to ask outside of the
.NET groups on this one. But please report your findings! I, too, find
this interesting on a theoretical level. I can't even think of how I might
ever use it, but it'd be cool to know.
OK - I'll try a more appropriate newsgroup...
However, my prediction is that the info is stored in an internal structure
and is not exposed. A cursory glance of the appbar-related stuff doesn't
reveal any functions or messages that relate to buttons.
Getting the taskbar button for any running application is (relatively)
easily achievable through a whole slew of p/invoke calls and a bit of unsafe
code: http://www.codeproject.com/KB/shell/taskbarsorter.aspx
I just can't imagine that Windows is going through all of this every time
someone clicks a taskbar button or a running application's window...
--
Mark Rae
ASP.NET MVP http://www.markrae.net
"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote in message
news:uU**************@TK2MSFTNGP03.phx.gbl...
>However, my prediction is that the info is stored in an internal structure and is not exposed. A cursory glance of the appbar-related stuff doesn't reveal any functions or messages that relate to buttons.
Getting the taskbar button for any running application is (relatively)
easily achievable through a whole slew of p/invoke calls and a bit of
unsafe code: http://www.codeproject.com/KB/shell/taskbarsorter.aspx
Egad. I regularly use a utility called TaskArrange, which does just this! I
can't believe I forgot about that. Well, that's cool then.
"Jeff Johnson" <i.***@enough.spamwrote in message
news:uY**************@TK2MSFTNGP03.phx.gbl...
>>However, my prediction is that the info is stored in an internal structure and is not exposed. A cursory glance of the appbar-related stuff doesn't reveal any functions or messages that relate to buttons.
Getting the taskbar button for any running application is (relatively) easily achievable through a whole slew of p/invoke calls and a bit of unsafe code: http://www.codeproject.com/KB/shell/taskbarsorter.aspx
Egad. I regularly use a utility called TaskArrange, which does just this!
I use this: http://taskix.robustit.com/
I can't believe I forgot about that. Well, that's cool then.
That certainly allows me to drill down into the taskbar's button collection
(for want of a better term) and find one whose title is the same or similar
to the title of an application's window - it doesn't get me any closer to
finding an "association" between a window and its taskbar button, though...
AAMOI, do you know how a C# WinForms app "suppresses" a form's taskbar
button when its ShowInTaskbar property is set to false...?
--
Mark Rae
ASP.NET MVP http://www.markrae.net
"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote in message
news:e1**************@TK2MSFTNGP03.phx.gbl...
AAMOI, do you know how a C# WinForms app "suppresses" a form's taskbar
button when its ShowInTaskbar property is set to false...?
No, but since VB6 offers the same capability I'd say there's defintely a
Windows API method of doing it, i.e., it's not a .NET-specific thing.
"Jeff Johnson" <i.***@enough.spamwrote in message
news:ez****************@TK2MSFTNGP05.phx.gbl...
>AAMOI, do you know how a C# WinForms app "suppresses" a form's taskbar button when its ShowInTaskbar property is set to false...?
No, but since VB6 offers the same capability I'd say there's defintely a
Windows API method of doing it, i.e., it's not a .NET-specific thing.
That was an incomplete answer. Now for the second part: I recommend creating
a couple of windows, identical in all ways except for ShowInTaskbar being
true in one and false in the other and then checking out their window styles
via Spy++.
"Jeff Johnson" <i.***@enough.spamwrote in message
news:O7**************@TK2MSFTNGP05.phx.gbl...
>>AAMOI, do you know how a C# WinForms app "suppresses" a form's taskbar button when its ShowInTaskbar property is set to false...?
No, but since VB6 offers the same capability I'd say there's defintely a Windows API method of doing it, i.e., it's not a .NET-specific thing.
That was an incomplete answer. Now for the second part: I recommend
creating a couple of windows, identical in all ways except for
ShowInTaskbar being true in one and false in the other and then checking
out their window styles via Spy++.
Reflector shows that the ShowInTaskbar property controls a bit in a
BitVector32 instance, so I'm really willing to bet it corresponding to a
window style now. Perhaps I should just look up some window styles....
Hmmm, nothing's jumping out at me, but is might be the extended style
WS_EX_APPWINDOW. When ShowInTaskbar is true the bit in the BitVector is set
to 1, so that could corresponding to turning on this flag.
"Jeff Johnson" <i.***@enough.spamwrote in message
news:uF*************@TK2MSFTNGP05.phx.gbl...
>>>AAMOI, do you know how a C# WinForms app "suppresses" a form's taskbar button when its ShowInTaskbar property is set to false...?
No, but since VB6 offers the same capability I'd say there's defintely a Windows API method of doing it, i.e., it's not a .NET-specific thing.
That was an incomplete answer. Now for the second part: I recommend creating a couple of windows, identical in all ways except for ShowInTaskbar being true in one and false in the other and then checking out their window styles via Spy++.
Reflector shows that the ShowInTaskbar property controls a bit in a
BitVector32 instance, so I'm really willing to bet it corresponding to a
window style now. Perhaps I should just look up some window styles....
Hmmm, nothing's jumping out at me, but is might be the extended style
WS_EX_APPWINDOW. When ShowInTaskbar is true the bit in the BitVector is
set to 1, so that could corresponding to turning on this flag.
Interesting - thanks.
--
Mark Rae
ASP.NET MVP http://www.markrae.net
"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote in message
news:u9**************@TK2MSFTNGP04.phx.gbl...
"Jeff Johnson" <i.***@enough.spamwrote in message
news:uF*************@TK2MSFTNGP05.phx.gbl...
>>>>AAMOI, do you know how a C# WinForms app "suppresses" a form's taskbar button when its ShowInTaskbar property is set to false...?
No, but since VB6 offers the same capability I'd say there's defintely a Windows API method of doing it, i.e., it's not a .NET-specific thing.
That was an incomplete answer. Now for the second part: I recommend creating a couple of windows, identical in all ways except for ShowInTaskbar being true in one and false in the other and then checking out their window styles via Spy++.
Reflector shows that the ShowInTaskbar property controls a bit in a BitVector32 instance, so I'm really willing to bet it corresponding to a window style now. Perhaps I should just look up some window styles....
Hmmm, nothing's jumping out at me, but is might be the extended style WS_EX_APPWINDOW. When ShowInTaskbar is true the bit in the BitVector is set to 1, so that could corresponding to turning on this flag.
Interesting - thanks.
http://msdn.microsoft.com/en-us/libr...80(VS.85).aspx
WS_EX_APPWINDOW
Forces a top-level window onto the taskbar when the window is visible.
>
--
Mark Rae
ASP.NET MVP http://www.markrae.net
"Ben Voigt [C++ MVP]" <rb*@nospam.nospamwrote in message
news:78**********************************@microsof t.com... http://msdn.microsoft.com/en-us/libr...80(VS.85).aspx
WS_EX_APPWINDOW
Forces a top-level window onto the taskbar when the window is visible.
Now here's the question: does the LACK of this flag always PREVENT a window
from displaying on the task bar?
What messes with me is the use of the word "force." "Force" suggests to me
that "sometimes apps MAY appear on the taskbar without this flag, but using
it ENSURES that the app will display on the taskbar." See what I mean about
the wording? This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Juan Garcia |
last post by:
Subject says it all.
Given:
Window A with text field.
Window B with a button (onClick opens Window C)
Window C with a button (onClick I want it to modify text fields of
Window A)
I have...
|
by: D Witherspoon |
last post by:
I developed this module, examples on the internet seem to be much longer..
Can someone explain to me why my solution doesn't work?
Module modAPI
Declare Function SetForegroundWindow Lib...
|
by: google |
last post by:
Hi there,
I've searched high and low for this, but it seems most people are
looking to establish (and control) the relationship between a parent
browser window and it's associated child window...
|
by: wayne |
last post by:
Hey there... I'm having some problems passing url parameters with an
open.window command. I'm not terribly familiar with java script but
here is the code below.
When executed it opens the...
|
by: Andante.in.Blue |
last post by:
Hello, I have just inherited a legacy Access 97 database. While going
through it, I noticed something strange... its Relationships window
(the one accessed by Tools --> Relationships) is almost...
|
by: Blaine |
last post by:
Does anyone know how I can hide a form from the TaskManager?
I've set the ShowInTaskbar to False, but when using Alt-TAB to switch
between applications, it appears as a blank icon. I can set it...
|
by: Hutch |
last post by:
I also un-checked all of the check boxes in the database's Startup options menu. I then added a button to the form so that the user can close the database, and another button so that the form can...
|
by: Andrew Poulos |
last post by:
There's a HTA application that's running on a local computer (not from a
URL) and the user can open a new HTML window by clicking a button
The first time the user clicks the button the window...
|
by: BlackShadow33p1 |
last post by:
I'm trying to write a program in C++ that gets the handles of all the visible entries in the windows taskbar. The method I've used so far is to send the TB_GETBUTTON message to the taskbar. ...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |