MSDN Library wrote: |
The high-order word specifies the notification code if the message is from a control. If the message is from an accelerator, this value is 1. If the message is from a menu, this value is zero. |
Code: Show/Hide /*
* User Button Notification Codes */ #define BN_CLICKED 0 //same as menu item click?? #define BN_PAINT 1 //same as accelerator message?? #define BN_HILITE 2 #define BN_UNHILITE 3 #define BN_DISABLE 4 #define BN_DOUBLECLICKED 5 |
Code: Show/Hide switch (code)
{ case BN_CLICKED: //and menuitem click! case CBN_SELCHANGE: //and accelerator! switch (id) |
Ekted wrote: |
If you were ambitious, you could also combine code/id into a single value and switch on that. |
Cyan~Fire wrote: |
Are we the only Win32 programmers on this board? |
Mine GO BOOM wrote: |
No, just my UI skills are just crap. |
Mr Ekted wrote: |
MFC is like a virus. It took over Win32 API without improving it. It now dominates all searches for any real info. |
Code: Show/Hide ## Makefile for AOK Trigger Studio by David Tombs
#Check for CFG macro !IF "$(CFG)" == "" !MESSAGE No configuration specified. Defaulting to Win32 Debug. !MESSAGE CFG=Win32 Debug !ENDIF #Release build !IF "$(CFG)" == "Win32 Release" OUTDIR=. INTDIR=.\Release CPPFLAGS_OPT = -ML -O2 LINK32_FLAGS = /release /incremental:no #Debug build !ELSEIF "$(CFG)" == "Win32 Debug" OUTDIR=.\Debug INTDIR=.\Debug CPPFLAGS_DEBUG = -MLd -Gm -D "_DEBUG" -FAs -Fa"asm/" -Zi -Fd"$(INTDIR)\\" LINK32_FLAGS = /debug /pdbtype:sept RFLAGS_DEBUG = /D "_DEBUG" !ELSE !ERROR Invalid configuration "$(CFG)" specified. !ENDIF LINK_LIBS=zlib.lib user32.lib comdlg32.lib comctl32.lib advapi32.lib CPPFLAGS = -c $(CPPFLAGS_DEBUG) $(CPPFLAGS_OPT) -YX -Fo"$(INTDIR)\\" -D WINVER=0x0400 -EHsc -W3 RFLAGS = /fo "$(INTDIR)\AOKTS.res" $(RFLAGS_DEBUG) LINK_OBJS = \ $(INTDIR)/aokts.obj \ $(INTDIR)/datatypes.obj \ $(INTDIR)/editors.obj \ $(INTDIR)/scen.obj \ $(INTDIR)/scen_const.obj \ $(INTDIR)/trigedit.obj \ $(INTDIR)/ecedit.obj \ $(INTDIR)/utilui.obj \ $(INTDIR)/zlibfile.obj \ $(INTDIR)/unitedit.obj \ $(INTDIR)/trigger.obj \ $(INTDIR)/utilio.obj \ $(INTDIR)/AOKTS.res #Inference Rules .cpp{$(INTDIR)}.obj: cl $(CPPFLAGS) $< .rc{$(INTDIR)}.res: rc $(RFLAGS) $< #Targets build: $(OUTDIR)\aokts.exe @echo Build complete. source: $(OUTDIR)\source.zip @echo Source zipped. #Build targets $(OUTDIR)\aokts.exe: $(LINK_OBJS) link.exe $(LINK32_FLAGS) /out:"$@" /pdb:"$(OUTDIR)\aokts.pdb" $(LINK_LIBS) $(LINK_OBJS) $(LINK_OBJS): #Source targets: yes, this is a stupid version of a batch file. TEMPFILES=aokts.cpp datatypes.cpp editors.cpp scen.cpp scen_const.cpp trigedit.cpp utilui.cpp zlibfile.cpp ecedit.cpp unitedit.cpp $(OUTDIR)\source.zip: *.cpp *.h aokts.rc src_notes.txt MAKEFILE res\aokts_big.bmp res\aokts.ico @"C:\Program Files\7-zip\7z" u $(OUTDIR)\source.zip $** !INCLUDE makefile.dep |