I came with this, your thought?
void EchoGLwndproc(IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam) {
if (gP.splitXoffset) {
POINT p = { 0 };
switch (uMsg) {
case WM_LBUTTONDOWN:
case WM_RBUTTONDOWN:
case WM_MBUTTONDOWN:
case WM_MOUSEMOVE:
p.x = LOINT(lParam) + gP.splitXoffset;
p.y = HIINT(lParam);
lParam = (LPARAM)MAKELONG(p.x, p.y);
break;
}
}
gl_WndProc(gP.hGL, uMsg, wParam, lParam);
}
LRESULT CALLBACK GDImageHelpCallBack(IN HWND hWnd, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam) {
LRESULT nRet = FALSE; // Do not stop the event processing in GDImage.
long nCount = 0, item = 0, x = 0, y = 0, nID = ZI_MouseOverObjectID();
POINT p = { 0 };
BOOL DoIt;
HWND hList;
RECT lpr = { 0 };
switch (uMsg) {
case WM_SETFOCUS:
SetFocus(gP.hMain);
break;
case WM_LBUTTONDOWN:
if (nID > IDT_HELPTOPIC) {
hList = GetDlgItem(GetParent(hWnd), IDC_HELPLIST);
item = nID - IDT_HELPTOPIC;
PathCombine(gP.mt.FullName, HelpFolder(), List_GetText(hList, item));
List_SelectPlus(hList, item);
SetWindowText(hWnd, L"");
ZD_GetObjectXY(nID, x, y);
ZD_SetObjectXY(ID_HELP_SELECTED, x, y, FALSE);
// Load the new topic
LoadPNG(hWnd, gP.mt.FullName);
WindowRedraw(GetScrollHandle(hWnd)); // Redraw the scrollbar
ZI_UpdateWindow(hWnd, 0);
} else {
//gl_WndProc(gP.hGL, uMsg, wParam, lParam);
EchoGLwndproc(uMsg, wParam, lParam);
nRet = 1;
}
break;
case WM_KEYDOWN:
hList = GetDlgItem(GetParent(hWnd), IDC_HELPLIST);
item = List_GetCursel(hList);
nCount = List_GetCount(hList);
DoIt = FALSE;
switch (wParam) {
case VK_UP:
case VK_NUMPAD8:
if (item > 1) {
item--; List_SelectPlus(hList, item);
DoIt = TRUE;
}
break;
case VK_DOWN:
case VK_NUMPAD2:
if (item < nCount) {
item++; List_SelectPlus(hList, item);
DoIt = TRUE;
}
break;
}
if (DoIt) {
nID = IDT_HELPTOPIC + item;
PathCombine(gP.mt.FullName, HelpFolder(), List_GetText(hList, item));
SetWindowText(hWnd, L"");
ZD_GetObjectXY(nID, x, y);
ZD_SetObjectXY(ID_HELP_SELECTED, x, y, FALSE);
// Load the new topic
LoadPNG(hWnd, gP.mt.FullName);
WindowRedraw(GetScrollHandle(hWnd)); // Redraw the scrollbar
ZI_UpdateWindow(hWnd, 0);
}
break;
case WM_NCPAINT:
skUpdateWindow(GetScrollHandle(hWnd), 0);
nRet = 1; // We are using a custom ScrollBar, thus get rid of Windows default
break;
case WM_VSCROLL:
case WM_HSCROLL:
skUpdateWindow(GetScrollHandle(hWnd), 0);
break;
case WM_MOUSEWHEEL:
p.x = LOINT(lParam);
p.y = HIINT(lParam);
ScreenToClient(hWnd, &p);
GetClientRect(hWnd, &lpr);
if ((p.x < 280) || (p.x > Width(lpr) - 100)) { // Limit help scrolling zone to the sides, and keep center for gP.hGL
skUpdateWindow(GetScrollHandle(hWnd), 0);
} else {
//gl_WndProc(gP.hGL, uMsg, wParam, lParam);
EchoGLwndproc(uMsg, wParam, lParam);
nRet = 1;
}
break;
default:
//gl_WndProc(gP.hGL, uMsg, wParam, lParam);
EchoGLwndproc(uMsg, wParam, lParam);
}
return nRet;
}