win32 interface: replaced SetClassLong with SetClassLongPtr to make it 64 bits safe (issue #19321)

git-svn-id: trunk@36074 -
This commit is contained in:
vincents 2012-03-16 08:49:12 +00:00
parent c5696c73fd
commit bf211c7a21
4 changed files with 11 additions and 11 deletions

View File

@ -529,10 +529,10 @@ begin
if FAppHandle <> 0 then if FAppHandle <> 0 then
begin begin
Windows.SendMessage(FAppHandle, WM_SETICON, ICON_SMALL, LPARAM(Small)); Windows.SendMessage(FAppHandle, WM_SETICON, ICON_SMALL, LPARAM(Small));
SetClassLong(FAppHandle, GCL_HICONSM, LONG(Small)); SetClassLongPtr(FAppHandle, GCL_HICONSM, LONG_PTR(Small));
Windows.SendMessage(FAppHandle, WM_SETICON, ICON_BIG, LPARAM(Big)); Windows.SendMessage(FAppHandle, WM_SETICON, ICON_BIG, LPARAM(Big));
SetClassLong(FAppHandle, GCL_HICON, LONG(Big)); SetClassLongPtr(FAppHandle, GCL_HICON, LONG_PTR(Big));
end; end;
end; end;
@ -684,13 +684,13 @@ begin
begin begin
if TCustomForm(Sender).BorderStyle <> bsDialog then if TCustomForm(Sender).BorderStyle <> bsDialog then
begin begin
SetClassLong(Handle, GCL_HICONSM, LONG(TCustomForm(Sender).SmallIconHandle)); SetClassLongPtr(Handle, GCL_HICONSM, LONG_PTR(TCustomForm(Sender).SmallIconHandle));
SetClassLong(Handle, GCL_HICON, LONG(TCustomForm(Sender).BigIconHandle)); SetClassLongPtr(Handle, GCL_HICON, LONG_PTR(TCustomForm(Sender).BigIconHandle));
end end
else else
begin begin
SetClassLong(Handle, GCL_HICONSM, 0); SetClassLongPtr(Handle, GCL_HICONSM, 0);
SetClassLong(Handle, GCL_HICON, 0); SetClassLongPtr(Handle, GCL_HICON, 0);
end; end;
end; end;
end end

View File

@ -452,10 +452,10 @@ begin
if FAppHandle <> 0 then if FAppHandle <> 0 then
begin begin
Windows.SendMessage(FAppHandle, WM_SETICON, ICON_SMALL, LPARAM(Small)); Windows.SendMessage(FAppHandle, WM_SETICON, ICON_SMALL, LPARAM(Small));
SetClassLong(FAppHandle, GCL_HICONSM, LONG(Small)); SetClassLongPtr(FAppHandle, GCL_HICONSM, LONG_PTR(Small));
Windows.SendMessage(FAppHandle, WM_SETICON, ICON_BIG, LPARAM(Big)); Windows.SendMessage(FAppHandle, WM_SETICON, ICON_BIG, LPARAM(Big));
SetClassLong(FAppHandle, GCL_HICON, LONG(Big)); SetClassLongPtr(FAppHandle, GCL_HICON, LONG_PTR(Big));
end; end;
end; end;

View File

@ -83,7 +83,7 @@ begin
// create window // create window
FinishCreateWindow(AWinControl, Params, False); FinishCreateWindow(AWinControl, Params, False);
Result := Params.Window; Result := Params.Window;
SetClassLong(Result, GCL_STYLE, GetClassLong(Result, GCL_STYLE) or CS_DBLCLKS); SetClassLongPtr(Result, GCL_STYLE, GetClassLongPtr(Result, GCL_STYLE) or CS_DBLCLKS);
// resize to proper size // resize to proper size
SetBounds(AWinControl, Params.Left, Params.Top, 0, 0); SetBounds(AWinControl, Params.Left, Params.Top, 0, 0);
end; end;

View File

@ -621,10 +621,10 @@ begin
Exit; Exit;
Wnd := AForm.Handle; Wnd := AForm.Handle;
SendMessage(Wnd, WM_SETICON, ICON_SMALL, LPARAM(Small)); SendMessage(Wnd, WM_SETICON, ICON_SMALL, LPARAM(Small));
SetClassLong(Wnd, GCL_HICONSM, LONG(Small)); SetClassLongPtr(Wnd, GCL_HICONSM, LONG_PTR(Small));
SendMessage(Wnd, WM_SETICON, ICON_BIG, LPARAM(Big)); SendMessage(Wnd, WM_SETICON, ICON_BIG, LPARAM(Big));
SetClassLong(Wnd, GCL_HICON, LONG(Big)); SetClassLongPtr(Wnd, GCL_HICON, LONG_PTR(Big));
// for some reason sometimes frame does not invalidate itself. lets ask it to invalidate always // for some reason sometimes frame does not invalidate itself. lets ask it to invalidate always
Windows.RedrawWindow(Wnd, nil, 0, Windows.RedrawWindow(Wnd, nil, 0,
RDW_INVALIDATE or RDW_FRAME or RDW_NOCHILDREN or RDW_ERASE); RDW_INVALIDATE or RDW_FRAME or RDW_NOCHILDREN or RDW_ERASE);