Tutaj nie ma co sobie przypominać, tylko pomyśleć i to zrobić. Ech - leniuchy, leniuchy. Zero samodzielności, chęci szukania i samodzielnego kombinowania. Dobra, masz przykład na nowy calc pod Windows 7 i taki pod XP jeszcze też zadziała. Szukać trzeba było w google informacji, jak się enumeruje kontrolki i jak sprawdza ich tekst. Czyli ogólnie, a nie konkretnie jak ukryć przycisk ze znakiem równości w Kalkulatorze Windows. Ręce mi opadają na widok takiego braku pomyślunku ;/ A temat przenoszę do Newbie, bo może nie dotyczy on aż tak banalnych podstaw, chociaż korzystanie z MSDN taką, według mnie jest.
function GetTextLen(AHandle : HWND) : integer;
begin
Result := SendMessage(AHandle, WM_GETTEXTLENGTH, 0, 0);
end;
function GetTextBuf(AHandle : HWND; Buffer : PChar; BufSize : integer) : integer;
begin
Result := SendMessage(AHandle, WM_GETTEXT, BufSize, Longint(Buffer));
end;
function GetText(AHandle : HWND) : string;
var
Len : integer;
begin
Len := GetTextLen(AHandle);
SetString(Result, PChar(nil), Len);
if Len <> 0 then
begin
GetTextBuf(AHandle, Pointer(Result), Len + 1);
end;
end;
function EnumCalcControls(AHWnd : HWND; ALParam : LParam) : boolean; stdcall;
begin
Result := True;
if GetText(AHWnd) = '=' then
begin
ShowWindow(AHWnd, SW_HIDE);
Result := False;
end;
end;
procedure TForm1.Button1Click(Sender : TObject);
var
H1, H2 : HWND;
begin
H1 := FindWIndow('CalcFrame', nil);
H2 := FindWIndow('SciCalc', nil);
if H1 > 0 then
begin
EnumChildWindows(H1, @EnumCalcControls, 0);
end;
if H2 > 0 then
begin
EnumChildWindows(H2, @EnumCalcControls, 0);
end;
end;