EnableExplicit Define ConsoleHandle Define hIcon If OpenLibrary(0, "Kernel32.dll") Prototype GetConsoleWindow() Define GetConsoleWindow.GetConsoleWindow = GetFunction(0, "GetConsoleWindow") CloseLibrary(0) EndIf hIcon = ExtractIcon_(0, #PB_Compiler_Home + "PureBasic.exe", 1) If OpenConsole("Meine Konsole") ConsoleHandle = GetConsoleWindow() SendMessage_(ConsoleHandle, #WM_SETICON, #False, hIcon) Input() CloseConsole() EndIf DestroyIcon_(hIcon)