Hi,
This isn't a C++ question, and I know VERY little C++, but I'm hoping a C++ programmer will have the answer.
I'm developing a Longhorn style desktop sidebar for Windows XP in Visual Basic, and I have it all working pretty well so far apart from the system tray. I am currently moving the ToolbarWindow32 from the taskbar onto my window, however this is causing explorer to become unstable and crash. I'm anxious to keep the existing taskbar untouched by my app, so I've had another idea which seemed good at first glance.
I want to use the SendMessage function with the toolbar messages to create a clone of the system tray on my window. So far I have managed to create a ToolbarWindow32 on my window by using CreateWindowEx, and create the same number of buttons by sending TB_BUTTONCOUNT to the tray. Ive sent TB_GETBITMAP to each button to get its imagelist index.
The problem is that I cannot get the icons to display on my toolbar buttons. I am using TB_GETIMAGELIST to get the handle of the system tray's image list, and TB_SETIMAGELIST to set my toolbar to use the same imagelist (Ive checked mine with GETIMAGELIST and they definatley use the same handle), but it doesnt work - my buttons are just very small, blank buttons. Ive also tried to use the ImageList_Duplicate API to copy the system tray's image list, but that just returns 0. I've spent a few weeks on this and I just havent been able to work it out.
I've asked on Visual Basic forums but nobody seems to be able to help because nobody seems to have attempted anything even remoteley similar to this before in VB. I'm just wondering if anyone can help me out, because I'm guessing that this is something to do with the way Windows works rather than the code Ive used (I'm 99.9% sure my code is correct). All the documentation I can find on using the TB_* messages is related to C++, which is why I have decided to seek help here.
If my problem is unclear then please let me know and I'll try and rephrase it. I'm getting quite desperate and I need to make some progress on this issue quite soon.
Thanks a lot,
Illspirit
This isn't a C++ question, and I know VERY little C++, but I'm hoping a C++ programmer will have the answer.
I'm developing a Longhorn style desktop sidebar for Windows XP in Visual Basic, and I have it all working pretty well so far apart from the system tray. I am currently moving the ToolbarWindow32 from the taskbar onto my window, however this is causing explorer to become unstable and crash. I'm anxious to keep the existing taskbar untouched by my app, so I've had another idea which seemed good at first glance.
I want to use the SendMessage function with the toolbar messages to create a clone of the system tray on my window. So far I have managed to create a ToolbarWindow32 on my window by using CreateWindowEx, and create the same number of buttons by sending TB_BUTTONCOUNT to the tray. Ive sent TB_GETBITMAP to each button to get its imagelist index.
The problem is that I cannot get the icons to display on my toolbar buttons. I am using TB_GETIMAGELIST to get the handle of the system tray's image list, and TB_SETIMAGELIST to set my toolbar to use the same imagelist (Ive checked mine with GETIMAGELIST and they definatley use the same handle), but it doesnt work - my buttons are just very small, blank buttons. Ive also tried to use the ImageList_Duplicate API to copy the system tray's image list, but that just returns 0. I've spent a few weeks on this and I just havent been able to work it out.
I've asked on Visual Basic forums but nobody seems to be able to help because nobody seems to have attempted anything even remoteley similar to this before in VB. I'm just wondering if anyone can help me out, because I'm guessing that this is something to do with the way Windows works rather than the code Ive used (I'm 99.9% sure my code is correct). All the documentation I can find on using the TB_* messages is related to C++, which is why I have decided to seek help here.
If my problem is unclear then please let me know and I'll try and rephrase it. I'm getting quite desperate and I need to make some progress on this issue quite soon.
Thanks a lot,
Illspirit