code_junkie

Embedding HWND into external process using SetParent

Nov 11th, 2011
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. HWND myWindow; //Handle to my application window
  2. HWND externalWindow; //Handle to external application window
  3.  
  4. SetParent(myWindow,externalWindow);
  5.  
  6. //Remove WS_POPUP style and add WS_CHILD style
  7. DWORD style = GetWindowLong(myWindow,GWL_STYLE);
  8. style = style & ~(WS_POPUP);
  9. style = style | WS_CHILD;
  10. SetWindowLong(myWindow,GWL_STYLE,style);
Add Comment
Please, Sign In to add comment