A
aizb
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.Button1Click(Sender: TObject);
Var A:Array of TPoint;
Len:Integer;
rgn:THandle;
Buffer: array[0..255] of Char;
S: string;
begin
SetLength(a,4);
A[0].X:=-500000;
A[0].y:=-500000;
A[1].X:=-500000;
A[1].y:=500000;
A[2].X:=500000;
A[2].y:=-500000;
A[3].X:=500000;
A[3].y:=500000;
rgn:=CreatePolygonRgn(a,4,0);
//这里创建区域句柄失败!
//如果用PolygonRgn也会失败!
SetLength(S, 256);
Len:=FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM or FORMAT_MESSAGE_ARGUMENT_ARRAY, nil, GetLastError, 0, Buffer,
SizeOf(Buffer), nil);
while (Len > 0) and (Buffer[Len - 1] in [#0..#32, '.']) do Dec(Len);
SetString(s, Buffer, Len);
ShowMessage(s+IntToStr(rgn));
//这里显示的是参数错误!
end;
Var A:Array of TPoint;
Len:Integer;
rgn:THandle;
Buffer: array[0..255] of Char;
S: string;
begin
SetLength(a,4);
A[0].X:=-500000;
A[0].y:=-500000;
A[1].X:=-500000;
A[1].y:=500000;
A[2].X:=500000;
A[2].y:=-500000;
A[3].X:=500000;
A[3].y:=500000;
rgn:=CreatePolygonRgn(a,4,0);
//这里创建区域句柄失败!
//如果用PolygonRgn也会失败!
SetLength(S, 256);
Len:=FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM or FORMAT_MESSAGE_ARGUMENT_ARRAY, nil, GetLastError, 0, Buffer,
SizeOf(Buffer), nil);
while (Len > 0) and (Buffer[Len - 1] in [#0..#32, '.']) do Dec(Len);
SetString(s, Buffer, Len);
ShowMessage(s+IntToStr(rgn));
//这里显示的是参数错误!
end;