示例#1
0
static LRESULT CALLBACK IEViewServerWindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) {
    IEView *view = IEView::get(GetParent(GetParent(hwnd)));
	if (view != NULL) {
		switch (message) {
		case WM_KEYDOWN:
			view->translateAccelerator(message, wParam, lParam);
		   	break;
		case WM_SETFOCUS:
			if (view->setFocus((HWND)wParam)) {
				return TRUE;
			}
			break;
		case WM_LBUTTONDOWN:
		    POINT pt;
		    pt.x = LOWORD(lParam);
		    pt.y = HIWORD(lParam);
	   		if (view->mouseClick(pt)) {
	   		    return TRUE;
       		}
		    break;
		}
		return CallWindowProc(view->getUserWndProc(), hwnd, message, wParam, lParam);
    }
    return DefWindowProc (hwnd, message, wParam, lParam);
}
示例#2
0
static LRESULT CALLBACK IEViewWindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) {
   	IEView *view = IEView::get(hwnd);
   	if (view!=NULL) {
		WNDPROC oldWndProc = view->getUserWndProc();
    	if (message == WM_PARENTNOTIFY && wParam == WM_CREATE) {
			SetWindowLong(hwnd, GWL_WNDPROC, (LONG) oldWndProc);
			view->setUserWndProc((WNDPROC) SetWindowLong((HWND)lParam, GWL_WNDPROC, (LONG) IEViewDocWindowProcedure));
		}
		return CallWindowProc(oldWndProc, hwnd, message, wParam, lParam);
    }
    return DefWindowProc (hwnd, message, wParam, lParam);
}