DumontEXE 0.0.1
ISMsgManager.cpp
00001 // ISMsgManager.cpp: implementation of the ISMsgManager class.
00002 //
00003 //////////////////////////////////////////////////////////////////////
00004 
00005 #include "stdafx.h"
00006 #include "ISMsgManager.h"
00007 #include "ISMsgHandlers.h" // derived handlers
00008 
00009 #ifdef _DEBUG
00010 #undef THIS_FILE
00011 static char THIS_FILE[]=__FILE__;
00012 #define new DEBUG_NEW
00013 #endif
00014 
00015 #include <afxpriv.h> // for MFC messages
00016 
00017 //////////////////////////////////////////////////////////////////////
00018 // Construction/Destruction
00019 //////////////////////////////////////////////////////////////////////
00020 
00021 // static methods
00022 BOOL CISMsgManager::HandleMsg(const MSG* pMsg, CString& sMsg, CStringArray* pParams)
00023 {
00024     ASSERT (AfxIsValidString(sMsg));
00025 
00026     CISMsgHandler* pMsgHandler = GetInstance().GetHandler(pMsg->message);
00027 
00028     if (!pMsgHandler || !pMsgHandler->HandleMsg(pMsg, sMsg, pParams))
00029     {
00030         if (pMsg->message > WM_APP)
00031             sMsg.Format("WM_APP + %d", pMsg->message - WM_APP);
00032         else
00033             sMsg.Format("Unknown (0x%08X)", pMsg->message);
00034     }
00035 
00036     if (!pMsgHandler || pMsgHandler->HasParams())
00037     {
00038         if (!pParams)
00039         {
00040             CString sTemp(sMsg);
00041             sMsg.Format("%s: wp = 0x%08X, lp = 0x%08X", sTemp, pMsg->wParam, pMsg->lParam);
00042         }
00043         else if (!pParams->GetSize())
00044         {
00045             CISMsgHandler::AddParam(pParams, "wp = 0x%08X", pMsg->wParam);
00046             CISMsgHandler::AddParam(pParams, "lp = 0x%08X", pMsg->lParam);
00047         }
00048     }
00049 
00050     return TRUE;
00051 }
00052 
00053 // class methods
00054 CISMsgManager::CISMsgManager()
00055 {
00056     CreateMessageMap();
00057 }
00058 
00059 CISMsgManager::~CISMsgManager()
00060 {
00061     DeleteMessageMap();
00062 }
00063 
00064 #define ADDHANDLERMFC(msg) { AddHandler(msg, new CISMsgHandler(msg, #msg" (MFC)")); } 
00065 #define ADDHANDLERMFCEX(msg, classtype) { AddHandler(msg, new classtype(msg, #msg" (MFC)")); }
00066 #define ADDHANDLERMFCNOPARAMS(msg) { AddHandler(msg, new CISMsgHandler(msg, #msg" (MFC)", FALSE)); } 
00067 #define ADDHANDLEROBS(msg) { AddHandler(msg, new CISMsgHandler(msg, #msg)); } // obselete messages
00068 #define ADDHANDLER(msg) { AddHandler(msg, new CISMsgHandler(msg, #msg)); }
00069 #define ADDHANDLERNOPARAMS(msg) { AddHandler(msg, new CISMsgHandler(msg, #msg, FALSE)); }
00070 #define ADDHANDLEREX(msg, classtype) { AddHandler(msg, new classtype(msg, #msg)); }
00071 #define ADDHANDLERUNK(msg, name) { AddHandler(msg, new CISMsgHandler(msg, name)); }
00072 #define ADDHANDLERUNKNOPARAMS(msg, name) { AddHandler(msg, new CISMsgHandler(msg, name, FALSE)); }
00073 #define ADDHANDLERUNKEX(msg, name, classtype) { AddHandler(msg, new classtype(msg, name)); }
00074 
00075 void CISMsgManager::CreateMessageMap()
00076 {
00077     ADDHANDLERNOPARAMS(WM_NULL);                    
00078     ADDHANDLEREX(WM_CREATE, CISMH_Create);            
00079     ADDHANDLERNOPARAMS(WM_DESTROY);    
00080     ADDHANDLEREX(WM_MOVE, CISMH_Move);              
00081     ADDHANDLERUNK(0x0004, "WM_SIZEWAIT"); // *        
00082     ADDHANDLEREX(WM_SIZE, CISMH_Size);               
00083     ADDHANDLEREX(WM_ACTIVATE, CISMH_Activate);         
00084     ADDHANDLEREX(WM_SETFOCUS, CISMH_Focus);                 
00085     ADDHANDLEREX(WM_KILLFOCUS, CISMH_Focus);             
00086     ADDHANDLERUNK(0x0009, "WM_SETVISIBLE"); // *          
00087     ADDHANDLEREX(WM_ENABLE, CISMH_Enable);                   
00088     ADDHANDLEREX(WM_SETREDRAW, CISMH_Redraw);             
00089     ADDHANDLEREX(WM_SETTEXT, CISMH_SetText);              
00090     ADDHANDLEREX(WM_GETTEXT, CISMH_GetText);                    
00091     ADDHANDLERNOPARAMS(WM_GETTEXTLENGTH);        
00092     ADDHANDLERNOPARAMS(WM_PAINT);               
00093     ADDHANDLERNOPARAMS(WM_CLOSE);                      
00094     ADDHANDLEREX(WM_QUERYENDSESSION, CISMH_QueryEnd); 
00095     ADDHANDLEREX(WM_QUIT, CISMH_Quit);                      
00096     ADDHANDLERNOPARAMS(WM_QUERYOPEN);         
00097     ADDHANDLEREX(WM_ERASEBKGND, CISMH_EraseBkgnd);           
00098     ADDHANDLERNOPARAMS(WM_SYSCOLORCHANGE);   
00099     ADDHANDLEREX(WM_ENDSESSION, CISMH_EndSession);           
00100     ADDHANDLERUNK(0x0017, "WM_SYSTEMERROR"); // obselete           
00101     ADDHANDLEREX(WM_SHOWWINDOW, CISMH_Show);          
00102     ADDHANDLEREX(WM_CTLCOLOR, CISMH_CtlColor);              
00103     ADDHANDLEREX(WM_WININICHANGE, CISMH_WinIniChange);      
00104     ADDHANDLEREX(WM_SETTINGCHANGE, CISMH_SettingChange);
00105     ADDHANDLEREX(WM_DEVMODECHANGE, CISMH_DevModeChange); 
00106     ADDHANDLEREX(WM_ACTIVATEAPP, CISMH_ActivateApp);       
00107     ADDHANDLERNOPARAMS(WM_FONTCHANGE);          
00108     ADDHANDLERNOPARAMS(WM_TIMECHANGE);         
00109     ADDHANDLERNOPARAMS(WM_CANCELMODE);       
00110     ADDHANDLEREX(WM_SETCURSOR, CISMH_SetCursor);          
00111     ADDHANDLEREX(WM_MOUSEACTIVATE, CISMH_SetCursor); // close enough ;)          
00112     ADDHANDLERNOPARAMS(WM_CHILDACTIVATE);       
00113     ADDHANDLERNOPARAMS(WM_QUEUESYNC);           
00114     ADDHANDLEREX(WM_GETMINMAXINFO, CISMH_MinMax);         
00115     ADDHANDLERNOPARAMS(WM_PAINTICON);          
00116     ADDHANDLEROBS(WM_ICONERASEBKGND); // obselete 
00117     ADDHANDLEREX(WM_NEXTDLGCTL, CISMH_NextDlgCtrl);   
00118     ADDHANDLERUNK(0x0029, "WM_ALTTABACTIVE"); // *         
00119     ADDHANDLEREX(WM_SPOOLERSTATUS, CISMH_Spooler);          
00120     ADDHANDLEREX(WM_DRAWITEM, CISMH_DrawItem);            
00121     ADDHANDLEREX(WM_MEASUREITEM, CISMH_MeasureItem);   
00122     ADDHANDLEREX(WM_DELETEITEM, CISMH_DeleteItem);             
00123     ADDHANDLEREX(WM_VKEYTOITEM, CISMH_VkeyItem);         
00124     ADDHANDLEREX(WM_CHARTOITEM, CISMH_CharItem);        
00125     ADDHANDLEREX(WM_SETFONT, CISMH_SetFont);                
00126     ADDHANDLERNOPARAMS(WM_GETFONT);                 
00127     ADDHANDLEREX(WM_SETHOTKEY, CISMH_SetHotkey);              
00128     ADDHANDLERNOPARAMS(WM_GETHOTKEY);             
00129     ADDHANDLERUNK(0x0034, "WM_FILESYSCHANGE"); // *       
00130     ADDHANDLERUNK(0x0035, "WM_ISACTIVEICON"); // *            
00131     ADDHANDLERUNK(0x0036, "WM_QUERYPARKICON"); // *               
00132     ADDHANDLEROBS(WM_QUERYDRAGICON);                
00133     ADDHANDLERUNK(0x0038, "WM_QUERYSAVESTATE"); // *           
00134     ADDHANDLEREX(WM_COMPAREITEM, CISMH_CompareItem);            
00135     ADDHANDLERUNK(0x003A, "WM_TESTING"); // *                  
00136     ADDHANDLERUNK(0x003D, "WM_GETOBJECT"); // *                
00137     ADDHANDLERUNK(0x003E, "WM_ACTIVATESHELLWINDOW"); // *  
00138     ADDHANDLEREX(WM_COMPACTING, CISMH_Compacting);                  
00139     ADDHANDLERUNK(0x0042, "WM_OTHERWINDOWCREATED"); // * 
00140     ADDHANDLERUNK(0x0043, "WM_OTHERWINDOWDESTROYED"); // *    
00141     ADDHANDLEROBS(WM_COMMNOTIFY);         
00142     ADDHANDLEREX(WM_WINDOWPOSCHANGING, CISMH_WPosChange); 
00143     ADDHANDLEREX(WM_WINDOWPOSCHANGED, CISMH_WPosChange);       
00144     ADDHANDLEREX(WM_POWER, CISMH_Power);                
00145     ADDHANDLEREX(WM_COPYDATA, CISMH_CopyData);                
00146     ADDHANDLERNOPARAMS(WM_CANCELJOURNAL);          
00147     ADDHANDLEREX(WM_NOTIFY, CISMH_Notify);                
00148     ADDHANDLEREX(WM_INPUTLANGCHANGEREQUEST, CISMH_InputLangReq);
00149     ADDHANDLEREX(WM_INPUTLANGCHANGE, CISMH_InputLang);
00150     ADDHANDLEREX(WM_TCARD, CISMH_Tcard); 
00151     ADDHANDLEREX(WM_HELP, CISMH_Help); 
00152     ADDHANDLERNOPARAMS(WM_USERCHANGED);      
00153     ADDHANDLEREX(WM_NOTIFYFORMAT, CISMH_NotifyFormat); 
00154     ADDHANDLEREX(WM_CONTEXTMENU, CISMH_ContextMenu); 
00155     ADDHANDLEREX(WM_STYLECHANGING, CISMH_StyleChange);
00156     ADDHANDLEREX(WM_STYLECHANGED, CISMH_StyleChange); 
00157     ADDHANDLEREX(WM_DISPLAYCHANGE, CISMH_DispChange); 
00158     ADDHANDLEREX(WM_GETICON, CISMH_GetIcon);
00159     ADDHANDLEREX(WM_SETICON, CISMH_SetIcon);
00160     ADDHANDLEREX(WM_NCCREATE, CISMH_Create);            
00161     ADDHANDLERNOPARAMS(WM_NCDESTROY);          
00162     ADDHANDLEREX(WM_NCCALCSIZE, CISMH_NcCalcSize);
00163     ADDHANDLEREX(WM_NCHITTEST, CISMH_NcHitTest);         
00164     ADDHANDLEREX(WM_NCPAINT, CISMH_NcPaint);        
00165     ADDHANDLEREX(WM_NCACTIVATE, CISMH_NcActivate);
00166     ADDHANDLEREX(WM_GETDLGCODE, CISMH_GetDlgCode);            
00167     ADDHANDLERNOPARAMS(WM_SYNCPAINT);             
00168     ADDHANDLERUNK(0x0089, "WM_SYNCTASK"); // *             
00169     ADDHANDLEREX(WM_NCMOUSEMOVE, CISMH_NcMouse);              
00170     ADDHANDLEREX(WM_NCLBUTTONDOWN, CISMH_NcMouse);           
00171     ADDHANDLEREX(WM_NCLBUTTONUP, CISMH_NcMouse);      
00172     ADDHANDLEREX(WM_NCLBUTTONDBLCLK, CISMH_NcMouse); 
00173     ADDHANDLEREX(WM_NCRBUTTONDOWN, CISMH_NcMouse);          
00174     ADDHANDLEREX(WM_NCRBUTTONUP, CISMH_NcMouse);           
00175     ADDHANDLEREX(WM_NCRBUTTONDBLCLK, CISMH_NcMouse);       
00176     ADDHANDLEREX(WM_NCMBUTTONDOWN, CISMH_NcMouse); 
00177     ADDHANDLEREX(WM_NCMBUTTONUP, CISMH_NcMouse);    
00178     ADDHANDLEREX(WM_NCMBUTTONDBLCLK, CISMH_NcMouse); 
00179     ADDHANDLERUNKEX(0x00AB, "WM_NCXBUTTONDOWN", CISMH_NcMouse);           
00180     ADDHANDLERUNKEX(0x00AD, "WM_NCXBUTTONUP", CISMH_NcMouse);    
00181     ADDHANDLERUNKEX(0x00AE, "WM_NCXBUTTONDBLCLK", CISMH_NcMouse);    
00182     ADDHANDLEREX(WM_KEYDOWN, CISMH_Key);                
00183     ADDHANDLEREX(WM_KEYUP, CISMH_Key);                      
00184     ADDHANDLEREX(WM_CHAR, CISMH_Char);                
00185     ADDHANDLEREX(WM_DEADCHAR, CISMH_Char);             
00186     ADDHANDLEREX(WM_SYSKEYDOWN, CISMH_Key);                
00187     ADDHANDLEREX(WM_SYSKEYUP, CISMH_Key);              
00188     ADDHANDLEREX(WM_SYSCHAR, CISMH_Char);                   
00189     ADDHANDLEREX(WM_SYSDEADCHAR, CISMH_Char);            
00190     ADDHANDLERUNK(0x0109, "WM_WNT_CONVERTREQUESTEX"); // * 
00191     ADDHANDLERUNK(0x010A, "WM_CONVERTREQUEST"); // *          
00192     ADDHANDLERUNK(0x010B, "WM_CONVERTRESULT"); // *             
00193     ADDHANDLERUNK(0x010C, "WM_INTERIM"); // *                   
00194     ADDHANDLER(WM_IME_STARTCOMPOSITION); // * 
00195     ADDHANDLER(WM_IME_ENDCOMPOSITION); // * 
00196     ADDHANDLER(WM_IME_COMPOSITION); // * 
00197     ADDHANDLEREX(WM_INITDIALOG, CISMH_InitDlg);
00198     ADDHANDLEREX(WM_COMMAND, CISMH_Cmd);                     
00199     ADDHANDLEREX(WM_SYSCOMMAND, CISMH_SysCmd);              
00200     ADDHANDLEREX(WM_TIMER, CISMH_Timer);
00201     ADDHANDLEREX(WM_HSCROLL, CISMH_HScroll);                    
00202     ADDHANDLEREX(WM_VSCROLL, CISMH_VScroll);                 
00203     ADDHANDLEREX(WM_INITMENU, CISMH_InitMenu);
00204     ADDHANDLEREX(WM_INITMENUPOPUP, CISMH_InitMenuPopup);
00205     ADDHANDLEREX(WM_MENUSELECT, CISMH_MenuSel);
00206     ADDHANDLEREX(WM_MENUCHAR, CISMH_MenuChar);
00207     ADDHANDLEREX(WM_ENTERIDLE, CISMH_EnterIdle);
00208     ADDHANDLERUNKEX(0x0122, "WM_MENURBUTTONUP", CISMH_MenuDrag);
00209     ADDHANDLERUNKEX(0x0123, "WM_MENUDRAG", CISMH_MenuDrag);                   
00210     ADDHANDLERUNK(0x0124, "WM_MENUGETOBJECT"); // *            
00211     ADDHANDLERUNK(0x0125, "WM_UNINITMENUPOPUP"); // *         
00212     ADDHANDLERUNKEX(0x0126, "WM_MENUCOMMAND", CISMH_MenuCmd);                 
00213     ADDHANDLERUNKEX(0x0127, "WM_CHANGEUISTATE", CISMH_UiState);                
00214     ADDHANDLERUNKEX(0x0128, "WM_UPDATEUISTATE", CISMH_UiState);             
00215     ADDHANDLERUNKNOPARAMS(0x0129, "WM_QUERYUISTATE");         
00216     ADDHANDLERUNK(0x0131, "WM_LBTRACKPOINT"); // *        
00217     ADDHANDLEREX(WM_CTLCOLORMSGBOX, CISMH_CtlColor);              
00218     ADDHANDLEREX(WM_CTLCOLOREDIT, CISMH_CtlColor);               
00219     ADDHANDLEREX(WM_CTLCOLORLISTBOX, CISMH_CtlColor);        
00220     ADDHANDLEREX(WM_CTLCOLORBTN, CISMH_CtlColor);      
00221     ADDHANDLEREX(WM_CTLCOLORDLG, CISMH_CtlColor);            
00222     ADDHANDLEREX(WM_CTLCOLORSCROLLBAR, CISMH_CtlColor);          
00223     ADDHANDLEREX(WM_CTLCOLORSTATIC, CISMH_CtlColor);            
00224     ADDHANDLEREX(WM_MOUSEMOVE, CISMH_Mouse);               
00225     ADDHANDLEREX(WM_LBUTTONDOWN, CISMH_Mouse);               
00226     ADDHANDLEREX(WM_LBUTTONUP, CISMH_Mouse);                
00227     ADDHANDLEREX(WM_LBUTTONDBLCLK, CISMH_Mouse);           
00228     ADDHANDLEREX(WM_RBUTTONDOWN, CISMH_Mouse);          
00229     ADDHANDLEREX(WM_RBUTTONUP, CISMH_Mouse);                   
00230     ADDHANDLEREX(WM_RBUTTONDBLCLK, CISMH_Mouse);             
00231     ADDHANDLEREX(WM_MBUTTONDOWN, CISMH_Mouse);             
00232     ADDHANDLEREX(WM_MBUTTONUP, CISMH_Mouse);                  
00233     ADDHANDLEREX(WM_MBUTTONDBLCLK, CISMH_Mouse);          
00234     ADDHANDLEREX(WM_MOUSEWHEEL, CISMH_MouseWheel);                
00235     ADDHANDLERUNKEX(0x020B, "WM_XBUTTONDOWN", CISMH_Mouse);            
00236     ADDHANDLERUNKEX(0x020C, "WM_XBUTTONUP", CISMH_Mouse);                  
00237     ADDHANDLERUNKEX(0x020D, "WM_XBUTTONDBLCLK", CISMH_Mouse);            
00238     ADDHANDLEREX(WM_PARENTNOTIFY, CISMH_ParentNotify);
00239     ADDHANDLEREX(WM_ENTERMENULOOP, CISMH_EnterMenu);
00240     ADDHANDLEREX(WM_EXITMENULOOP, CISMH_ExitMenu); 
00241     ADDHANDLEREX(WM_NEXTMENU, CISMH_NextMenu);
00242     ADDHANDLEREX(WM_SIZING, CISMH_SizingMoving);
00243     ADDHANDLEREX(WM_CAPTURECHANGED, CISMH_Capture);
00244     ADDHANDLEREX(WM_MOVING, CISMH_SizingMoving);
00245     ADDHANDLEREX(WM_POWERBROADCAST, CISMH_PowerBroadcast);
00246     ADDHANDLEREX(WM_DEVICECHANGE, CISMH_DevChange);
00247     ADDHANDLEREX(WM_MDICREATE, CISMH_MdiCreate);
00248     ADDHANDLEREX(WM_MDIDESTROY, CISMH_Mdi);                  
00249     ADDHANDLEREX(WM_MDIACTIVATE, CISMH_Mdi);                
00250     ADDHANDLEREX(WM_MDIRESTORE, CISMH_Mdi);             
00251     ADDHANDLEREX(WM_MDINEXT, CISMH_MdiNext); 
00252     ADDHANDLEREX(WM_MDIMAXIMIZE, CISMH_Mdi);                  
00253     ADDHANDLEREX(WM_MDITILE, CISMH_MdiTile);
00254     ADDHANDLEREX(WM_MDICASCADE, CISMH_MdiCascade);
00255     ADDHANDLERNOPARAMS(WM_MDIICONARRANGE);          
00256     ADDHANDLEREX(WM_MDIGETACTIVE, CISMH_MdiGetActive);
00257     ADDHANDLERUNK(0x022A, "WM_DROPOBJECT"); // *                 
00258     ADDHANDLERUNK(0x022B, "WM_QUERYDROPOBJECT"); // *             
00259     ADDHANDLERUNK(0x022C, "WM_BEGINDRAG"); // *                 
00260     ADDHANDLERUNK(0x022D, "WM_DRAGLOOP"); // *                  
00261     ADDHANDLERUNK(0x022E, "WM_DRAGSELECT"); // *                
00262     ADDHANDLERUNK(0x022F, "WM_DRAGMOVE"); // *              
00263     ADDHANDLEREX(WM_MDISETMENU, CISMH_MdiSetMenu);
00264     ADDHANDLERNOPARAMS(WM_ENTERSIZEMOVE);          
00265     ADDHANDLERNOPARAMS(WM_EXITSIZEMOVE);              
00266     ADDHANDLEREX(WM_DROPFILES, CISMH_Drop);
00267     ADDHANDLERNOPARAMS(WM_MDIREFRESHMENU);             
00268     ADDHANDLER(WM_IME_SETCONTEXT); // *            
00269     ADDHANDLER(WM_IME_NOTIFY); // *                  
00270     ADDHANDLER(WM_IME_CONTROL); // *               
00271     ADDHANDLER(WM_IME_COMPOSITIONFULL); // *       
00272     ADDHANDLER(WM_IME_SELECT); // *                 
00273     ADDHANDLEREX(WM_IME_CHAR, CISMH_Char);                  
00274     ADDHANDLERUNK(0x0288, "WM_IME_REQUEST"); // *                
00275     ADDHANDLEREX(WM_IME_KEYDOWN, CISMH_Key);             
00276     ADDHANDLEREX(WM_IME_KEYUP, CISMH_Key);                  
00277     ADDHANDLEREX(WM_MOUSEHOVER, CISMH_Mouse);                  
00278     ADDHANDLERNOPARAMS(WM_MOUSELEAVE);               
00279     ADDHANDLERNOPARAMS(WM_CUT);                         
00280     ADDHANDLERNOPARAMS(WM_COPY);                        
00281     ADDHANDLERNOPARAMS(WM_PASTE);                       
00282     ADDHANDLERNOPARAMS(WM_CLEAR);                    
00283     ADDHANDLERNOPARAMS(WM_UNDO);                         
00284     ADDHANDLER(WM_RENDERFORMAT); // *              
00285     ADDHANDLERNOPARAMS(WM_RENDERALLFORMATS);        
00286     ADDHANDLERNOPARAMS(WM_DESTROYCLIPBOARD);        
00287     ADDHANDLERNOPARAMS(WM_DRAWCLIPBOARD);        
00288     ADDHANDLER(WM_PAINTCLIPBOARD); // *           
00289     ADDHANDLER(WM_VSCROLLCLIPBOARD); // *           
00290     ADDHANDLER(WM_SIZECLIPBOARD); // *             
00291     ADDHANDLER(WM_ASKCBFORMATNAME); // *          
00292     ADDHANDLER(WM_CHANGECBCHAIN); // *                
00293     ADDHANDLER(WM_HSCROLLCLIPBOARD); // *             
00294     ADDHANDLERNOPARAMS(WM_QUERYNEWPALETTE);           
00295     ADDHANDLEREX(WM_PALETTEISCHANGING, CISMH_PalChange);   
00296     ADDHANDLEREX(WM_PALETTECHANGED, CISMH_PalChange);              
00297     ADDHANDLEREX(WM_HOTKEY, CISMH_Hotkey);                    
00298     ADDHANDLEREX(WM_PRINT, CISMH_Print);                  
00299     ADDHANDLEREX(WM_PRINTCLIENT, CISMH_Print);         
00300     ADDHANDLERUNK(0x0381, "WM_RCRESULT"); // *                  
00301     ADDHANDLERUNK(0x0382, "WM_HOOKRCRESULT"); // *                
00302 //  ADDHANDLER(0x0383, "WM_PENMISCINFO");                
00303     ADDHANDLERUNK(0x0383, "WM_GLOBALRCCHANGE"); // *     
00304     ADDHANDLERUNK(0x0384, "WM_SKB"); // *                          
00305     ADDHANDLERUNK(0x0385, "WM_PENCTL"); // *                    
00306 //  ADDHANDLER(0x0, "WM_HEDITCTL");                  
00307     ADDHANDLERUNK(0x0386, "WM_PENMISC"); // *                    
00308     ADDHANDLERUNK(0x0387, "WM_CTLINIT"); // *                 
00309     ADDHANDLERUNK(0x0388, "WM_PENEVENT"); // *                 
00310     ADDHANDLERMFCNOPARAMS(WM_QUERYAFXWNDPROC);         
00311     ADDHANDLERMFC(WM_SIZEPARENT); // *                 
00312     ADDHANDLERMFCEX(WM_SETMESSAGESTRING, CISMH_SetMessageStr);         
00313     ADDHANDLERMFCEX(WM_IDLEUPDATECMDUI, CISMH_CmdUI);            
00314     ADDHANDLERMFCNOPARAMS(WM_INITIALUPDATE);             
00315     ADDHANDLERMFC(WM_COMMANDHELP); // *          
00316     ADDHANDLERMFC(WM_HELPHITTEST); // *                 
00317     ADDHANDLERMFCNOPARAMS(WM_EXITHELPMODE);                 
00318     ADDHANDLERMFC(WM_RECALCPARENT); // *                
00319     ADDHANDLERMFC(WM_SIZECHILD); // *                   
00320     ADDHANDLERMFCNOPARAMS(WM_KICKIDLE);              
00321     ADDHANDLERMFCNOPARAMS(WM_QUERYCENTERWND);           
00322     ADDHANDLERMFCNOPARAMS(WM_DISABLEMODAL);                
00323     ADDHANDLERMFCEX(WM_FLOATSTATUS, CISMH_FloatStatus);
00324     ADDHANDLERMFC(WM_ACTIVATETOPLEVEL); // *            
00325     ADDHANDLERMFCNOPARAMS(WM_QUERY3DCONTROLS);              
00326     ADDHANDLERMFC(WM_SOCKET_NOTIFY); // *               
00327     ADDHANDLERMFC(WM_SOCKET_DEAD); // *                
00328     ADDHANDLERMFCEX(WM_POPMESSAGESTRING, CISMH_SetMessageStr);     
00329     ADDHANDLERNOPARAMS(WM_HELPPROMPTADDR);             
00330     ADDHANDLER(WM_FORWARDMSG); // *                
00331 }
00332 
00333 BOOL CISMsgManager::AddHandler(UINT uMsg, CISMsgHandler* pMsgHandler)
00334 {
00335     // delete any existing handler
00336     delete GetHandler(uMsg);
00337 
00338     m_mapHandlers[uMsg] = pMsgHandler;
00339 
00340     return TRUE;
00341 }
00342 
00343 CISMsgHandler* CISMsgManager::GetHandler(UINT uMsg)
00344 {
00345     CISMsgHandler* pHandler = NULL;
00346 
00347     m_mapHandlers.Lookup(uMsg, pHandler);
00348 
00349     return pHandler;
00350 }
00351 
00352 void CISMsgManager::DeleteMessageMap()
00353 {
00354     // iterate the map deleting as we go
00355     POSITION pos = m_mapHandlers.GetStartPosition();
00356 
00357     UINT uMsg;
00358     CISMsgHandler* pHandler = NULL;
00359 
00360     while (pos)
00361     {
00362         m_mapHandlers.GetNextAssoc(pos, uMsg, pHandler);
00363         delete pHandler;
00364     }
00365 
00366     m_mapHandlers.RemoveAll();
00367 }
00368 
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties




~ ~ ~ ~ ~ ~
Source Code without Comments is like a Cranberry Garland
without the berries. Comment your Code!
 
Commence Database User Support Group Forum
http://newsgroup.showoff-db.org/
~ ~ ~ ~ ~ ~
Author: Mark Petryk
Lorimark Solutions, LLC
mark@lorimarksolutions.com