you could ask the app to give you its thumbnail:
Code: Select all
EnableExplicit
#DWM_TNP_RECTDESTINATION = $00000001
#DWM_TNP_OPACITY = $00000004
#DWM_TNP_VISIBLE = $00000008
#DWM_TNP_SOURCECLIENTAREAONLY = $00000010
Structure DWM_THUMBNAIL_PROPERTIES
dwFlags.l
rcDestination.RECT
rcSource.RECT
opacity.a
PB_Alignment.b[3]
fVisible.l
fSourceClientAreaOnly.l
EndStructure
Prototype.l DwmRegisterThumbnail_(hwndDestination, hwndSource, *phThumbnailId)
Prototype.l DwmQueryThumbnailSourceSize_(hThumbnail, *pSize)
Prototype.l DwmUpdateThumbnailProperties_(hThumbnailId, *ptnProperties)
Prototype.l DwmUnregisterThumbnail_(hThumbnailId)
Procedure DwmThumbnail(hwndSource, hwndDestination)
Protected LibraryPB, DwmRegisterThumbnail_.DwmRegisterThumbnail_, DwmQueryThumbnailSourceSize_.DwmQueryThumbnailSourceSize_, DwmUpdateThumbnailProperties_.DwmUpdateThumbnailProperties_, DwmUnregisterThumbnail_.DwmUnregisterThumbnail_, hThumbnailId, size.SIZE, dwm_thumbnail_properties.DWM_THUMBNAIL_PROPERTIES
LibraryPB = OpenLibrary(#PB_Any, "Dwmapi.dll")
If LibraryPB
DwmRegisterThumbnail_ = GetFunction(LibraryPB, "DwmRegisterThumbnail")
DwmQueryThumbnailSourceSize_ = GetFunction(LibraryPB, "DwmQueryThumbnailSourceSize")
DwmUpdateThumbnailProperties_ = GetFunction(LibraryPB, "DwmUpdateThumbnailProperties")
DwmUnregisterThumbnail_ = GetFunction(LibraryPB, "DwmUnregisterThumbnail")
If DwmRegisterThumbnail_ And DwmRegisterThumbnail_(hwndDestination, hwndSource, @hThumbnailId) = #S_OK
If DwmQueryThumbnailSourceSize_ And DwmQueryThumbnailSourceSize_(hThumbnailId, @size) = #S_OK
dwm_thumbnail_properties\dwFlags = #DWM_TNP_RECTDESTINATION | #DWM_TNP_OPACITY | #DWM_TNP_VISIBLE | #DWM_TNP_SOURCECLIENTAREAONLY
dwm_thumbnail_properties\rcDestination\right = size\cx
dwm_thumbnail_properties\rcDestination\bottom = size\cy
dwm_thumbnail_properties\opacity = 255
dwm_thumbnail_properties\fVisible = #True
If DwmUpdateThumbnailProperties_ And DwmUpdateThumbnailProperties_(hThumbnailId, @dwm_thumbnail_properties) = #S_OK
;...
EndIf
EndIf
;If DwmUnregisterThumbnail_
;DwmUnregisterThumbnail_(hThumbnailId)
;EndIf
EndIf
CloseLibrary(LibraryPB)
EndIf
EndProcedure
OpenWindow(0, 100, 100, 320, 240, "Source", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget)
SetWindowColor(0, RGB(63, 127, 255))
OpenWindow(1, 450, 100, 400, 350, "Destination", #PB_Window_SystemMenu)
SetWindowColor(1, RGB(255, 255, 255))
DwmThumbnail(WindowID(0), WindowID(1))
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
there is probably a better way, but i think dwm is the way to go.
c ya,
nco2k