Still not working. Do I need to process the paint messages? Here's my entire WndProc so far.
Code:
LRESULT CALLBACK WindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
static HWND hEdit;
static RECT Rect;
switch (message)
{ case WM_CREATE:
GetClientRect(hWnd, &Rect);
hEdit=CreateWindow("edit", NULL,
WS_CHILD | WS_TABSTOP | WS_VISIBLE | ES_AUTOHSCROLL | ES_LEFT,
4, 4,
(int)((Rect.right) /2), (int)((Rect.bottom) /10) ,
hWnd, NULL, hInstance, NULL);
break;
case WM_SIZE:
if (wParam==SIZE_MINIMIZED) //allow window to be minimized
{DefWindowProc(hwnd, message, wParam, lParam);
break;
}
//falls through
case WM_MOVE: //Doesn't let resize or move
SetWindowPos(hWnd, HWND_NOTOPMOST,
GetSystemMetrics(SM_CXSCREEN) / 6,
GetSystemMetrics(SM_CYSCREEN) / 8,
4 * GetSystemMetrics(SM_CXSCREEN) / 6,
6 * GetSystemMetrics(SM_CYSCREEN) / 8,
(UINT)NULL);
SetWindowPos(hEdit, HWND_TOPMOST,
4, 4,
(int)((Rect.right) /2), (int)((Rect.bottom) /10) ,
(UINT)NULL);
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hwnd, message, wParam, lParam);
}
return 0;
}
EDIT: Just fixed the spacing. It didn't copy well.