Click to See Complete Forum and Search --> : Toolbar, tooltips, menu problems


haiaw
September 13th, 2003, 12:23 PM
Hi everynoe, thanks for visiting my thread.
About me: 1 year experience withw PURE Win32App->Simple Applications,NO MFC, basic knowlegde starting to learn more.

For further disscusions and help i suggest downloading my simple projects THANKS!!! PLEASE HELP ME, i know that there must be some experienced programmers who did such thins before :)

About all my problems i've read msdn but still a don't have sollutions. Also i didn;t find in forums. PLEASE HELP ME.

NOTE: I use vc++6
Questions:
1. Toolbar - again my code www.toya.net.pl/~grupaie2/Baza.rar and www.toya.net.pl/~grupaie2/Baza3.rar - two versions of toolbars, but still i can't handle :-(
these r standard toolbars created with vc++ createtoolbarex(). I want it to change position if dragged, u know, like in MSWORD - it transforms into separate window with all buttons. I heard that that should be a rebar or coolbra??? BUT I DON'T know how to implement changes, please check it :-( And Finally in my VC++ i can import only bitmaps which have < 256 colors, what to do with it? I want to have better colors - To show them in my toolbar. If use load image, where to do that? If LoadImage with flag LR_VGACOLOR where to do that IN MY CODE????? PLEASE CHECK IT.


2. Tooltips - why don't they show up in my program? I want them to show if mouse is over my ownerdrawbutton www.toya.net.pl/~grupaie2/Baza.rar - it seems that i should move the tooltip but i don't know is that it? And maybe i'm doing something wrong? Now my tooltip is set to be visible when mouse i sover my lisbox - and the listbox takes 80% of place of my application :-( PLEASE CHECK IT and PLEASE DETAIL CODE CHANGES.

3. Menu in www.toya.net.pl/~grupaie2/TestMEnu.rar i try to create my ownerdraw menu with msdn help - poor results, and 3 compilation errors that i understand but cannpt handle, why code on msdn doesn't work?. Finally - want to place the bitmap next to one of my menu items .

4. I want to create such listbox, that would have my-defined color of background and color of selected item. My code the same as in point 1 - www.toya.net.pl/~grupaie2/Baza.rar


U R MY ONLY HOPE 4 HELP THANKS! N

N O T E pure win32api application non mfc

Michello
September 30th, 2003, 04:12 PM
Hello haiaw,

a lot of text (...and problems ;-). I'll try to help you, but don't expect, that I'm going to modify your code.

In order to create a draggable (movable) toolbar like MS Word or IE, you need to create a rebar (coolbar) first - don't forget to initialize the common controls with InitializeCommonControlsEx() (comctrl.h / comctl32.lib). Use the API CreateWindowEx() with the macro REBARCLASSNAME for the window class. Now you can add different so called 'bands' to your rebar control, by sending the message RB_INSE*****D to the rebar passing the struct REBARBANDINFO, which includes the handle to your toolbar, which you can create with CreateToolbarEx() for example.
For a detailled explanation take a look at the MSDN: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwui/html/msdn_rebar.asp

MS Visual C++ 6.0 CAN import bitmaps with more than 256 colors, but it just can't display them. However they should be imported correctly.

Concerning the tooltips: please check, wether you have ensured that the common control class ICC_TREEVIEW_CLASSES is available. Again use the API InitializeCommonControlsEx().

The compiler errors in your 'TestMenu' sample: just cast the return value of SelectObject() - which is void* - to HFONT.
HFONT hfntOld = ( HFONT )SelectObject( hdc, pMyItem->hfont );
Hope that helps. Good luck :)