Detach and reattach console on start
This commit is contained in:
		
							parent
							
								
									934fd3881c
								
							
						
					
					
						commit
						20a4d53b22
					
				
					 1 changed files with 7 additions and 5 deletions
				
			
		|  | @ -37,12 +37,14 @@ void SetupStreams() | ||||||
| 
 | 
 | ||||||
| void SetupConsole() | void SetupConsole() | ||||||
| { | { | ||||||
| 	if (!AllocConsole()) | 	if (!AttachConsole(-1)) { | ||||||
| 	{ | 		if (!AllocConsole()) | ||||||
| 		FreeConsole(); | 		{ | ||||||
| 		AllocConsole(); | 			FreeConsole(); | ||||||
|  | 			AllocConsole(); | ||||||
|  | 		} | ||||||
|  | 		AttachConsole(GetCurrentProcessId()); | ||||||
| 	} | 	} | ||||||
| 	AttachConsole(GetCurrentProcessId()); |  | ||||||
| 	SetupStreams(); | 	SetupStreams(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue