Christopher Faylor <cgf@redhat.com>
* tty.cc (tty_list::allocate_tty): Use GetConsoleWindow, if available. Call FindWindow in a loop.
This commit is contained in:
		
							parent
							
								
									91edb60487
								
							
						
					
					
						commit
						f80e156de9
					
				|  | @ -1,3 +1,9 @@ | |||
| 2002-08-30  Christopher January  <chris@atomice.net> | ||||
| 	    Christopher Faylor  <cgf@redhat.com> | ||||
| 
 | ||||
| 	* tty.cc (tty_list::allocate_tty): Use GetConsoleWindow, if available. | ||||
| 	Call FindWindow in a loop. | ||||
| 
 | ||||
| 2002-08-30  Christopher Faylor  <cgf@redhat.com> | ||||
| 
 | ||||
| 	* miscfuncs.cc (check_iovec_for_read): Don't check buffer when zero | ||||
|  |  | |||
|  | @ -494,6 +494,7 @@ LoadDLLfunc (CoCreateInstance, 20, ole32) | |||
| LoadDLLfuncEx (CancelIo, 4, kernel32, 1) | ||||
| LoadDLLfuncEx (CreateHardLinkA, 12, kernel32, 1) | ||||
| LoadDLLfuncEx (CreateToolhelp32Snapshot, 8, kernel32, 1) | ||||
| LoadDLLfuncEx (GetConsoleWindow, 4, kernel32, 1) | ||||
| LoadDLLfuncEx2 (IsDebuggerPresent, 0, kernel32, 1, 1) | ||||
| LoadDLLfuncEx (Process32First, 8, kernel32, 1) | ||||
| LoadDLLfuncEx (Process32Next, 8, kernel32, 1) | ||||
|  |  | |||
|  | @ -196,7 +196,7 @@ tty_list::allocate_tty (int with_console) | |||
| 
 | ||||
|   if (!with_console) | ||||
|     console = NULL; | ||||
|   else | ||||
|   else if (!(console = GetConsoleWindow ())) | ||||
|     { | ||||
|       char *oldtitle = new char [TITLESIZE]; | ||||
| 
 | ||||
|  | @ -218,8 +218,12 @@ tty_list::allocate_tty (int with_console) | |||
| 
 | ||||
|       __small_sprintf (buf, "cygwin.find.console.%d", myself->pid); | ||||
|       SetConsoleTitle (buf); | ||||
|       Sleep (40); | ||||
|       console = FindWindow (NULL, buf); | ||||
|       for (int times = 0; times < 25; times++) | ||||
|         { | ||||
|           Sleep (10); | ||||
|           if ((console = FindWindow (NULL, buf))) | ||||
| 	    break; | ||||
|         } | ||||
|       SetConsoleTitle (oldtitle); | ||||
|       Sleep (40); | ||||
|       ReleaseMutex (title_mutex); | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue