Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
VISTA APP PREVIEW [Mini Window]
#2
Function dlg_window_thumbnail
Code:
Copy      Help
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages

if(!ShowDialog("dlg_window_thumbnail" &dlg_window_thumbnail 0)) ret

;BEGIN DIALOG
;0 "" 0x90C80A44 0x100 0 0 186 138 "Dialog"
;END DIALOG
;DIALOG EDITOR: "" 0x2030009 "*" "" ""

ret
;messages
sel message
,case WM_INITDIALOG
,int h=win("Calc")
,int-- thumbnail
,thumbnail=DwmShowThumbnail(hDlg h)
,
,case WM_DESTROY
,if(thumbnail) DwmUnregisterThumbnail thumbnail
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1

Function DwmShowThumbnail
Code:
Copy      Help
;/
function# hwnd hwnd2

;Shows thumbnail of hwnd2 in hwnd.
;Works on Vista only.


if(_winnt<6) ret

type DWM_THUMBNAIL_PROPERTIES dwFlags RECT'rcDestination RECT'rcSource !opacity fVisible fSourceClientAreaOnly
def DWM_TNP_RECTDESTINATION 0x00000001
def DWM_TNP_RECTSOURCE 0x00000002
def DWM_TNP_OPACITY 0x00000004
def DWM_TNP_VISIBLE 0x00000008
def DWM_TNP_SOURCECLIENTAREAONLY 0x00000010
dll- dwmapi
,#DwmRegisterThumbnail hwndDestination hwndSource *phThumbnailId
,#DwmUnregisterThumbnail hThumbnailId
,#DwmUpdateThumbnailProperties hThumbnailId DWM_THUMBNAIL_PROPERTIES*ptnProperties

int thumbnail
int hr = DwmRegisterThumbnail(hwnd hwnd2 &thumbnail)
if(hr) ret

RECT r; GetClientRect hwnd &r

DWM_THUMBNAIL_PROPERTIES tp
tp.dwFlags = DWM_TNP_RECTDESTINATION|DWM_TNP_VISIBLE|DWM_TNP_SOURCECLIENTAREAONLY ;;note: if DWM_TNP_SOURCECLIENTAREAONLY flag set, always gets only client regardless of fSourceClientAreaOnly.
tp.fSourceClientAreaOnly = 1
tp.fVisible = 1
tp.opacity = 255
tp.rcDestination = r

hr = DwmUpdateThumbnailProperties(thumbnail &tp)

ret thumbnail


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)