   Direct3D in windowed mode:  Mixing with common controls
  Greetings, it's been a while.My current project requires me to build an application using the old Win32 C++ API (yeah, I know, Vista will phase it out, but them's the breaks).  The application uses several of the common controls (e.g., buttons, static labels, trackbar).  However, I also want to have a Direct3D view on the same window.Anyone who has done this:  What's the easiest method?  Should I simply send the window handle to IDirect3D9::CreateDevice (per the normal procedure for windowed Direct3D) but only draw on part of the window?  Or should I create a custom control as a child of the main window and send its handle instead?  I don't have much experience messing with controls on the Win32 level, but neither MFC, third-party libraries, nor managed/.NET languages are an option.Thanks in advance.   
  The most common way I've seen this done is to do it map-editor style, where you have a normal app (with all your controls and stuff), but then a display in the middle or something.  IIRC, you can do this with an Image Box control.  Just get the HWND of the image box, and give it to CreateDevice().  Then, your device will just present into that box.This way is pretty clean, because you pretty much just embed your renderer into that one image box.   ;  Thanks circlesoft,The closest Win32 control I can find to ImageBox is a static control with the SS_OWNERDRAW window style.  This may be what I end up using, but I'm somewhat concerned that static controls cannot gain keyboard focus, and I'd like to be able to give the control keyboard focus so that I can use keyboard controls to navigate the 3D environment.Perhaps I can make an owner-drawn button instead, since those can have keyboard focus.  Alternatively, I might just make a standard window with no frame, make it a child of the main window, and handle WM_SIZE in the main window to make sure the child window is always in the correct position relative to the parent.   ;Quote:Original post by blahpersThanks circlesoft,The closest Win32 control I can find to ImageBox is a static control with the SS_OWNERDRAW window style.  This may be what I end up using, but I'm somewhat concerned that static controls cannot gain keyboard focus, and I'd like to be able to give the control keyboard focus so that I can use keyboard controls to navigate the 3D environment.Perhaps I can make an owner-drawn button instead, since those can have keyboard focus.  Alternatively, I might just make a standard window with no frame, make it a child of the main window, and handle WM_SIZE in the main window to make sure the child window is always in the correct position relative to the parent.The last approach is guaranteed to work. Come back and tell us if you get it to work with the other approaches, though [smile].   