1


I have a no-borders fullscreen window created with the WinApi function CreateWindowEx :

    m_window = CreateWindowEx(
        WS_EX_TOOLWINDOW | WS_EX_TOPMOST,
        winClassName,
        winName,
        WS_VISIBLE | WS_POPUP,
        CW_USEDEFAULT, CW_USEDEFAULT,
        GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN),
        NULL,
        NULL,
        hInstance,
        NULL
    );

If I try to take a screenshot of the window with the Print-Scr key, the window won't appear on the result (everything that is behind appears though).
Using WS_POPUP as window style seems to be the source of the problem, but I couldn't find any other way to create a no-border window with the WinApi.

Deanna
  • 23,876
  • 7
  • 71
  • 156
Jack
  • 87
  • 2
  • 7
  • This works fine for me on Windows 7, so I suspect the problem lies elsewhere. How are you painting the window? – arx Oct 13 '12 at 14:20
  • 1
    @arx : After creation, I'm attaching an OpenGL context to the window, and for the painting I use SwapBuffers since I have double buffering enabled. One weird thing I noticed is that if I use a lower window size than the size of the screen, the capture works perfectly (even if I use something like screenSizeX - 1 and/or screenSizeY - 1) – Jack Oct 13 '12 at 18:07
  • By the way, I'm also on Windows 7 :) – Jack Oct 13 '12 at 18:08
  • 3
    As far as I know, as soon as an OpenGL or DirectX application window goes full screen it works differently. Because there's no need for desktop composition the screen is rendered directly from your buffer and GDI can't capture it. [More details here](http://stackoverflow.com/questions/3486729/opengl-d3d-how-do-i-get-a-screen-grab-of-a-game-running-full-screen-in-windows). [Taksi](http://taksi.sourceforge.net/) is supposed to be able to capture fullscreen OpenGL. – arx Oct 13 '12 at 19:52

0 Answers0