Changeset 10471 for trunk/src/kernel32/console.cpp
- Timestamp:
- Feb 19, 2004, 2:03:07 PM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/console.cpp
r9544 r10471 1 /* $Id: console.cpp,v 1.3 2 2002-12-27 13:42:08sandervl Exp $ */1 /* $Id: console.cpp,v 1.33 2004-02-19 13:03:06 sandervl Exp $ */ 2 2 3 3 /* … … 61 61 #define INCL_DOSSEMAPHORES 62 62 #define INCL_DOSERRORS 63 #define INCL_DOSEXCEPTIONS 63 64 #define INCL_DOSPROCESS 64 65 #define INCL_DOSMODULEMGR 66 #define INCL_DOSDEVICES 65 67 #define INCL_VIO 66 68 #define INCL_KBD … … 177 179 if (ConsoleGlobals.hevConsole != NULLHANDLE) /* we're already initialized ?*/ 178 180 return (NO_ERROR); /* then abort immediately */ 181 182 rc = DosSetSignalExceptionFocus(SIG_SETFOCUS, &ulPostCount); 183 if(rc) { 184 dprintf(("DosSetSignalExceptionFocus failed with %d", rc)); 185 } 179 186 180 187 if(flVioConsole == TRUE) … … 2695 2702 *****************************************************************************/ 2696 2703 2704 2697 2705 DWORD WIN32API GetConsoleTitleW(LPWSTR lpConsoleTitle, 2698 2706 DWORD nSize) 2699 2707 { 2700 ULONG ulLength; /* length of text */2701 2702 2708 if (ConsoleGlobals.pszWindowTitle == NULL) /* is there a window title ? */ 2703 2709 return 0; /* abort immediately */ 2704 2710 2705 ulLength = strlen(ConsoleGlobals.pszWindowTitle); /* length of text */ 2706 2707 lstrcpynAtoW(lpConsoleTitle, 2708 ConsoleGlobals.pszWindowTitle, 2709 nSize); 2710 2711 return (nSize < ulLength) ? nSize : ulLength; 2711 MultiByteToWideChar( GetConsoleCP(), 0, ConsoleGlobals.pszWindowTitle, -1, 2712 lpConsoleTitle, nSize ); 2713 lpConsoleTitle[ nSize - 1 ] = 0; 2714 2715 return lstrlenW( lpConsoleTitle ); 2712 2716 } 2713 2717 … … 3443 3447 BOOL WIN32API SetConsoleTitleW(LPWSTR lpszTitle) 3444 3448 { 3449 int alen; 3450 3445 3451 if (lpszTitle == NULL) /* check parameters */ 3446 3452 return FALSE; … … 3449 3455 free (ConsoleGlobals.pszWindowTitle); /* then free it */ 3450 3456 3457 alen = WideCharToMultiByte( GetConsoleCP(), 0, lpszTitle, -1, 0, 0, 0, 0 ); 3451 3458 /* create an ascii copy of the lpszTitle */ 3452 int iLength = lstrlenW(lpszTitle); 3453 3454 ConsoleGlobals.pszWindowTitle = (PSZ)malloc(iLength+1); 3455 ConsoleGlobals.pszWindowTitle[iLength] = 0; 3456 lstrcpynWtoA(ConsoleGlobals.pszWindowTitle, 3457 lpszTitle, 3458 iLength+1); //must add one (lstrcpynWtoA terminates string) 3459 ConsoleGlobals.pszWindowTitle = (PSZ)malloc( alen ); 3460 WideCharToMultiByte( GetConsoleCP(), 0, lpszTitle, -1, 3461 ConsoleGlobals.pszWindowTitle, alen, 0, 0 ); 3459 3462 3460 3463 WinSetWindowText(ConsoleGlobals.hwndFrame, /* set new title text */
Note:
See TracChangeset
for help on using the changeset viewer.