' цвет рамки окна SelectHwnd и текста размеров

Sub Obj.Color(col As COLORREF=GetGadgetColor(TopRight,1),Coltext As COLORREF=GetGadgetColor(SizeValue,2))
	For b As Integer=SizeValue To BottomRightSize
		If flag=0 Then
			TextGadget(b, 6, 2, 90, 16,,SS_CENTER)
		EndIf
		SetGadgetColor(b, col ,col,3)
	Next
	SetGadgetColor(SizeValue,col ,ColText,3)
	SetGadgetColor(Exit_W,col,ColText,3)
End Sub

'--------------изменение размеров по таймеру SelectScreenshootWindow-----------

Sub Obj.Size()
	Static As Integer w,h
	If w<>WindowClientWidth(a.SelectHwnd) Or h<>WindowClientHeight(a.SelectHwnd) Then
		w=WindowClientWidth(a.SelectHwnd):h=WindowClientHeight(a.SelectHwnd)
		ResizeGadget(TopRight,6,20,w-13,1)
		ResizeGadget(RightBottom,w-8,20,1,h-26)
		ResizeGadget(BottomRight,6,h-8,w-12,1)
		ResizeGadget(LeftBottom,6,20,1,h-26)
		ResizeGadget(Exit_W,w-22,2,15,16)
		ResizeGadget(TopSize,(w-8)\2,14,8,6)
		ResizeGadget(LeftSize,0,(h+8)\2,6,8)
		ResizeGadget(BottomSize,(w-8)\2,h-7,8,6)
		ResizeGadget(RightSize,w-7,(h+8)\2,6,8)
		ResizeGadget(BottomLeftSize,2,h-8,8,8)
		ResizeGadget(BottomRightSize,w-8,h-8,8,8)
		SetGadgetText(SizeValue,w-15 & " x " & h-30)
		SetToolTipText(SizeValue,ToolTip,w-15 & " x " & h-30)
	EndIf
End Sub

' ------------------Окно для получения выборочного скриншота-------------------

Sub Obj.SelectScreenshootWindow()
	SelectHwnd = OpenWindow("", 0, 0, 300, 180,WS_POPUP Or WS_VISIBLE,WS_EX_LAYERED)
	SetWindowTop(SelectHwnd,1)
	CenterWindow(SelectHwnd)
	WindowColor(SelectHwnd,&h000000)
	SetLayeredWindowAttributes(SelectHwnd,0,0,1)
	Color(255,1)
	GadgetToolTip(SizeValue,"1",ToolTip)
	flag=1
	SetGadgetText(Exit_W, "X")
	SetWindowCallback(Cast(Integer,@windowproc),1)	
End Sub
