Fixes compilation of the wince interface under win32 operating system.

git-svn-id: trunk@18985 -
This commit is contained in:
sekelsenmat 2009-03-14 00:10:37 +00:00
parent 41ff1a63f0
commit 3393bef1b3
3 changed files with 25 additions and 8 deletions

View File

@ -979,13 +979,7 @@ begin
Dec(ORect.Right, ARect.Right);
Dec(ORect.Bottom, ARect.Bottom);
end;
{
if (GetWindowLong(Handle, GWL_EXSTYLE) and WS_EX_CLIENTEDGE) <> 0 then
begin
Dec(LeftOffset, Windows.GetSystemMetrics(SM_CXEDGE));
Dec(TopOffset, Windows.GetSystemMetrics(SM_CYEDGE));
end;
}
Result := True;
end;
@ -1159,7 +1153,11 @@ begin
New(WindowInfo);
FillChar(WindowInfo^, sizeof(WindowInfo^), 0);
WindowInfo^.DrawItemIndex := -1;
{$ifdef win32}
Windows.SetPropW(Window, PWideChar(DWord(WindowInfoAtom)), DWord(WindowInfo));
{$else}
Windows.SetProp(Window, PWideChar(DWord(WindowInfoAtom)), DWord(WindowInfo));
{$endif}
Result := WindowInfo;
end;
@ -1167,15 +1165,24 @@ function DisposeWindowInfo(Window: HWND): boolean;
var
WindowInfo: PWindowInfo;
begin
{$ifdef win32}
WindowInfo := PWindowInfo(Windows.GetPropW(Window, PWideChar(DWord(WindowInfoAtom))));
Result := Windows.RemovePropW(Window, PWideChar(DWord(WindowInfoAtom)))<>0;
{$else}
WindowInfo := PWindowInfo(Windows.GetProp(Window, PWideChar(DWord(WindowInfoAtom))));
Result := Windows.RemoveProp(Window, PWideChar(DWord(WindowInfoAtom)))<>0;
{$endif}
if Result then
Dispose(WindowInfo);
end;
function GetWindowInfo(Window: HWND): PWindowInfo;
begin
{$ifdef win32}
Result := PWindowInfo(Windows.GetPropW(Window, PWideChar(DWord(WindowInfoAtom))));
{$else}
Result := PWindowInfo(Windows.GetProp(Window, PWideChar(DWord(WindowInfoAtom))));
{$endif}
if Result = nil then
Result := @DefaultWindowInfo;
end;

View File

@ -62,7 +62,11 @@ var
begin
init.dwSize := Sizeof(TINITCOMMONCONTROLSEX);
init.dwICC := ICC_DATE_CLASSES;
{$ifdef win32}
InitCommonControlsEx(init);
{$else}
InitCommonControlsEx(@init);
{$endif}
// general initialization of Params
PrepareCreateWindow(AWinControl, Params);
// customization of Params

View File

@ -193,7 +193,8 @@ begin
end;
end;
procedure CalcFormWindowFlags(const AForm: TCustomForm; var Flags, FlagsEx: dword);
procedure CalcFormWindowFlags(const AForm: TCustomForm;
var Flags, FlagsEx: dword);
var
BorderStyle: TFormBorderStyle;
begin
@ -207,6 +208,11 @@ begin
Flags := Flags or CalcBorderIconsFlags(AForm);
end;
{
This routine fills SizeRect with
the necessary window size to have it's
BoundsRect.
}
procedure AdjustFormBounds(const AForm: TCustomForm; var SizeRect: TRect);
begin
// the LCL defines the size of a form without border, win32 with.