procedure TForm1.Button1Click(Sender: TObject); var h: HWND; AIcon: TIcon; begin AllocConsole; SetConsoleTitle(PChar('Console Title')); Sleep(0); h := FindWindow(nil, PChar('Console Title')); AIcon := TIcon.Create; ImageList1.GetIcon(0, AIcon); SendMessage(h, WM_SETICON, 1, AIcon.Handle); AIcon.Free; end;