dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: How to retrieve the address of the surface of a HWND?

  1. #1
    Join Date
    Dec 2010
    Posts
    115

    How to retrieve the address of the surface of a HWND?

    I've got a little Directdraw application, that currently is rendering into the desktop (the listview), but I want to divert it to another window, How can I get the surface address of the HWND?

    Code:
    DDSURFACEDESC ddsd;
    ddsd.lpSurface=???
    Currently, it is rendering into the desktop because when I create the Directdraw object, I also create a new surface for it.

    When I do
    Code:
     
    m_pDDF->CreateDirectDraw(NULL, ::GetDesktopWindow(), DDSDL_NORMAL, NULL, NULL, &m_pDD);
    When I swap the application window with my HWND, it still render into the desktop..

    thanks
    Jack

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    19,562

    Re: How to retrieve the address of the surface of a HWND?

    Quote Originally Posted by luckiejacky View Post
    ...
    Currently, it is rendering into the desktop because when I create the Directdraw object, I also create a new surface for it.

    When I do
    Code:
     
    m_pDDF->CreateDirectDraw(NULL, ::GetDesktopWindow(), DDSDL_NORMAL, NULL, NULL, &m_pDD);
    When I swap the application window with my HWND, it still render into the desktop..
    Did you try to pass in your HWND handle rather than desktop one?
    Victor Nijegorodov

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)