Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!helios!cs.tamu.edu From: tony@cs.tamu.edu (Tony Encarnacion) Newsgroups: comp.windows.ms.programmer Subject: Help on GetClientRect function Message-ID: <11736@helios.TAMU.EDU> Date: 2 Feb 91 21:44:27 GMT Sender: usenet@helios.TAMU.EDU Distribution: usa Organization: Computer Science Department, Texas A&M University Lines: 24 I have been trying to use GetClientRect function with no success. I hope somebody can explain what I have been doing wrong. The code is given below (hWnd is actually a child window, a menu item similar to the Word-for-Windows' menu below the standard menu bar). Thanks. long FAR PASCAL menu_proc (HWND hWnd, unsigned iMessage, WORD wParam, LONG lParam) { HDC hDC; LPRECT lpRect; switch (iMessage) { ... case WM_RBUTTONDOWN: GetClientRect (hWnd, lpRect); /* <<-- this is where it bombs */ hDC = GetDC (hWnd); /* out; */ InvertRect (hDC, lpRect); ReleaseDC (hWnd, hDC); break; ... }; }