RTFPAD - 4


if(!RegisterClass((LPWNDCLASS)&wc.style))

return FALSE;

hWnd = CreateWindow(szAppName, szAppTitle,

WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, 0,

CW_USEDEFAULT, 0, NULL, NULL, hInst, NULL);

if(!hWnd) return(FALSE);

ShowWindow(hWnd, nCmdShow);

UpdateWindow(hWnd);

while(GetMessage(&msg, NULL, 0, 0))

{

TranslateMessage(&msg);

DispatchMessage(&msg);

}

return msg.wParam;

}

// -----------------------------------------------------

// WndProc

// -----------------------------------------------------

LRESULT WINAPI

WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)

{

//

short zDelta;

switch(msg)

{

HANDLE_MSG(hWnd, WM_CREATE, WndProc_OnCreate);

HANDLE_MSG(hWnd, WM_DESTROY, WndProc_OnDestroy);

HANDLE_MSG(hWnd, WM_COMMAND, WndProc_OnCommand);

HANDLE_MSG(hWnd, WM_SIZE, WndProc_OnSize);

HANDLE_MSG(hWnd, WM_SETFOCUS, WndProc_OnSetFocus);

default:

{

if(msg == WM_MOUSEWHEEL)

{

zDelta = (short)HIWORD(wParam);

if(zDelta < 0)

if(uiScrollLines != WHEEL_PAGESCROLL)

SendMessage(hwndEdit, EM_LINESCROLL, 0,

uiScrollLines);

else

SendMessage(hwndEdit, EM_SCROLL,

(WPARAM)(INT)SB_PAGEDOWN, 0);

else

if(uiScrollLines != WHEEL_PAGESCROLL)

SendMessage(hwndEdit, EM_LINESCROLL, 0,

-(LPARAM)uiScrollLines);

else

SendMessage(hwndEdit, EM_SCROLL,

(WPARAM)(INT)SB_PAGEUP, 0);

return 0L;

}

else if(msg == uMSH_MOUSEEHEEL)

{

zDelta = (short)wParam;

if(zDelta < 0)

if(uiScrollLines != WHEEL_PAGESCROLL)

SendMessage(hwndEdit, EM_LINESCROLL, 0,

uiScrollLines);

else

SendMessage(hwndEdit, EM_SCROLL,

(WPARAM)(INT)SB_PAGEDOWN, 0);

else

if(uiScrollLines != WHEEL_PAGESCROLL)

SendMessage(hwndEdit, EM_LINESCROLL, 0,

-(LPARAM)uiScrollLines);

else

SendMessage(hwndEdit, EM_SCROLL,

(WPARAM)(INT)SB_PAGEUP, 0);

return 0L;

}

return(DefWindowProc(hWnd, msg, wParam, lParam));

}

}

}

. . .

, . , , . .