forked from ReScrap/ScrapHacks
		
	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 (!AttachConsole(-1)) { | ||||||
| 		if (!AllocConsole()) | 		if (!AllocConsole()) | ||||||
| 		{ | 		{ | ||||||
| 			FreeConsole(); | 			FreeConsole(); | ||||||
| 			AllocConsole(); | 			AllocConsole(); | ||||||
| 		} | 		} | ||||||
| 		AttachConsole(GetCurrentProcessId()); | 		AttachConsole(GetCurrentProcessId()); | ||||||
|  | 	} | ||||||
| 	SetupStreams(); | 	SetupStreams(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue