Solved

Adding icon and context menu to taskbar button

Posted on 2002-03-29
10
349 Views
Last Modified: 2012-08-14
Thanks for looking at my question:

Using vb6:

I have a sizeable form with no text attribute (no title bar) and have populated the taskbar button using SetWindowText to add text to my app's blank taskbar button, however, there is no icon and context menu when I right-click on the taskbar button.  My app also does not minimize when I click on the taskbar button.

So, my questions are:
=====================
How do I add an icon to my taskbar button when I used SetWindowText to add text (I am not talking system tray).

and

Is there a way to get the context menu back on right-click (Minimize|Restore|Close|etc..).

Thanks again.
0
Comment
Question by:bslavin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
10 Comments
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6906408
Why do you use setwindowtext?
with me.caption ="wathever" should be enought (if you have been set showintaskbar property to true)
0
 

Author Comment

by:bslavin
ID: 6906517
I use setwindowtext because it is actually a shaped sizeable form and using a titlebar adds unnecessary space between the custom shaped form and the sizing placeholders when resizing it.  So caption will not work here as that would force the form to create a titlebar.
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6908292
There is no problem with caption property even if you don't have title bar in it.
Or are you using an api created form?
Did you try managing mousedown event of form to show a popup that resembles original one?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:bslavin
ID: 6908448
API's shape the form, yes.  The popup I am trying to get back is on the taskbar.  When you setwindowtext, apparently, the context menu goes bye bye.
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6909137
Well, we have not understanding each other. I did try what i was saying, the only thing that i didn¡t try was popup menu stuff.
I will check it out...
0
 

Author Comment

by:bslavin
ID: 6909330
Here is how to reproduce my problem:

Create a new form in VB6.  Delete caption and set controlbox = false.  This will produce a sizeable form with no titlebar when you run it.  However, the taskbar button is blank.  Adding a caption will populate the taskbar, but will create a titlebar, which is what I do not want.

Now I just found out the I cannot right click on the taskbar at this point either, so that aspect of my question is now gone.

But, when I delete caption and setwindowtext to populate the taskbar button, I don't have an icon.  So I still have the problem with an icon showing up in my taskbar.

Hope this helps understand my dilema.

Thanks for your help.
0
 
LVL 16

Accepted Solution

by:
Richie_Simonetti earned 100 total points
ID: 6910638
0
 

Author Comment

by:bslavin
ID: 6912233
That was it, Richie!  

Huge help and the code was easy to follow.  I did not have to use setwindowtext after all to achieve the results I was looking for.

I have my titlebar removed, my icon shows up in the taskbar with caption and I got my context menu.

Thanks for the help!
0
 

Author Comment

by:bslavin
ID: 6912234
Thanks again.
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6912780
You are welcome. I just did a clean up of my papers and that code did jump direct to my face!
Thanks for "A" grade.
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VB6 - Convert HH:MM into Decimal 8 76
How to make an ADE file by code? 11 110
clicking a shape in a frame array vb6 3 55
MS Access 03, TransferText, decimal places 8 92
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question