예제 #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 IEViewServerWindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) {
    IEView *view = IEView::get(GetParent(GetParent(hwnd)));
	if (view != NULL) {
		switch (message) {
		case WM_KEYUP:
			if (LOWORD(wParam) == VK_ESCAPE && !(GetKeyState(VK_SHIFT) & 0x8000)
			&& !(GetKeyState(VK_CONTROL) & 0x8000) && !(GetKeyState(VK_MENU) & 0x8000)) {
				//if (view->getBuilder() != NULL) {
					SendMessage(GetParent(GetParent(GetParent(hwnd))), WM_COMMAND, IDCANCEL, 0);
//				} else {

	//			}
			}
			break;
		case WM_KEYDOWN:
			view->translateAccelerator(message, wParam, lParam);
		   	break;
		case WM_SETFOCUS:
			{
				RECT rcWindow;
				POINT cursor;
				GetWindowRect(hwnd, &rcWindow);
				GetCursorPos(&cursor);
				if (cursor.y > rcWindow.bottom || cursor.y < rcWindow.top ||
					cursor.x > rcWindow.right || cursor.x < rcWindow.left) {
				} else {
					view->mouseActivate();
				}
				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->getServerWndProc(), hwnd, message, wParam, lParam);
    }
    return DefWindowProc (hwnd, message, wParam, lParam);
}