Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

677 lines
20 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1996-1998 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // AtlDbgWin.cpp
  7. //
  8. // Abstract:
  9. // Implementation of the ATL window debugging functions.
  10. //
  11. // Author:
  12. // David Potter (davidp) June 2, 1998
  13. //
  14. // Revision History:
  15. //
  16. // Notes:
  17. //
  18. /////////////////////////////////////////////////////////////////////////////
  19. #include "AtlDbgWin.h"
  20. /////////////////////////////////////////////////////////////////////////////
  21. // Global Variables
  22. /////////////////////////////////////////////////////////////////////////////
  23. #if DBG && defined( _DBG_MSG )
  24. extern const ID_MAP_ENTRY s_rgmapWindowMsgs[];
  25. _declspec( selectany ) const ID_MAP_ENTRY s_rgmapWindowMsgs[] =
  26. {
  27. DECLARE_ID_STRING( WM_NULL )
  28. DECLARE_ID_STRING( WM_CREATE )
  29. DECLARE_ID_STRING( WM_DESTROY )
  30. DECLARE_ID_STRING( WM_MOVE )
  31. DECLARE_ID_STRING( WM_SIZE )
  32. DECLARE_ID_STRING( WM_ACTIVATE )
  33. DECLARE_ID_STRING( WM_SETFOCUS )
  34. DECLARE_ID_STRING( WM_KILLFOCUS )
  35. DECLARE_ID_STRING( WM_ENABLE )
  36. DECLARE_ID_STRING( WM_SETREDRAW )
  37. DECLARE_ID_STRING( WM_SETTEXT )
  38. DECLARE_ID_STRING( WM_GETTEXT )
  39. DECLARE_ID_STRING( WM_GETTEXTLENGTH )
  40. DECLARE_ID_STRING( WM_PAINT )
  41. DECLARE_ID_STRING( WM_CLOSE )
  42. #ifndef _WIN32_WCE
  43. DECLARE_ID_STRING( WM_QUERYENDSESSION )
  44. DECLARE_ID_STRING( WM_QUERYOPEN )
  45. DECLARE_ID_STRING( WM_ENDSESSION )
  46. #endif // _WIN32_WCE
  47. DECLARE_ID_STRING( WM_QUIT )
  48. DECLARE_ID_STRING( WM_ERASEBKGND )
  49. DECLARE_ID_STRING( WM_SYSCOLORCHANGE )
  50. DECLARE_ID_STRING( WM_SHOWWINDOW )
  51. #if(WINVER >= 0x0400)
  52. DECLARE_ID_STRING_EX( WM_WININICHANGE, _T(" / WM_SETTINGCHANGE") )
  53. #else
  54. DECLARE_ID_STRING( WM_WININICHANGE )
  55. #endif // (WINVER >= 0x0400)
  56. DECLARE_ID_STRING( WM_DEVMODECHANGE )
  57. DECLARE_ID_STRING( WM_ACTIVATEAPP )
  58. DECLARE_ID_STRING( WM_FONTCHANGE )
  59. DECLARE_ID_STRING( WM_TIMECHANGE )
  60. DECLARE_ID_STRING( WM_CANCELMODE )
  61. DECLARE_ID_STRING( WM_SETCURSOR )
  62. DECLARE_ID_STRING( WM_MOUSEACTIVATE )
  63. DECLARE_ID_STRING( WM_CHILDACTIVATE )
  64. DECLARE_ID_STRING( WM_QUEUESYNC )
  65. DECLARE_ID_STRING( WM_GETMINMAXINFO )
  66. DECLARE_ID_STRING( WM_PAINTICON )
  67. DECLARE_ID_STRING( WM_ICONERASEBKGND )
  68. DECLARE_ID_STRING( WM_NEXTDLGCTL )
  69. DECLARE_ID_STRING( WM_SPOOLERSTATUS )
  70. DECLARE_ID_STRING( WM_DRAWITEM )
  71. DECLARE_ID_STRING( WM_MEASUREITEM )
  72. DECLARE_ID_STRING( WM_DELETEITEM )
  73. DECLARE_ID_STRING( WM_VKEYTOITEM )
  74. DECLARE_ID_STRING( WM_CHARTOITEM )
  75. DECLARE_ID_STRING( WM_SETFONT )
  76. DECLARE_ID_STRING( WM_GETFONT )
  77. DECLARE_ID_STRING( WM_SETHOTKEY )
  78. DECLARE_ID_STRING( WM_GETHOTKEY )
  79. DECLARE_ID_STRING( WM_QUERYDRAGICON )
  80. DECLARE_ID_STRING( WM_COMPAREITEM )
  81. #if(WINVER >= 0x0500)
  82. #ifndef _WIN32_WCE
  83. DECLARE_ID_STRING( WM_GETOBJECT )
  84. #endif // _WIN32_WCE
  85. #endif // (WINVER >= 0x0500)
  86. DECLARE_ID_STRING( WM_COMPACTING )
  87. DECLARE_ID_STRING( WM_COMMNOTIFY )
  88. DECLARE_ID_STRING( WM_WINDOWPOSCHANGING )
  89. DECLARE_ID_STRING( WM_WINDOWPOSCHANGED )
  90. DECLARE_ID_STRING( WM_POWER )
  91. DECLARE_ID_STRING( WM_COPYDATA )
  92. DECLARE_ID_STRING( WM_CANCELJOURNAL )
  93. #if(WINVER >= 0x0400)
  94. DECLARE_ID_STRING( WM_NOTIFY )
  95. DECLARE_ID_STRING( WM_INPUTLANGCHANGEREQUEST )
  96. DECLARE_ID_STRING( WM_INPUTLANGCHANGE )
  97. DECLARE_ID_STRING( WM_TCARD )
  98. DECLARE_ID_STRING( WM_HELP )
  99. DECLARE_ID_STRING( WM_USERCHANGED )
  100. DECLARE_ID_STRING( WM_NOTIFYFORMAT )
  101. DECLARE_ID_STRING( WM_CONTEXTMENU )
  102. DECLARE_ID_STRING( WM_STYLECHANGING )
  103. DECLARE_ID_STRING( WM_STYLECHANGED )
  104. DECLARE_ID_STRING( WM_DISPLAYCHANGE )
  105. DECLARE_ID_STRING( WM_GETICON )
  106. DECLARE_ID_STRING( WM_SETICON )
  107. #endif // (WINVER >= 0x0400)
  108. DECLARE_ID_STRING( WM_NCCREATE )
  109. DECLARE_ID_STRING( WM_NCDESTROY )
  110. DECLARE_ID_STRING( WM_NCCALCSIZE )
  111. DECLARE_ID_STRING( WM_NCHITTEST )
  112. DECLARE_ID_STRING( WM_NCPAINT )
  113. DECLARE_ID_STRING( WM_NCACTIVATE )
  114. DECLARE_ID_STRING( WM_GETDLGCODE )
  115. #ifndef _WIN32_WCE
  116. DECLARE_ID_STRING( WM_SYNCPAINT )
  117. #endif // _WIN32_WCE
  118. DECLARE_ID_STRING( WM_NCMOUSEMOVE )
  119. DECLARE_ID_STRING( WM_NCLBUTTONDOWN )
  120. DECLARE_ID_STRING( WM_NCLBUTTONUP )
  121. DECLARE_ID_STRING( WM_NCLBUTTONDBLCLK )
  122. DECLARE_ID_STRING( WM_NCRBUTTONDOWN )
  123. DECLARE_ID_STRING( WM_NCRBUTTONUP )
  124. DECLARE_ID_STRING( WM_NCRBUTTONDBLCLK )
  125. DECLARE_ID_STRING( WM_NCMBUTTONDOWN )
  126. DECLARE_ID_STRING( WM_NCMBUTTONUP )
  127. DECLARE_ID_STRING( WM_NCMBUTTONDBLCLK )
  128. DECLARE_ID_STRING( WM_KEYDOWN )
  129. DECLARE_ID_STRING( WM_KEYUP )
  130. DECLARE_ID_STRING( WM_CHAR )
  131. DECLARE_ID_STRING( WM_DEADCHAR )
  132. DECLARE_ID_STRING( WM_SYSKEYDOWN )
  133. DECLARE_ID_STRING( WM_SYSKEYUP )
  134. DECLARE_ID_STRING( WM_SYSCHAR )
  135. DECLARE_ID_STRING( WM_SYSDEADCHAR )
  136. #if(WINVER >= 0x0400)
  137. DECLARE_ID_STRING( WM_IME_STARTCOMPOSITION )
  138. DECLARE_ID_STRING( WM_IME_ENDCOMPOSITION )
  139. DECLARE_ID_STRING( WM_IME_COMPOSITION )
  140. #endif // (WINVER >= 0x0400)
  141. DECLARE_ID_STRING( WM_INITDIALOG )
  142. DECLARE_ID_STRING( WM_COMMAND )
  143. DECLARE_ID_STRING( WM_SYSCOMMAND )
  144. DECLARE_ID_STRING( WM_TIMER )
  145. DECLARE_ID_STRING( WM_HSCROLL )
  146. DECLARE_ID_STRING( WM_VSCROLL )
  147. DECLARE_ID_STRING( WM_INITMENU )
  148. DECLARE_ID_STRING( WM_INITMENUPOPUP )
  149. DECLARE_ID_STRING( WM_MENUSELECT )
  150. DECLARE_ID_STRING( WM_MENUCHAR )
  151. DECLARE_ID_STRING( WM_ENTERIDLE )
  152. #if(WINVER >= 0x0500)
  153. #ifndef _WIN32_WCE
  154. DECLARE_ID_STRING( WM_MENURBUTTONUP )
  155. DECLARE_ID_STRING( WM_MENUDRAG )
  156. DECLARE_ID_STRING( WM_MENUGETOBJECT )
  157. DECLARE_ID_STRING( WM_UNINITMENUPOPUP )
  158. DECLARE_ID_STRING( WM_MENUCOMMAND )
  159. #ifndef _WIN32_WCE
  160. #if(_WIN32_WINNT >= 0x0500)
  161. DECLARE_ID_STRING( WM_KEYBOARDCUES )
  162. #endif // (_WIN32_WINNT >= 0x0500)
  163. #endif // _WIN32_WCE
  164. #endif // _WIN32_WCE
  165. #endif // (WINVER >= 0x0500)
  166. DECLARE_ID_STRING( WM_CTLCOLORMSGBOX )
  167. DECLARE_ID_STRING( WM_CTLCOLOREDIT )
  168. DECLARE_ID_STRING( WM_CTLCOLORLISTBOX )
  169. DECLARE_ID_STRING( WM_CTLCOLORBTN )
  170. DECLARE_ID_STRING( WM_CTLCOLORDLG )
  171. DECLARE_ID_STRING( WM_CTLCOLORSCROLLBAR )
  172. DECLARE_ID_STRING( WM_CTLCOLORSTATIC )
  173. DECLARE_ID_STRING( WM_MOUSEMOVE )
  174. DECLARE_ID_STRING( WM_LBUTTONDOWN )
  175. DECLARE_ID_STRING( WM_LBUTTONUP )
  176. DECLARE_ID_STRING( WM_LBUTTONDBLCLK )
  177. DECLARE_ID_STRING( WM_RBUTTONDOWN )
  178. DECLARE_ID_STRING( WM_RBUTTONUP )
  179. DECLARE_ID_STRING( WM_RBUTTONDBLCLK )
  180. DECLARE_ID_STRING( WM_MBUTTONDOWN )
  181. DECLARE_ID_STRING( WM_MBUTTONUP )
  182. DECLARE_ID_STRING( WM_MBUTTONDBLCLK )
  183. #if (_WIN32_WINNT >= 0x0400) || (_WIN32_WINDOWS >= 0x0400)
  184. DECLARE_ID_STRING( WM_MOUSEWHEEL )
  185. #endif // (_WIN32_WINNT >= 0x0400) || (_WIN32_WINDOWS >= 0x0400)
  186. DECLARE_ID_STRING( WM_PARENTNOTIFY )
  187. DECLARE_ID_STRING( WM_ENTERMENULOOP )
  188. DECLARE_ID_STRING( WM_EXITMENULOOP )
  189. #if(WINVER >= 0x0400)
  190. DECLARE_ID_STRING( WM_NEXTMENU )
  191. DECLARE_ID_STRING( WM_SIZING )
  192. DECLARE_ID_STRING( WM_CAPTURECHANGED )
  193. DECLARE_ID_STRING( WM_MOVING )
  194. #endif // (WINVER >= 0x0400)
  195. DECLARE_ID_STRING( WM_POWERBROADCAST )
  196. #if(WINVER >= 0x0400)
  197. DECLARE_ID_STRING( WM_DEVICECHANGE )
  198. #endif // (WINVER >= 0x0400)
  199. DECLARE_ID_STRING( WM_MDICREATE )
  200. DECLARE_ID_STRING( WM_MDIDESTROY )
  201. DECLARE_ID_STRING( WM_MDIACTIVATE )
  202. DECLARE_ID_STRING( WM_MDIRESTORE )
  203. DECLARE_ID_STRING( WM_MDINEXT )
  204. DECLARE_ID_STRING( WM_MDIMAXIMIZE )
  205. DECLARE_ID_STRING( WM_MDITILE )
  206. DECLARE_ID_STRING( WM_MDICASCADE )
  207. DECLARE_ID_STRING( WM_MDIICONARRANGE )
  208. DECLARE_ID_STRING( WM_MDIGETACTIVE )
  209. DECLARE_ID_STRING( WM_MDISETMENU )
  210. DECLARE_ID_STRING( WM_ENTERSIZEMOVE )
  211. DECLARE_ID_STRING( WM_EXITSIZEMOVE )
  212. DECLARE_ID_STRING( WM_DROPFILES )
  213. DECLARE_ID_STRING( WM_MDIREFRESHMENU )
  214. #if(WINVER >= 0x0400)
  215. DECLARE_ID_STRING( WM_IME_SETCONTEXT )
  216. DECLARE_ID_STRING( WM_IME_NOTIFY )
  217. DECLARE_ID_STRING( WM_IME_CONTROL )
  218. DECLARE_ID_STRING( WM_IME_COMPOSITIONFULL )
  219. DECLARE_ID_STRING( WM_IME_SELECT )
  220. DECLARE_ID_STRING( WM_IME_CHAR )
  221. #endif // (WINVER >= 0x0400)
  222. #if(WINVER >= 0x0500)
  223. DECLARE_ID_STRING( WM_IME_REQUEST )
  224. #endif // (WINVER >= 0x0500)
  225. #if(WINVER >= 0x0400)
  226. DECLARE_ID_STRING( WM_IME_KEYDOWN )
  227. DECLARE_ID_STRING( WM_IME_KEYUP )
  228. #endif // (WINVER >= 0x0400)
  229. #if(_WIN32_WINNT >= 0x0400)
  230. DECLARE_ID_STRING( WM_MOUSEHOVER )
  231. DECLARE_ID_STRING( WM_MOUSELEAVE )
  232. #endif // (_WIN32_WINNT >= 0x0400)
  233. #if(WINVER >= 0x0500)
  234. DECLARE_ID_STRING( WM_NCMOUSEHOVER )
  235. DECLARE_ID_STRING( WM_NCMOUSELEAVE )
  236. #endif // (WINVER >= 0x0500)
  237. DECLARE_ID_STRING( WM_CUT )
  238. DECLARE_ID_STRING( WM_COPY )
  239. DECLARE_ID_STRING( WM_PASTE )
  240. DECLARE_ID_STRING( WM_CLEAR )
  241. DECLARE_ID_STRING( WM_UNDO )
  242. DECLARE_ID_STRING( WM_RENDERFORMAT )
  243. DECLARE_ID_STRING( WM_RENDERALLFORMATS )
  244. DECLARE_ID_STRING( WM_DESTROYCLIPBOARD )
  245. DECLARE_ID_STRING( WM_DRAWCLIPBOARD )
  246. DECLARE_ID_STRING( WM_PAINTCLIPBOARD )
  247. DECLARE_ID_STRING( WM_VSCROLLCLIPBOARD )
  248. DECLARE_ID_STRING( WM_SIZECLIPBOARD )
  249. DECLARE_ID_STRING( WM_ASKCBFORMATNAME )
  250. DECLARE_ID_STRING( WM_CHANGECBCHAIN )
  251. DECLARE_ID_STRING( WM_HSCROLLCLIPBOARD )
  252. DECLARE_ID_STRING( WM_QUERYNEWPALETTE )
  253. DECLARE_ID_STRING( WM_PALETTEISCHANGING )
  254. DECLARE_ID_STRING( WM_PALETTECHANGED )
  255. DECLARE_ID_STRING( WM_HOTKEY )
  256. #if(WINVER >= 0x0400)
  257. DECLARE_ID_STRING( WM_PRINT )
  258. DECLARE_ID_STRING( WM_PRINTCLIENT )
  259. DECLARE_ID_STRING_2( WM_AFXFIRST+0, WM_QUERYAFXWNDPROC )
  260. DECLARE_ID_STRING_2( WM_AFXFIRST+1, WM_SIZEPARENT )
  261. DECLARE_ID_STRING_2( WM_AFXFIRST+2, WM_SETMESSAGESTRING )
  262. DECLARE_ID_STRING_2( WM_AFXFIRST+3, WM_IDLEUPDATECMDUI )
  263. DECLARE_ID_STRING_2( WM_AFXFIRST+4, WM_INITIALUPDATE )
  264. DECLARE_ID_STRING_2( WM_AFXFIRST+5, WM_COMMANDHELP )
  265. DECLARE_ID_STRING_2( WM_AFXFIRST+6, WM_HELPHITTEST )
  266. DECLARE_ID_STRING_2( WM_AFXFIRST+7, WM_EXITHELPMODE )
  267. DECLARE_ID_STRING_2( WM_AFXFIRST+8, WM_RECALCPARENT )
  268. DECLARE_ID_STRING_2( WM_AFXFIRST+9, WM_SIZECHILD )
  269. DECLARE_ID_STRING_2( WM_AFXFIRST+10, WM_KICKIDLE )
  270. DECLARE_ID_STRING_2( WM_AFXFIRST+11, WM_QUERYCENTERWND )
  271. DECLARE_ID_STRING_2( WM_AFXFIRST+12, WM_DISABLEMODAL )
  272. DECLARE_ID_STRING_2( WM_AFXFIRST+13, WM_FLOATSTATUS )
  273. DECLARE_ID_STRING_2( WM_AFXFIRST+14, WM_ACTIVATETOPLEVEL )
  274. DECLARE_ID_STRING_2( WM_AFXFIRST+15, WM_QUERY3DCONTROLS )
  275. DECLARE_ID_STRING_2( WM_AFXFIRST+16, WM_RESERVED_0370 )
  276. DECLARE_ID_STRING_2( WM_AFXFIRST+17, WM_RESERVED_0371 )
  277. DECLARE_ID_STRING_2( WM_AFXFIRST+18, WM_RESERVED_0372 )
  278. DECLARE_ID_STRING_2( WM_AFXFIRST+19, WM_SOCKET_NOTIFY )
  279. DECLARE_ID_STRING_2( WM_AFXFIRST+20, WM_SOCKET_DEAD )
  280. DECLARE_ID_STRING_2( WM_AFXFIRST+21, WM_POPMESSAGESTRING )
  281. DECLARE_ID_STRING_2( WM_AFXFIRST+22, WM_OCC_LOADFROMSTREAM )
  282. DECLARE_ID_STRING_2( WM_AFXFIRST+23, WM_OCC_LOADFROMSTORAGE )
  283. DECLARE_ID_STRING_2( WM_AFXFIRST+24, WM_OCC_INITNEW )
  284. DECLARE_ID_STRING_2( WM_AFXFIRST+25, WM_OCC_LOADFROMSTREAM_EX )
  285. DECLARE_ID_STRING_2( WM_AFXFIRST+26, WM_OCC_LOADFROMSTORAGE_EX )
  286. DECLARE_ID_STRING_2( WM_AFXFIRST+27, WM_QUEUE_SENTINEL )
  287. DECLARE_ID_STRING_2( WM_AFXFIRST+28, WM_RESERVED_037C )
  288. DECLARE_ID_STRING_2( WM_AFXFIRST+29, WM_RESERVED_037D )
  289. DECLARE_ID_STRING_2( WM_AFXFIRST+30, WM_RESERVED_037E )
  290. DECLARE_ID_STRING_2( WM_AFXFIRST+31, WM_RESERVED_037F )
  291. DECLARE_ID_STRING( WM_APP )
  292. #endif // (WINVER >= 0x0400)
  293. { NULL, 0 }
  294. };
  295. #endif // DBG && defined( _DBG_MSG )
  296. #if DBG && defined( _DBG_MSG_COMMAND )
  297. _declspec( selectany ) const ID_MAP_ENTRY s_rgmapButtonMsgs[] =
  298. {
  299. DECLARE_ID_STRING( BN_CLICKED )
  300. DECLARE_ID_STRING( BN_PAINT )
  301. DECLARE_ID_STRING_EX( BN_HILITE, _T(" / BN_PUSHED") )
  302. DECLARE_ID_STRING_EX( BN_UNHILITE, _T(" / BN_UNPUSHED") )
  303. DECLARE_ID_STRING( BN_DISABLE )
  304. DECLARE_ID_STRING( BN_DOUBLECLICKED )
  305. DECLARE_ID_STRING( BN_SETFOCUS )
  306. DECLARE_ID_STRING( BN_KILLFOCUS )
  307. { NULL, 0 }
  308. };
  309. _declspec( selectany ) const ID_MAP_ENTRY s_rgmapComboBoxMsgs[] =
  310. {
  311. DECLARE_ID_STRING_2( (UINT) CBN_ERRSPACE, CBN_ERRSPACE )
  312. DECLARE_ID_STRING( CBN_SELCHANGE )
  313. DECLARE_ID_STRING( CBN_DBLCLK )
  314. DECLARE_ID_STRING( CBN_SETFOCUS )
  315. DECLARE_ID_STRING( CBN_KILLFOCUS )
  316. DECLARE_ID_STRING( CBN_EDITCHANGE )
  317. DECLARE_ID_STRING( CBN_EDITUPDATE )
  318. DECLARE_ID_STRING( CBN_DROPDOWN )
  319. DECLARE_ID_STRING( CBN_CLOSEUP )
  320. DECLARE_ID_STRING( CBN_SELENDOK )
  321. DECLARE_ID_STRING( CBN_SELENDCANCEL )
  322. { NULL, 0 }
  323. };
  324. _declspec( selectany ) const ID_MAP_ENTRY s_rgmapEditMsgs[] =
  325. {
  326. DECLARE_ID_STRING( EN_SETFOCUS )
  327. DECLARE_ID_STRING( EN_KILLFOCUS )
  328. DECLARE_ID_STRING( EN_CHANGE )
  329. DECLARE_ID_STRING( EN_UPDATE )
  330. DECLARE_ID_STRING( EN_ERRSPACE )
  331. DECLARE_ID_STRING( EN_MAXTEXT )
  332. DECLARE_ID_STRING( EN_HSCROLL )
  333. DECLARE_ID_STRING( EN_VSCROLL )
  334. { NULL, 0 }
  335. };
  336. _declspec( selectany ) const ID_MAP_ENTRY s_rgmapListBoxMsgs[] =
  337. {
  338. DECLARE_ID_STRING( LBN_ERRSPACE )
  339. DECLARE_ID_STRING( LBN_SELCHANGE )
  340. DECLARE_ID_STRING( LBN_DBLCLK )
  341. DECLARE_ID_STRING( LBN_SELCANCEL )
  342. DECLARE_ID_STRING( LBN_SETFOCUS )
  343. DECLARE_ID_STRING( LBN_KILLFOCUS )
  344. { NULL, 0 }
  345. };
  346. _declspec( selectany ) const ID_MAP_ENTRY s_rgmapScrollBarMsgs[] =
  347. {
  348. { NULL, 0 }
  349. };
  350. _declspec( selectany ) const ID_MAP_ENTRY s_rgmapStaticMsgs[] =
  351. {
  352. { NULL, 0 }
  353. };
  354. _declspec( selectany ) const ID_MAP_ENTRY s_rgmapListViewMsgs[] =
  355. {
  356. { NULL, 0 }
  357. };
  358. _declspec( selectany ) const ID_MAP_ENTRY s_rgmapTreeViewMsgs[] =
  359. {
  360. { NULL, 0 }
  361. };
  362. _declspec( selectany ) const ID_MAP_ENTRY s_rgmapIPAddressMsgs[] =
  363. {
  364. DECLARE_ID_STRING( IPN_FIELDCHANGE )
  365. DECLARE_ID_STRING_EX( EN_SETFOCUS, _T(" (IPN)") )
  366. DECLARE_ID_STRING_EX( EN_KILLFOCUS, _T(" (IPN)") )
  367. DECLARE_ID_STRING_EX( EN_CHANGE, _T(" (IPN)") )
  368. DECLARE_ID_STRING_EX( EN_UPDATE, _T(" (IPN)") )
  369. DECLARE_ID_STRING_EX( EN_ERRSPACE, _T(" (IPN)") )
  370. DECLARE_ID_STRING_EX( EN_MAXTEXT, _T(" (IPN)") )
  371. DECLARE_ID_STRING_EX( EN_HSCROLL, _T(" (IPN)") )
  372. DECLARE_ID_STRING_EX( EN_VSCROLL, _T(" (IPN)") )
  373. { NULL, 0 }
  374. };
  375. #endif // DBG && defined( _DBG_MSG_COMMAND )
  376. #if DBG && defined( _DBG_MSG_NOTIFY )
  377. _declspec( selectany ) const ID_MAP_ENTRY s_rgmapPropSheetNotifyMsgs[] =
  378. {
  379. DECLARE_ID_STRING( PSN_SETACTIVE )
  380. DECLARE_ID_STRING( PSN_KILLACTIVE )
  381. DECLARE_ID_STRING( PSN_APPLY )
  382. DECLARE_ID_STRING( PSN_RESET )
  383. DECLARE_ID_STRING( PSN_HELP )
  384. DECLARE_ID_STRING( PSN_WIZBACK )
  385. DECLARE_ID_STRING( PSN_WIZNEXT )
  386. DECLARE_ID_STRING( PSN_WIZFINISH )
  387. DECLARE_ID_STRING( PSN_QUERYCANCEL )
  388. { NULL, 0 }
  389. };
  390. #endif // DBG && defined( _DBG_MSG_NOTIFY )
  391. /////////////////////////////////////////////////////////////////////////////
  392. // Global Functions
  393. /////////////////////////////////////////////////////////////////////////////
  394. #if DBG && defined( _DBG_MSG )
  395. /////////////////////////////////////////////////////////////////////////////
  396. //++
  397. //
  398. // DBG_OnMsg
  399. //
  400. // Routine Description:
  401. // Debug handler for any message.
  402. //
  403. // Arguments:
  404. // uMsg [IN] Message causing this function to be called.
  405. // wParam [IN] Message specific parameter.
  406. // lParam [IN] Message specific parameter.
  407. // bHandled [IN OUT] TRUE = message has been handled (we set to FALSE).
  408. // pszClassName [IN] Name of class calling this function.
  409. //
  410. // Return Value:
  411. // None.
  412. //
  413. //--
  414. /////////////////////////////////////////////////////////////////////////////
  415. LRESULT DBG_OnMsg(
  416. UINT uMsg,
  417. WPARAM wParam,
  418. LPARAM lParam,
  419. BOOL & bHandled,
  420. LPCTSTR pszClassName
  421. )
  422. {
  423. ATLASSERT( pszClassName != NULL );
  424. const ID_MAP_ENTRY * pmap;
  425. //
  426. // Display the message code.
  427. //
  428. ATLTRACE( _T("%s::OnMsg() - Message = %08.8X"), pszClassName, uMsg );
  429. pmap = s_rgmapWindowMsgs;
  430. if ( (WM_USER <= uMsg)
  431. && (uMsg < WM_APP) )
  432. {
  433. ATLTRACE( _T(" (WM_USER + %d)"), uMsg - WM_USER );
  434. } // if: user message
  435. #if(WINVER >= 0x0400)
  436. else if ( (WM_HANDHELDFIRST <= uMsg)
  437. && (uMsg <= WM_HANDHELDLAST) )
  438. {
  439. ATLTRACE( _T(" (WM_HANDHELDFIRST + %d)"), uMsg - WM_HANDHELDFIRST );
  440. } // else if: handheld PC message
  441. #endif // (WINVER >= 0x0400)
  442. else if ( (WM_PENWINFIRST <= uMsg)
  443. && (uMsg <= WM_PENWINLAST) )
  444. {
  445. ATLTRACE( _T(" (WM_PENWINFIRST + %d)"), uMsg - WM_PENWINFIRST );
  446. } // else if: pen windows message
  447. else
  448. {
  449. for ( ; pmap->pszName != NULL ; pmap++ )
  450. {
  451. if ( uMsg == pmap->id )
  452. {
  453. ATLTRACE( _T(" (%s)"), pmap->pszName );
  454. break;
  455. } // if: message found
  456. } // for: each code in the map
  457. } // else: not range message
  458. if ( (WM_AFXFIRST <= uMsg)
  459. && (uMsg <= WM_AFXLAST) )
  460. {
  461. ATLTRACE( _T(" (WM_AFXFIRST + %d)"), uMsg - WM_AFXFIRST );
  462. } // if: MFC message
  463. ATLTRACE( _T("\n") );
  464. bHandled = FALSE;
  465. return 1;
  466. } //*** DBG_OnMsg()
  467. #endif // DBG && defined( _DBG_MSG )
  468. #if DBG && defined( _DBG_MSG_NOTIFY )
  469. /////////////////////////////////////////////////////////////////////////////
  470. //++
  471. //
  472. // DBG_OnNotify
  473. //
  474. // Routine Description:
  475. // Debug handler for the WM_NOTIFY message.
  476. //
  477. // Arguments:
  478. // uMsg [IN] Message causing this function to be called (WM_NOTIFY).
  479. // wParam [IN] Unused.
  480. // lParam [IN] Pointer to notification message header (NMHDR).
  481. // bHandled [IN OUT] TRUE = message has been handled (we set to FALSE).
  482. // pszClassName [IN] Name of class calling this function.
  483. // pmapCtrlNames [IN] Map of control IDs to control names.
  484. //
  485. // Return Value:
  486. // None.
  487. //
  488. //--
  489. /////////////////////////////////////////////////////////////////////////////
  490. LRESULT DBG_OnNotify(
  491. UINT uMsg,
  492. WPARAM wParam,
  493. LPARAM lParam,
  494. BOOL & bHandled,
  495. LPCTSTR pszClassName,
  496. ID_MAP_ENTRY * pmapCtrlNames
  497. )
  498. {
  499. ATLASSERT( ::IsWindow( m_hWnd ) );
  500. ATLASSERT( pszClassName != NULL );
  501. NMHDR * pNMHDR = (NMHDR *) lParam;
  502. const ID_MAP_ENTRY * pmap;
  503. //
  504. // Display the control ID.
  505. //
  506. ATLTRACE( _T("%s::OnNotify() - idFrom = %d"), pszClassName, pNMHDR->idFrom );
  507. if ( pmapCtrlNames != NULL )
  508. {
  509. pmap = pmapCtrlNames;
  510. for ( ; pmap->pszName != NULL ; pmap++ )
  511. {
  512. if ( pNMHDR->idFrom == pmap->id )
  513. {
  514. ATLTRACE( _T(" (%s)"), pmap->pszName );
  515. } // if: control ID found
  516. } // for: each control in the map
  517. } // if: control names array specified
  518. //
  519. // Display the notification code.
  520. //
  521. ATLTRACE( _T(" code = %08.8X"), pNMHDR->code );
  522. pmap = s_rgmapPropSheetNotifyMsgs;
  523. for ( ; pmap->pszName != NULL ; pmap++ )
  524. {
  525. if ( pNMHDR->code == pmap->id )
  526. {
  527. ATLTRACE( _T(" (%s)"), pmap->pszName );
  528. break;
  529. } // if: code found
  530. } // for: each code in the map
  531. ATLTRACE( _T("\n") );
  532. bHandled = FALSE;
  533. return 1;
  534. } //*** DBG_OnNotify()
  535. #endif // DBG && defined( _DBG_MSG_NOTIFY )
  536. #if DBG && defined( _DBG_MSG_COMMAND )
  537. /////////////////////////////////////////////////////////////////////////////
  538. //++
  539. //
  540. // DBG_OnCommand
  541. //
  542. // Routine Description:
  543. // Debug handler for the WM_COMMAND message.
  544. //
  545. // Arguments:
  546. // uMsg [IN] Message causing this function to be called (WM_COMMAND).
  547. // wParam [IN] Notification code and control ID.
  548. // lParam [IN] Window handle to the control.
  549. // bHandled [IN OUT] TRUE = message has been handled (we set to FALSE).
  550. // pszClassName [IN] Name of class calling this function.
  551. // pmapCtrlNames [IN] Map of control IDs to control names.
  552. //
  553. // Return Value:
  554. // None.
  555. //
  556. //--
  557. /////////////////////////////////////////////////////////////////////////////
  558. LRESULT DBG_OnCommand(
  559. UINT uMsg,
  560. WPARAM wParam,
  561. LPARAM lParam,
  562. BOOL & bHandled,
  563. LPCTSTR pszClassName,
  564. ID_MAP_ENTRY * pmapCtrlNames
  565. )
  566. {
  567. ATLASSERT( pszClassName != NULL );
  568. WORD wNotifyCode = HIWORD( wParam );
  569. WORD idCtrl = LOWORD ( wParam );
  570. HWND hwndCtrl = (HWND) lParam;
  571. const ID_MAP_ENTRY * pmap;
  572. //
  573. // Display the control ID.
  574. //
  575. ATLTRACE( _T("%s::OnCommand() - idCtrl = %d"), pszClassName, idCtrl );
  576. if ( pmapCtrlNames != NULL )
  577. {
  578. pmap = pmapCtrlNames;
  579. for ( ; pmap->pszName != NULL ; pmap++ )
  580. {
  581. if ( idCtrl == pmap->id )
  582. {
  583. ATLTRACE( _T(" (%s)"), pmap->pszName );
  584. } // if: control ID found
  585. } // for: each control in the map
  586. } // if: control names array specified
  587. //
  588. // Get the window class.
  589. //
  590. TCHAR szWindowClass[256];
  591. ::GetClassName( hwndCtrl, szWindowClass, (sizeof( szWindowClass ) / sizeof( TCHAR )) - 1 );
  592. ATLTRACE( _T(" (%s)"), szWindowClass );
  593. //
  594. // Display the notification code.
  595. //
  596. ATLTRACE( _T(" wNotifyCode = %04.4X"), wNotifyCode );
  597. if ( lstrcmp( szWindowClass, _T("Button") ) == 0 )
  598. {
  599. pmap = s_rgmapButtonMsgs;
  600. }
  601. else if ( lstrcmp( szWindowClass, _T("ComboBox") ) == 0 )
  602. {
  603. pmap = s_rgmapComboBoxMsgs;
  604. }
  605. else if ( lstrcmp( szWindowClass, _T("Edit") ) == 0 )
  606. {
  607. pmap = s_rgmapEditMsgs;
  608. }
  609. else if ( lstrcmp( szWindowClass, _T("ListBox")) == 0 )
  610. {
  611. pmap = s_rgmapListBoxMsgs;
  612. }
  613. else if ( lstrcmp(szWindowClass, _T("ScrollBar")) == 0 )
  614. {
  615. pmap = s_rgmapScrollBarMsgs;
  616. }
  617. else if ( lstrcmp(szWindowClass, _T("Static")) == 0 )
  618. {
  619. pmap = s_rgmapStaticMsgs;
  620. }
  621. else if ( lstrcmp(szWindowClass, WC_LISTVIEW) == 0 )
  622. {
  623. pmap = s_rgmapListViewMsgs;
  624. }
  625. else if ( lstrcmp(szWindowClass, WC_TREEVIEW) == 0 )
  626. {
  627. pmap = s_rgmapTreeViewMsgs;
  628. }
  629. else if ( lstrcmp(szWindowClass, WC_IPADDRESS) == 0 )
  630. {
  631. pmap = s_rgmapIPAddressMsgs;
  632. }
  633. else
  634. {
  635. pmap = NULL;
  636. }
  637. if ( pmap != NULL )
  638. {
  639. for ( ; pmap->pszName != NULL ; pmap++ )
  640. {
  641. if ( wNotifyCode == pmap->id )
  642. {
  643. ATLTRACE( _T(" (%s)"), pmap->pszName );
  644. break;
  645. } // if: code found
  646. } // for: each code in the map
  647. } // if: known control
  648. ATLTRACE( _T("\n") );
  649. bHandled = FALSE;
  650. return 1;
  651. } //*** DBG_OnCommand()
  652. #endif // DBG && defined( _DBG_MSG_COMMAND )