@msdn=http://search.microsoft.com/search/results.aspx?qu=$$$ @pinvoke=http://pinvoke.net/$$$.htm Summary: Fills an array of type uint with the process ID's of all processes attached to this console. !!!!C# Signature: [DllImport("kernel32.dll", SetLastError = true)] static extern uint GetConsoleProcessList( uint[] ProcessList, uint ProcessCount ); !!!!VB Signature: Declare Function GetConsoleProcessList Lib "kernel32.dll" (TODO) As TODO !!!!User-Defined Types: None. !!!!Alternative Managed API: Do you know one? Please contribute it! !!!!Notes: !!!!Tips & Tricks: To determine if the console will be destroyed when your application exits, check if (processCount < 2). For example: public static bool IsFinalProcess() { // See: https://devblogs.microsoft.com/oldnewthing/20160125-00/?p=92922 uint[] procIDs = new uint[64]; uint processCount = GetConsoleProcessList(procIDs, 64); return (processCount < 2); } Check IsFinalProcess() as your application exits. If true, use Console.ReadKey(false); to prevent the window disappearing. !!!!Sample Code: uint[] procIDs = new uint[64]; uint processCount = GetConsoleProcessList(procIDs, 64); Documentation: GetConsoleProcessList@msdn on MSDN
Edit kernel32.GetConso...
You do not have permission to change this page. If you feel this is in error, please send feedback with the contact link on the main page.