Jump to content
View in the app

A better way to browse. Learn more.

Tuts 4 You

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

PureBasic Adventures - PW_RENDERFULLCONTENT

Featured Replies

Posted

This is a repost from the "PureBasic Adventures" blog...

Apparently... Windows 8.1 came with a new flag for PrintWindow called, PW_RENDERFULLCONTENT. This allows PrintWindow to properly capture window content that is displaying DirectX through DWM.

Below are some screenshots taken of Unreal Tournament. The first is how PrintWindow normally captures a window with DirectX content being rendered inside it, notice the window border is missing and there is corrupted graphics on the right. The second screenshot is taken with PW_RENDERFULLCONTENT...blogentry-1.png.75e6f73488877c399885baabf4b11159.png

blogentry-2.png.cf678e04e2676172f36997f950efe008.png

Below is an example using PureBasic code, there isn't much information about PW_RENDERFULLCONTENT and it is currently undocumented on MSDN. I am sure if I had a bit more spare time I could find a more worthy example to show you than the above images. You get the idea though...

UsePNGImageEncoder()

Declare PrintScreen(hWnd)

Prototype.i PrintWindow(hWnd, hdcBlt, nFlags)Global PrintWindow.PrintWindow

If OpenWindow(1, #Null, #Null, #Null, #Null, "Capture Window", #PB_Window_Invisible)
  Repeat
    MyEvent = WaitWindowEvent()
    
    If GetAsyncKeyState_(#VK_SNAPSHOT) & $8000
      PrintScreen(FindWindow_(#Null, "Unreal Tournament"))
    EndIf
    
    If GetAsyncKeyState_(#VK_ESCAPE) & $8000
      MyEvent = #PB_Event_CloseWindow
    EndIf
    
  Until MyEvent = #PB_Event_CloseWindow
EndIf

Procedure PrintScreen(hWnd)
  Protected r.RECT
  
  #PW_RENDERFULLCONTENT = $00000002
  
  If OpenLibrary(User32, "User32.dll")
    PrintWindow = GetFunction(User32, "PrintWindow")
    
    If GetWindowRect_(hWnd, r.RECT)
      If CreateImage(CapImage, r\right-r\left, r\bottom-r\top, 32)
        hdc = StartDrawing(ImageOutput(CapImage))
        
        ; PW_RENDERFULLCONTENT -> new in Windows 8.1, can capture DirectX screens through DWM
        
        Okay = PrintWindow(hWnd, hdc, #PW_RENDERFULLCONTENT)
        StopDrawing()
        
        If Okay
          SaveImage(CapImage, "C:\Users\Teddy\Downloads\" + FormatDate("%yyyy.%mm.%DD-%hh.%ii.%ss", Date()) + ".png", #PB_ImagePlugin_PNG)
          CloseLibrary(User32)
          ProcedureReturn
        EndIf
        
      EndIf
    EndIf
    CloseLibrary(User32)
  EndIf
  
EndProcedure

If you have more information or details on PW_RENDERFULLCONTENT please tell me about it...

Ted.

Create an account or sign in to comment

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.