static int winValMsgProc(Ihandle* ih, UINT msg, WPARAM wp, LPARAM lp, LRESULT *result) { (void)lp; switch (msg) { case WM_SETFOCUS: { if (!iupAttribGetBoolean(ih, "CANFOCUS")) { HWND previous = (HWND)wp; if (previous && previous != ih->handle) { SetFocus(previous); *result = 0; return 1; } } break; } case WM_ERASEBKGND: { RECT rect; HDC hDC = (HDC)wp; GetClientRect(ih->handle, &rect); iupwinDrawParentBackground(ih, hDC, &rect); /* return non zero value */ *result = 1; return 1; } case WM_KEYDOWN: case WM_SYSKEYDOWN: { if (iupwinBaseMsgProc(ih, msg, wp, lp, result)==1) return 1; if (GetKeyState(VK_CONTROL) & 0x8000) /* handle Ctrl+Arrows */ { if (wp == VK_UP || wp == VK_LEFT) { winValIncPageValue(ih, -1); *result = 0; return 1; } if (wp == VK_RIGHT || wp == VK_DOWN) { winValIncPageValue(ih, 1); *result = 0; return 1; } } return 0; } } return iupwinBaseMsgProc(ih, msg, wp, lp, result); }
static int winValProc(Ihandle* ih, UINT msg, WPARAM wp, LPARAM lp, LRESULT *result) { (void)lp; switch (msg) { case WM_ERASEBKGND: { RECT rect; HDC hDC = (HDC)wp; GetClientRect(ih->handle, &rect); iupwinDrawParentBackground(ih, hDC, &rect); /* return non zero value */ *result = 1; return 1; } case WM_KEYDOWN: case WM_SYSKEYDOWN: { if (iupwinBaseProc(ih, msg, wp, lp, result)==1) return 1; if (GetKeyState(VK_CONTROL) & 0x8000) /* handle Ctrl+Arrows */ { if (wp == VK_UP || wp == VK_LEFT) { winValIncPageValue(ih, -1); *result = 0; return 1; } if (wp == VK_RIGHT || wp == VK_DOWN) { winValIncPageValue(ih, 1); *result = 0; return 1; } } return 0; } } return iupwinBaseProc(ih, msg, wp, lp, result); }