Sign in to follow this  
Love3DGraphiks

How to Draw to Another Windows

Recommended Posts

I Wrote a DLL used for Hooking Mouse And 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 Cursor So 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

Share this post


Link to post
Share on other sites
did you try checking for errors during those calls you described? I bet one of them failed somewhere along the line...

Share this post


Link to post
Share on other sites
Quote:
Original post by zppz
did 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 wrong
but if I set GL context for foreign Windows that I get its Handle Device Context ,it aint work
Maybe we cant not draw sumthing in foreign windows with OPENGL excep using GDI
,I use GDI then it work fine

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this