thanks Paez and Lush, i tried coding what i want but its not working here is the code
uses
Windows;
function GetConsoleWindow(): HWND; stdcall; external 'kernel32.dll' name 'GetConsoleWindow';
var
hwndHandle: THANDLE;
hMenuHandle: HMENU;
begin
hwndHandle := GetConsoleWindow();
if (hwndHandle <> 0) then
begin
hMenuHandle := GetSystemMenu(hwndHandle, FALSE);
if (hMenuHandle <> 0) then
DeleteMenu(hMenuHandle, SC_CLOSE, MF_BYCOMMAND);
end;
end.
i got no compile errors and no run-time errors either, its just do not work the console window still have the close button enabled