|
-
Jun 3rd, 2002, 10:19 AM
#1
Thread Starter
Hyperactive Member
hwnd of Toolbar buttons.
Does anyone know if it is possible to get the hwnd of a toolbar's buttons?
And I, for one, welcome our new insect overlords. I'd like to remind them as a trusted TV personality, I can be helpful in rounding up others to toil in their underground sugar caves.
-
Jun 4th, 2002, 10:08 PM
#2
PowerPoster
Don't know if it'll work but you can compute the position of a certain button (first getting the position of the toolbar related to the screen coordinates and then get the position of the button by using some kind of ratio) in the toolbar and you can use "WindowFromPoint" to get the handle of the button by providing the position you calculated before.
-
Jun 5th, 2002, 08:10 AM
#3
Thread Starter
Hyperactive Member
I tried using that WindowFromPoint but it returned the handle of the toolbar =\
I even tried CreateWindowEx ing a transparent window over the coordinates of a button but it still didn't work. (I am trying to add a CustomToolTip to my toolbar buttons). Even though I do InitCommonControls with ICC_COOL_CLASSES it still doesnt seem to recognize it..I can't even attach the tip balloon to the toolbar =\
Can anyone verify that the value of ICC_COOL_CLASSES is &H400? Maybe that's whats wrong.
And I, for one, welcome our new insect overlords. I'd like to remind them as a trusted TV personality, I can be helpful in rounding up others to toil in their underground sugar caves.
-
Jun 5th, 2002, 09:18 AM
#4
Toolbarbuttons don't have a window handle because they are no windows. The toolbar draws them. the only windowhandle you could retrieve is the one from the toolbar.
-
Jul 10th, 2002, 02:11 PM
#5
Addicted Member
-
Jul 10th, 2002, 02:24 PM
#6
The toolbars .hWnd property will give you its handle.
-
Jul 10th, 2002, 02:33 PM
#7
Addicted Member
A related problem
What is brenarro actually trying to do? If he's trying to interact somehow with a button on a toolbar in another process, he will have to engage in a message dialog with the toolbar's window.
This is similar to the case for ListViews, TreViews etc, in other words, possible but tricky. Interacting with post-Win3.1 controls like this requires the use of shared memory bufers...
Dr Memory
"He's got a B.A. (in be-bop), a Ph.D. (in swing), he's a Master of Rhythm, he's the Rock'n'Roll king"  ("The Rock'n'Roll Doctor", Lowell George)
"If you push something hard enough, it will fall over" (Fudd's Third Law of Opposition)
-
Jul 10th, 2002, 02:52 PM
#8
Thread Starter
Hyperactive Member
Well, what I was orignally trying to do was hook the "custom tool tip window" (a balloon tip, basically) created by the attached class file to the buttons on a toolbar.
I did not write this class, but you need to specify the handle of the parent window that will hold the "custom tool tip window".
Since I can only get the handle of the entire toolbar, and not the individual buttons, I would only be able to make one balloon tip for the whole bar, and not each button.
MathImagics can you elaborate on what you mean by sharing memoy buffers, or perhaps point me to a site that can explain more?
And I, for one, welcome our new insect overlords. I'd like to remind them as a trusted TV personality, I can be helpful in rounding up others to toil in their underground sugar caves.
-
Jul 10th, 2002, 03:15 PM
#9
Originally posted by brenaaro
Since I can only get the handle of the entire toolbar, and not the individual buttons, I would only be able to make one balloon tip for the whole bar, and not each button.
You can have separate tooltips for each button via the ToolTipText property.
-
Jul 10th, 2002, 03:18 PM
#10
Addicted Member
The plot thickens.....
There will be a ToolTip control associated with the target ToolBar control. The window handle of the ToolTip control can be found by sending the ToolBar window a TB_GETTOOLTIPS message.
Once you know the ToolTip windw handle, there are two ways to go. One I know works I'll come to, the other is Subclassing the ToolTip window, which I can't say much about, as I try to avoid subclassing if I can.
The ToolTip window has an array of TOOLINFO structures, and if you want to put your own text in there it can be done with a TTM_UPDATETOOLTIP message....
BUT!!!!! .....
I'll continue if you can confirm that this is what you are trying to do - substitute text of your own in selected button/tooltips... is this correct????
"He's got a B.A. (in be-bop), a Ph.D. (in swing), he's a Master of Rhythm, he's the Rock'n'Roll king"  ("The Rock'n'Roll Doctor", Lowell George)
"If you push something hard enough, it will fall over" (Fudd's Third Law of Opposition)
-
Jul 10th, 2002, 03:26 PM
#11
Addicted Member
Megatron, sorry if I'm barking up the wrong tree - I'm not sure if he's trying to snaffle another running application, or he's working on a toolbar that belongs to him.....
-
Jul 10th, 2002, 03:26 PM
#12
Addicted Member
Will this only work for VB apps? Like if you are Shelling another app into VB will this still work?
-
Jul 10th, 2002, 03:27 PM
#13
Thread Starter
Hyperactive Member
That's pretty close to what I'm trying to do. I know I can assign normal tooltips to each of the toolbars buttons via their ToolTip property, but that gives the standard "small, square" tooltips.
The clsToolTips lets you create "XP-like" balloon tips.
So essentially, yes I suppose if I can get the handle of the existing tooltips, and replace them with the balloon tips of clsToolTips (which include the icons, caption, speech bubble shape, etc) that would be genial.
And I, for one, welcome our new insect overlords. I'd like to remind them as a trusted TV personality, I can be helpful in rounding up others to toil in their underground sugar caves.
-
Jul 10th, 2002, 03:29 PM
#14
Thread Starter
Hyperactive Member
The toolbar does belong to me.
And I, for one, welcome our new insect overlords. I'd like to remind them as a trusted TV personality, I can be helpful in rounding up others to toil in their underground sugar caves.
-
Jul 10th, 2002, 03:30 PM
#15
Addicted Member
I am "snaffle another running application" - is this the path you were headed down?
-
Jul 10th, 2002, 03:32 PM
#16
Thread Starter
Hyperactive Member
brookema: I'm snaffling my own app, but I think we will end up using the same solution if it presents itself. It looks likely that we will need to get the window of the tooltips themselves and then do some manipulation...if that's where MathImagics is heading?
And I, for one, welcome our new insect overlords. I'd like to remind them as a trusted TV personality, I can be helpful in rounding up others to toil in their underground sugar caves.
-
Jul 10th, 2002, 03:35 PM
#17
Originally posted by brookema
Will this only work for VB apps? Like if you are Shelling another app into VB will this still work?
The API method will work for any App, but my method will only work in design time of a VB project.
-
Jul 10th, 2002, 03:40 PM
#18
Addicted Member
If it's your own application, then presumably you are building the toolbar?
If so, AND you can add the buttons in the program, then you could send a TB_SETTOOLTIPS message to the toolbar, passing it the handle of your ToolTip window (a bit like assigning an image list to a Treeview).....
Sorry, gotta have dinner now, I'll check back in half an hour or so...
Dr Memory
"He's got a B.A. (in be-bop), a Ph.D. (in swing), he's a Master of Rhythm, he's the Rock'n'Roll king"  ("The Rock'n'Roll Doctor", Lowell George)
"If you push something hard enough, it will fall over" (Fudd's Third Law of Opposition)
-
Jul 10th, 2002, 03:42 PM
#19
Addicted Member
Originally posted by Megatron
The API method will work for any App, but my method will only work in design time of a VB project.
Which API method is this?
-
Jul 10th, 2002, 04:25 PM
#20
Addicted Member
... as I was saying, if it's your toolbar then you can send it a TB_SETTOOLTIPS message passing the handle of the ToolTip control you create.
But you need to do this association before you add any buttons, which means you have create the toolbar without buttons, then associate it with your Tooltip window, and then you add the buttons, so that Windows will send the right signals to your Tooltip window, when the mouse moves, etc...
I hope this helps (forget the shared memory stuff, I thought you were talking about a toolbar in another process)
Dr Memory
"He's got a B.A. (in be-bop), a Ph.D. (in swing), he's a Master of Rhythm, he's the Rock'n'Roll king"  ("The Rock'n'Roll Doctor", Lowell George)
"If you push something hard enough, it will fall over" (Fudd's Third Law of Opposition)
-
Jul 10th, 2002, 06:57 PM
#21
Thread Starter
Hyperactive Member
I'll give it a shot.
Hmm interesting idea...
I'm at home now but I'll try it when I get into the office tomorow morning and let you know what I got.
Thanks for the input btw.
And I, for one, welcome our new insect overlords. I'd like to remind them as a trusted TV personality, I can be helpful in rounding up others to toil in their underground sugar caves.
-
Jul 11th, 2002, 07:50 AM
#22
New Member
what i do is:
first use FindWindow to find the window, then use FindWindowEx to find the button inside the window
There is always a way to create what u want
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|