   How to Draw to Another Windows
  I Wrote a DLL used for Hooking MouseAnd when never the Mouse Button is Clicked, the Hook Func will sent  program A message(WM_MOUSEHOOK define as WM_USER+6) and the handle of  window under the Mouse CursorSo when never I catch the Message WM_MOUSEHOOK I unhook FUnction and I get Handle DC from function GetDC(Handle of Windows Under Cursor) then I SetPixelFormat for that Handle DC  ,then use hRGL=wglCreateContext(Handle DC)then wglMakeCurrent(Handle DC,hRGL);then I GetClientRect(handle of windows Under Cursor,lpRect);then I glViewport(0,0,lpRect->right,lpRect->bottom);Ok so when Never I draw and then SwapBuffer(Handle DC); it must Draw on Window that It catched the Handle  But Acctually It aint work So can u help me please Thanks   
  did you try checking for errors during those calls you described? I bet one of them failed somewhere along the line...;Quote:Original post by zppzdid you try checking for errors during those calls you described? I bet one of them failed somewhere along the line...If I do it with the Handle of Window is running  then it OK nothing wrongbut if I set GL context for foreign Windows that I get its Handle Device Context ,it aint workMaybe we cant not draw sumthing in foreign windows with OPENGL excep using GDI,I use GDI then it work fine   