Search the Community
Showing results for tags '_winapi_attachconsole'.
-
Hi. Thanks to this post (https://www.autoitscript.com/forum/topic/189553-writing-to-cmd/?do=findComment&comment=1361142) I can now write a helpfile to the cmd when for instance passing parameter -h or -help at cmd. But then cmd is blocked by the script (I had to free it with CTRL+BREAK): #include <WinAPI.au3> _WinAPI_AttachConsole() $hConsole = _WinAPI_GetStdHandle(1) _WinAPI_WriteConsole($hConsole, "Print helpfile................" & @CRLF) Inside MSDN Library then I found this sentence: A process can use the FreeConsole function to detach itself from its console. But I don't find something like _WinAPI_FreeConsole(). How can I do it in another way? Regards, Conrad
- 9 replies
-
- freeconsole
- cmd
-
(and 3 more)
Tagged with:
-
I have 2 processes one is Manager another is Worker.exe Master launches worker by Run with parameters directive passing PID of Manager as well I'm trying to reassign console from worker to the master so I will see some info from worker I called FreeConsole and _WinAPI_AttachConsole to Manager's PID. $workerID=$CmdLine[1]; ... $ManagerPID=$CmdLine[4]; $res=_WinAPI_FreeConsole(); $res2=_WinAPI_AttachConsole($ManagerPID); ConsoleWrite(" worker "&$workerID&" connected to console "); I don't see any console messages from worker in my SciTE console window where Manager's console lives Any ideas why?