mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-09-20 06:49:56 +00:00
Remove the hide console trick in support/os_win32.C since wrapper hidecmd.c can completely hide the console.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14498 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
5ac6c47775
commit
a871153a72
@ -135,32 +135,10 @@ void init(int /* argc */, char * argv[])
|
||||
* shell scripts failed, for mysterious reasons...
|
||||
*
|
||||
* I've chosen for now, therefore, to simply add Ruurd's original
|
||||
* code as-is.
|
||||
* code as-is. A wrapper program hidecmd.c has been added to
|
||||
* development/Win32 which hides the console window of lyx when
|
||||
* lyx is invoked as a parameter of hidecmd.exe.
|
||||
*/
|
||||
// Close the console when run (probably)
|
||||
// not run from command prompt
|
||||
char WindowTitle[1024];
|
||||
if (GetConsoleTitle(WindowTitle, sizeof(WindowTitle)) == 0) {
|
||||
// Could not get the title, so we just leave things as they are
|
||||
return;
|
||||
}
|
||||
|
||||
if ((strcmp(WindowTitle, argv[0]) == 0) ||
|
||||
(strcmp(WindowTitle, "LyX") == 0)) {
|
||||
// format a "unique" newWindowTitle
|
||||
wsprintf(WindowTitle, "%d/%d",
|
||||
GetTickCount(),
|
||||
GetCurrentProcessId());
|
||||
// change current window title
|
||||
SetConsoleTitle(WindowTitle);
|
||||
// ensure window title has been updated
|
||||
Sleep(40);
|
||||
// look for newWindowTitle
|
||||
HWND const hwndFound = FindWindow(NULL, WindowTitle);
|
||||
// If found, hide it
|
||||
if (hwndFound != NULL)
|
||||
ShowWindow( hwndFound, SW_HIDE);
|
||||
}
|
||||
|
||||
// If cygwin is detected, query the cygdrive prefix
|
||||
HKEY regKey;
|
||||
|
Loading…
Reference in New Issue
Block a user