Troy,
Just a SWAG, but top-level forms are of a different class than the normal in screen or in top-level form. With those forms, the window only has one window handle, which covers the entire window. A top-level form, however, has two parts: the frame, and the client area. Each has its own distinct window handle. You can retrieve the client area window handle like this
DECLARE INTEGER FindWindowEx IN Win32API;
INTEGER hWnd, INTEGER hWndAfter,;
STRING @lpzClass, STRING @lpzWindow
lnhwnd = FindWindowEx(ThisForm.hWnd, 0, 0, 0)
Try using this window handle to get the device context, rather than the window handle of the form (ThisForm.hWnd).
George
Ubi caritas et amor, deus ibi est