Hey guys I have a "about" button in my toolbar. What I want it to do is if I click it, it brings up a messagebox. here is the code:


.if eax==IDC_HELP_ABOUT
invoke MessageBoxEx,hWin,abouttxt,aboutcap,MB_OK,NULL
.endif


Here is the .inc stuff



.const
;toolbar button definitions
IDC_NEW equ 10001
IDC_OPEN equ 10002
IDC_SAVE equ 10003
IDC_FIND equ 10004
IDC_FINDNEXT equ 10005
IDC_ADD equ 10006
IDC_SUBTRACT equ 10007
IDC_HELP_ABOUT equ 10201
IDI_MAINICO equ 100
;structure for toolbar buttons
main equ 750

tbrbtns TBBUTTON <0,0,TBSTATE_ENABLED,TBSTYLE_SEP,0,0>
TBBUTTON <6,IDC_NEW,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0>
TBBUTTON <7,IDC_OPEN,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0>
TBBUTTON <8,IDC_SAVE,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0>
TBBUTTON <0,0,TBSTATE_ENABLED,TBSTYLE_SEP,0,0>
TBBUTTON <2,IDC_FIND,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0>
TBBUTTON <3,IDC_FINDNEXT,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0>
TBBUTTON <1,IDC_ADD,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0>
TBBUTTON <5,IDC_SUBTRACT,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0>
TBBUTTON <0,0,TBSTATE_ENABLED,TBSTYLE_SEP,0,0>
TBBUTTON <4,IDC_HELP,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0>
TBBUTTON <0,IDC_HELP_ABOUT,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0>
TBBUTTON <0,0,TBSTATE_ENABLED,TBSTYLE_SEP,0,0>
ntbrbtns equ 13

;main buttons
IDC_BTN1 equ 1001
IDC_LST1 equ 1002
IDC_BTN2 equ 1004
IDC_TBR equ 1005
IDC_BTN3 equ 1006
IDB_STD_SMALL_COLOR2 equ 750


.data

ClassName db 'DLGCLASS',0
DlgName db 'MyDialog',0
AppName db 'Dialog as main',0
Err db "Erreur !",0
PE PROCESSENTRY32 <>
hIco dd 0
szToolBarClass db 'ToolbarWindow32',0
abouttxt db 'Welcome',0
aboutcap db 'welcome',0

.data?

hInstance dd ?
CommandLine dd ?
hWnd dd ?
hList dd ?
hSnapshot dd ?
uProcess PROCESSENTRY32 <>
hMainWnd dd ?
sprocess dd ?


and my .tbr file has IDC_HELP_ABOUT as the about button name. Any help on this is greatly appreciated.

thx,
RIF
Posted on 2002-08-25 18:40:37 by resistance_is_futile
To resistance_is_futile:

Here's a little program that has a About Toolbar
button and a About dialogbox.

See the post below.

Ewayne
Posted on 2002-08-25 20:07:59 by Ewayne
To resistance_is_futile:

I'm sorry I read you question wrong, I read it as
you wanted a dialog to open when you clicked on
the toolbar button.

I have changed the sample program so it has two
About toolbar buttons.

1. One will open a dialogbox.
2. One will open a messagebox.

Sorry about that.

Ewayne
Posted on 2002-08-27 10:49:37 by Ewayne
okay thanks a lot. It worked when I tried it in my proggie..
Posted on 2002-08-27 20:55:43 by resistance_is_futile