| 92 | } |
| 93 | // |
| 94 | LRESULT CALLBACK HookWndProc ( HWND hWnd, UINT message, |
| 95 | WPARAM wParam, LPARAM lParam ) |
| 96 | { |
| 97 | switch ( message ) { |
| 98 | case WM_MENUCHAR: // only supported by IContextMenu3 |
| 99 | if ( g_IContext3 ) { |
| 100 | LRESULT lResult = 0; |
| 101 | g_IContext3->HandleMenuMsg2 ( message, wParam, lParam, &lResult ); |
| 102 | return ( lResult ); |
| 103 | } |
| 104 | break; |
| 105 | case WM_DRAWITEM: |
| 106 | case WM_MEASUREITEM: |
| 107 | if ( wParam ) { |
| 108 | break; // if wParam != 0 then the message is not menu-related |
| 109 | } |
| 110 | case WM_INITMENUPOPUP: |
| 111 | if ( g_IContext2 ) { |
| 112 | g_IContext2->HandleMenuMsg ( message, wParam, lParam ); |
| 113 | } else { // version 3 |
| 114 | g_IContext3->HandleMenuMsg ( message, wParam, lParam ); |
| 115 | } |
| 116 | return ( message == WM_INITMENUPOPUP ? 0 : TRUE ); // inform caller that |
| 117 | // we handled WM_INITPOPUPMENU by ourself |
| 118 | break; |
| 119 | default: |
| 120 | break; |
| 121 | } |
| 122 | // call original WndProc of window to prevent undefined bevhaviour |
| 123 | // |
| 124 | /*of window |
| 125 | return ::CallWindowProc ( ( WNDPROC ) GetProp ( hWnd, TEXT ( "OldWndProc" ) ), |
| 126 | hWnd, message, wParam, lParam ); |
| 127 | */ |
| 128 | return DefWindowProc ( hWnd, message, |
| 129 | wParam, lParam ); |
| 130 | } |
| 131 | BOOL GetContextMenu ( LPCWSTR path, void **ppContextMenu, int &iMenuType ) |
| 132 | { |
| 133 | *ppContextMenu = NULL; |
nothing calls this directly
no outgoing calls
no test coverage detected