|
|
while
loop is the only way I can think of for a logical way of it catching a click and enabling it to paint from that click by setting a bool from false to true and repeating the loop for it to test if it should paint whether or not it's true or false. Get it?
TextOut(hdc, 0, 0, "I clicked!", 10)
by TextOut(hdc, x, y, "I clicked!", 10)
EDIT: damn, fell for it. Whatever, I leave the response here, maybe someone who actually needs help will come here. |
Perhaps you should improve your attempts to help? |
spoon licker wrote: |
---|
Perhaps you should improve your attempts to help? :P |
Besides, I already can program with Windows |
|
|
LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { static int x = 0, y = 0; switch (message) { case WM_LBUTTONDOWN: x = LOWORD(lParam); y = HIWORD(lParam); InvalidateRect(hwnd, 0, TRUE); break; case WM_DESTROY: PostQuitMessage (0); break; case WM_PAINT: { HDC hdc; PAINTSTRUCT PAINT; hdc = BeginPaint(hwnd, &PAINT); const char *text = "I clicked!"; TextOut(hdc, x, y, text, strlen(text)); EndPaint(hwnd, &PAINT); } } return DefWindowProc (hwnd, message, wParam, lParam); } try that. wm_paint is called each time the window is sized or overlapped. but if you call InvalidateRect, it will force it to send wm_paint. gl |
|
|
|
|
try
, can't it be spared for some thing else?