Can someone please help me with this code... I am trying to send info to notepad when I click a mouse button.

LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
static HANDLE hFile = INVALID_HANDLE_VALUE;

switch(msg)
{
case WM_CREATE:
hFile = CreateFile(...);
return 0;

case WM_DESTROY:
CloseHandle(hFile);
PostQuitMessage(0);
return 0;

case WM_LBUTTONDOWN:
WriteFile(...);
return 0;

case WM_RBUTTONDOWN:
WriteFile(...);
return 0;

default:
return DefWindowProc(hwnd, msg, wParam, lParam);
}
}