In AllocConsole() pass the wShowWindow value and STARTF_USESHOWWINDOW

flag from the calling process to the console process. Make wineconsole
use the CmdShow parameter in the ShowWindow call.
oldstable
Rein Klazes 2005-04-14 11:30:09 +00:00 committed by Alexandre Julliard
parent eea415300b
commit b05cceb6f5
4 changed files with 12 additions and 4 deletions

View File

@ -1130,6 +1130,11 @@ BOOL WINAPI AllocConsole(void)
siConsole.dwFlags |= STARTF_USEFILLATTRIBUTE; siConsole.dwFlags |= STARTF_USEFILLATTRIBUTE;
siConsole.dwFillAttribute = siCurrent.dwFillAttribute; siConsole.dwFillAttribute = siCurrent.dwFillAttribute;
} }
if (siCurrent.dwFlags & STARTF_USESHOWWINDOW)
{
siConsole.dwFlags |= STARTF_USESHOWWINDOW;
siConsole.wShowWindow = siCurrent.wShowWindow;
}
/* FIXME (should pass the unicode form) */ /* FIXME (should pass the unicode form) */
if (siCurrent.lpTitle) if (siCurrent.lpTitle)
siConsole.lpTitle = siCurrent.lpTitle; siConsole.lpTitle = siCurrent.lpTitle;

View File

@ -1319,7 +1319,7 @@ static int WCUSER_MainLoop(struct inner_data* data)
{ {
MSG msg; MSG msg;
ShowWindow(PRIVATE(data)->hWnd, SW_SHOW); ShowWindow(PRIVATE(data)->hWnd, data->nCmdShow);
for (;;) for (;;)
{ {
switch (MsgWaitForMultipleObjects(1, &data->hSynchro, FALSE, INFINITE, QS_ALLINPUT)) switch (MsgWaitForMultipleObjects(1, &data->hSynchro, FALSE, INFINITE, QS_ALLINPUT))

View File

@ -58,6 +58,7 @@ struct inner_data {
HANDLE hConIn; /* console input handle */ HANDLE hConIn; /* console input handle */
HANDLE hConOut; /* screen buffer handle: has to be changed when active sb changes */ HANDLE hConOut; /* screen buffer handle: has to be changed when active sb changes */
HANDLE hSynchro; /* waitable handle signalled by server when something in server has been modified */ HANDLE hSynchro; /* waitable handle signalled by server when something in server has been modified */
INT nCmdShow; /* argument of WinMain */
int (*fnMainLoop)(struct inner_data* data); int (*fnMainLoop)(struct inner_data* data);
void (*fnPosCursor)(const struct inner_data* data); void (*fnPosCursor)(const struct inner_data* data);

View File

@ -530,7 +530,8 @@ static void WINECON_Delete(struct inner_data* data)
* active screen buffer) * active screen buffer)
*/ */
static struct inner_data* WINECON_Init(HINSTANCE hInst, DWORD pid, LPCWSTR appname, static struct inner_data* WINECON_Init(HINSTANCE hInst, DWORD pid, LPCWSTR appname,
enum init_return (*backend)(struct inner_data*)) enum init_return (*backend)(struct inner_data*),
INT nCmdShow)
{ {
struct inner_data* data = NULL; struct inner_data* data = NULL;
DWORD ret; DWORD ret;
@ -548,6 +549,7 @@ static struct inner_data* WINECON_Init(HINSTANCE hInst, DWORD pid, LPCWSTR appna
appname = si.lpTitle; appname = si.lpTitle;
} }
data->nCmdShow = nCmdShow;
/* load settings */ /* load settings */
WINECON_RegLoad(appname, &cfg); WINECON_RegLoad(appname, &cfg);
@ -758,7 +760,7 @@ int PASCAL WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpCmdLine, INT nCmdSh
{ {
case from_event: case from_event:
/* case of wineconsole <evt>, signal process that created us that we're up and running */ /* case of wineconsole <evt>, signal process that created us that we're up and running */
if (!(data = WINECON_Init(hInst, 0, NULL, wci.backend))) return 0; if (!(data = WINECON_Init(hInst, 0, NULL, wci.backend, nCmdShow))) return 0;
ret = SetEvent(wci.event); ret = SetEvent(wci.event);
if (!ret) WINE_ERR("SetEvent failed.\n"); if (!ret) WINE_ERR("SetEvent failed.\n");
break; break;
@ -768,7 +770,7 @@ int PASCAL WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpCmdLine, INT nCmdSh
MultiByteToWideChar(CP_ACP, 0, wci.ptr, -1, buffer, sizeof(buffer) / sizeof(buffer[0])); MultiByteToWideChar(CP_ACP, 0, wci.ptr, -1, buffer, sizeof(buffer) / sizeof(buffer[0]));
if (!(data = WINECON_Init(hInst, GetCurrentProcessId(), buffer, wci.backend))) if (!(data = WINECON_Init(hInst, GetCurrentProcessId(), buffer, wci.backend, nCmdShow)))
return 0; return 0;
ret = WINECON_Spawn(data, buffer); ret = WINECON_Spawn(data, buffer);
if (!ret) if (!ret)