case idm_callwndproc:
case idm_cbt:
case idm_debug:
case idm_getmessage:
case idm_keyboard:
case idm_mouse:
case idm_msgfilter:
// use the menu-item identifier as an index
// into the array of structures with hook data.
index = loword(wparam);
// if the selected type of hook procedure isn't
// installed yet, install it and check the
// associated menu item.
if (!afhooks[index])
{