//QM v2.9. Do not edit with text editor!!! //
4     2
qkos!G$.zs4BJ\]
  dlg_snapshot  8 36E4ED61 0
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages

def SB_SETPARTS 0x00000404
def SB_SETTEXTA 0x00000401

if(!ShowDialog("dlg_snapshot" &dlg_snapshot)) ret

 BEGIN DIALOG
 0 "" 0x90CE0A40 0x108 0 0 238 236 "Screen Snapshot"
 3 Static 0x5400100D 0x20004 0 0 154 62 ""
 20 msctls_statusbar32 0x54000100 0x0 0 240 222 14 ""
 END DIALOG
 DIALOG EDITOR: "" 0x2030008 "" "" ""

ret
 messages
sel message
	case WM_INITDIALOG
	int ix iy cix ciy ox oy cox coy
	str s
	type DSSHOTDATA hWbm mx my bmx bmy offsx offsy flags scale rscale
	DSSHOTDATA- dd
	RECT- r
	DSS_autosize(hDlg r 1)
	dd.hWbm=id(3 hDlg)
	dd.scale=1
	__Font-- f
	f.Create("Arial" 9 1)
	f.SetDialogFont(hDlg "20")

	__MemBmp- t_mb
	
	SetTimer hDlg 1 50 0
	int-- _hwnd=win("IrfanView" "IrfanView")
	
	case WM_DRAWITEM
	if(dd.bmx=0) ret
	dd.flags~0x100
	DRAWITEMSTRUCT& d=+lParam
	int bmxs=dd.bmx*dd.scale
	if bmxs>=r.right
		cix=r.right/dd.scale
		ix=(dd.bmx-cix)/2+dd.offsx
		if(ix<0) dd.offsx=dd.offsx-ix ;ix=0
		else
			int dx=dd.bmx-(ix+cix)
			if(dx<0) dd.offsx=dd.offsx+dx ;ix+dx
		ox=0
		cox=r.right
	else
		ix=0 ;dd.offsx=0 ;dd.flags|0x100
		cix=dd.bmx
		ox=(r.right-bmxs)/2+dd.offsx
		cox=bmxs
	int bmys=dd.bmy*dd.scale
	if bmys>=r.bottom
		ciy=r.bottom/dd.scale
		iy=(dd.bmy-ciy)/2+dd.offsy
		if(iy<0) dd.offsy=dd.offsy-iy ;iy=0
		else
			int dy=dd.bmy-(iy+ciy)
			if(dy<0) dd.offsy=dd.offsy+dy ;iy+dy
		oy=0
		coy=r.bottom
	else
		iy=0 ;dd.offsy=0 ;dd.flags|0x100
		ciy=dd.bmy
		oy=(r.bottom-bmys)/2
		coy=bmys
	int rdc=t_mb.dc
	if(dd.flags&0x600=0x600) ret
	if dd.flags&0x100
		dd.flags|0x200
		FillRect(d.hDC &d.rcItem COLOR_APPWORKSPACE+1)
	StretchBlt(d.hDC ox oy cox coy rdc ix iy cix ciy SRCCOPY)
	
	case WM_LBUTTONDOWN
	dd.mx=xm(0 dd.hWbm) ;dd.my=ym(0 dd.hWbm) ;dd.rscale=dd.scale
	dd.offsx=dd.offsx+(dd.mx-(r.right/2)/dd.scale)
	dd.offsy=dd.offsy+(dd.my-(r.bottom/2)/dd.scale)
	dd.flags|0x800
	case WM_LBUTTONUP dd.rscale=0
	
	case WM_NOTIFY
	sel wParam
		case 20
		NMMOUSE* nm=+lParam
		sel nm.dwItemSpec
			case 0 dd.flags^0x8000 ;DSS_autosize(hDlg r dd.flags&0x8000|8)
	
	case WM_TIMER
	if(wParam=1)
		if dd.rscale
			int i=(dd.my-ym(0 dd.hWbm))/10+dd.rscale
			if(i>16) i=16
			if(i<1) i=1 ;if(dd.flags&0x800) dd.offsx=0 ;dd.offsy=0 ;goto g_redraw
			if i<>dd.scale
				dd.scale=i
				if(dd.scale>1) s.format("Screen Snapshot x%i" i)
				else s="Screen Snapshot"
				s.setwintext(hDlg)
				dd.flags~(0x200|0x800)
				goto g_redraw
		if(dd.flags&0x80) goto g_redraw
		if(dd.flags&0x8000) ret
		ifk(S)
			POINT p; xm p ;;get mouse pos
			dd.bmx=r.right ;dd.bmy=r.bottom
			t_mb.Create(dd.bmx dd.bmy 1 p.x-(dd.bmx/2) p.y-(dd.bmy/2)) ;;take snapshot
			 g_redraw
			dd.flags~0x80
			RedrawWindow id(3 hDlg) 0 0 RDW_INVALIDATE
	
	case WM_DESTROY
	case WM_COMMAND goto messages2
	case WM_SIZE DSS_autosize(hDlg r) ;dd.flags|0x480
	case WM_EXITSIZEMOVE dd.flags~0x600 ;goto g_redraw
	 case else out "%x" message
ret
 messages2
 out "%x" message
sel wParam
	case IDOK
	case IDCANCEL
ret 1

  DSS_autosize  8 36E4EDA5 0
 /
function hDlg RECT&r [flg]
int hsb=GetDlgItem(hDlg 20)
if flg&8
	str s=iif(flg&0x8000 "Disabled" "Press SHIFT to shoot")
	SendMessage hsb SB_SETTEXTA 0 s
	ret
SendMessage(hsb WM_SIZE 0 0)
RECT rsb
GetWindowRect(hsb &rsb)
int y1=rsb.bottom-rsb.top

GetClientRect(hDlg &r) ;r.bottom-y1

MoveWindow GetDlgItem(hDlg 3) 0 0 r.right r.bottom 1

if flg&1
	int w1(180) w2(240) w3(310)
	SendMessage hsb SB_SETPARTS 3 &w1
	SendMessage hsb SB_SETTEXTA 0 "Press SHIFT to shoot"

  file  268500992 0

  