I tend to tackle more advanced stuff before mastering basic stuff, and while hacking through some more challenging stuff i stumbled on a code tidbit the will help spice up your toolbars (to my knowledge this is not in the MASM32v2 package, butI could be wrong.. :) ) It simple allows you to have tool-tips on your toolbar buttons (little popups discribing the button function) Its actually realy ez to employ, so here is the code fragments: If you use prostart, you will find this in tbmacros.asm:

        szText tbClass,"ToolbarWindow32"

        invoke CreateWindowEx,0,
                              ADDR tbClass,
                              ADDR szDisplayName,
                              WS_CHILD or WS_VISIBLE or WS_BORDER or TBSTYLE_TOOLTIPS,
The changes above are adding two more OR's, TBSTYLE_TOOLTIPS (is the key one), and WS_BORDER for better looks. In your rsrc.rc file add:

    50    "Tool Button 1"  /* 5x == BUTTON COMMAND ID */
    51    "Tool Button 2"
    52    "Tool Button 3"
    53    "Tool Button 4"
    54    "Tool Button 5"
    55    "Tool Button 6"
And lastly in your main window add into the uMsg conditionals:

        .elseif uMsg == WM_NOTIFY
          ; DO TOOL TIPS
          jmp Overthere
             wBuffer db 100 dup (?)
          mov ecx, lParam
          mov eax, (TOOLTIPTEXT PTR ).hdr.code
          .IF eax == TTN_NEEDTEXT
               mov ebx, (TOOLTIPTEXT PTR ).hdr.idFrom
               push ecx
               invoke LoadString, hInstance, ebx, addr wBuffer, 100
               lea ebx, wBuffer
               pop ecx
               mov (TOOLTIPTEXT PTR ).lpszText, ebx
I defined data? type within the code, you can move this away if you like, its just needed to copy the name from the resource file into a string to be passed along... Since the buffer is set 100, your tooltips messages in rsrc.rc can only be 100 chars max. Anywho, if this is new, i hope you like it. Happy coding NaN
Posted on 2001-03-14 01:13:00 by NaN