Screenshot of window isn't themed

Just starting out? Need help? Post your questions and find answers here.
User avatar
idle
Always Here
Always Here
Posts: 5039
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: Screenshot of window isn't themed

Post by idle »

Dude wrote:Thanks idle, it sure does! :)
It should also capture a windowscreen and for Vista / Win7 compatibility, it might also need enable DwmEnableComposition

Code: Select all

Procedure DWMEnableDisable(OnOff.i)
  Protected *pAfunc,Lib
  Lib = LoadLibrary_("dwmapi.dll")
  If Lib
    *pAfunc = GetProcAddress_(Lib, "DwmEnableComposition") 
    If *pAfunc
      CallFunctionFast(*pAfunc, OnOff) 
    EndIf 
    FreeLibrary_(Lib) 
  EndIf
EndProcedure 
Windows 11, Manjaro, Raspberry Pi OS
Image
Dude
Addict
Addict
Posts: 1907
Joined: Mon Feb 16, 2015 2:49 pm

Re: Screenshot of window isn't themed

Post by Dude »

Back for another question, nco2k. :)

On the first page of this thread, you showed how to do a thumbnail of a window. Are you able to explain how to show just a portion of the source window as the thumbnail in the target window? Everything I've tried always shows the entire source window as a thumbnail.

Aiming to do like this app:

https://github.com/LionelJouin/PiP-Tool

So I know it's possible. The relevant part of my source is this:

Code: Select all

dwm_thumbnail_properties\rcSource\left=x
dwm_thumbnail_properties\rcSource\top=y
dwm_thumbnail_properties\rcSource\right=w
dwm_thumbnail_properties\rcSource\bottom=h
dwm_thumbnail_properties\rcDestination\left=0
dwm_thumbnail_properties\rcDestination\top=0
dwm_thumbnail_properties\rcDestination\right=w
dwm_thumbnail_properties\rcDestination\bottom=h
Where X/Y are the top left desired area of the source (not of its window corner), and W/H is partial of the source window. Just can't seem to make any progress. :(
User avatar
nco2k
Addict
Addict
Posts: 1344
Joined: Mon Sep 15, 2003 5:55 am

Re: Screenshot of window isn't themed

Post by nco2k »

a wild guess:
#DWM_TNP_RECTSOURCE = $00000002

dwm_thumbnail_properties\dwFlags = #DWM_TNP_RECTSOURCE | ...
dwm_thumbnail_properties\rcSource\left = x
dwm_thumbnail_properties\rcSource\top = y
dwm_thumbnail_properties\rcSource\right = Width
dwm_thumbnail_properties\rcSource\bottom = Height
c ya,
nco2k
If OSVersion() = #PB_OS_Windows_ME : End : EndIf
BarryG
Addict
Addict
Posts: 3292
Joined: Thu Apr 18, 2019 8:17 am

Re: Screenshot of window isn't themed

Post by BarryG »

nco2k wrote: Wed Mar 28, 2018 9:10 pmDwmThumbnail(WindowID(0), WindowID(1))
Just testing this and was wondering if drawing the thumbnail be put on a gadget, like a ButtonGadget for clicking it? Instead of drawing it direct to a window? I tried using the GadgetID() of various gadgets but no luck.
Post Reply