wineconsole: use CmdShow parameter
Rein Klazes
wijn at wanadoo.nl
Wed Apr 13 14:19:38 CDT 2005
Hi,
This hides the wineconsoles brought up by visual studio 6 compilers and
linkers as they should.
Changelog:
dlls/kernel : console.c
programs/wineconsole : winecon_private.h, wineconsole.c, user.c
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.
Rein.
-------------- next part --------------
--- wine/dlls/kernel/console.c 2005-03-11 08:24:26.000000000 +0100
+++ mywine/dlls/kernel/console.c 2005-04-13 17:28:51.000000000 +0200
@@ -1130,6 +1130,11 @@ BOOL WINAPI AllocConsole(void)
siConsole.dwFlags |= STARTF_USEFILLATTRIBUTE;
siConsole.dwFillAttribute = siCurrent.dwFillAttribute;
}
+ if (siCurrent.dwFlags & STARTF_USESHOWWINDOW)
+ {
+ siConsole.dwFlags |= STARTF_USESHOWWINDOW;
+ siConsole.wShowWindow = siCurrent.wShowWindow;
+ }
/* FIXME (should pass the unicode form) */
if (siCurrent.lpTitle)
siConsole.lpTitle = siCurrent.lpTitle;
--- wine/programs/wineconsole/winecon_private.h 2003-09-06 01:15:41.000000000 +0200
+++ mywine/programs/wineconsole/winecon_private.h 2005-04-13 16:58:12.000000000 +0200
@@ -58,6 +58,7 @@ struct inner_data {
HANDLE hConIn; /* console input handle */
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 */
+ INT nCmdShow; /* argument of WinMain */
int (*fnMainLoop)(struct inner_data* data);
void (*fnPosCursor)(const struct inner_data* data);
--- wine/programs/wineconsole/wineconsole.c 2005-03-11 08:26:07.000000000 +0100
+++ mywine/programs/wineconsole/wineconsole.c 2005-04-13 17:35:10.000000000 +0200
@@ -530,7 +530,8 @@ static void WINECON_Delete(struct inner_
* active screen buffer)
*/
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;
DWORD ret;
@@ -548,6 +549,7 @@ static struct inner_data* WINECON_Init(H
appname = si.lpTitle;
}
+ data->nCmdShow = nCmdShow;
/* load settings */
WINECON_RegLoad(appname, &cfg);
@@ -758,7 +760,7 @@ int PASCAL WinMain(HINSTANCE hInst, HINS
{
case from_event:
/* 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);
if (!ret) WINE_ERR("SetEvent failed.\n");
break;
@@ -768,7 +770,7 @@ int PASCAL WinMain(HINSTANCE hInst, HINS
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;
ret = WINECON_Spawn(data, buffer);
if (!ret)
--- wine/programs/wineconsole/user.c 2004-11-29 19:00:10.000000000 +0100
+++ mywine/programs/wineconsole/user.c 2005-04-13 17:34:50.000000000 +0200
@@ -1319,7 +1319,7 @@ static int WCUSER_MainLoop(struct inner_
{
MSG msg;
- ShowWindow(PRIVATE(data)->hWnd, SW_SHOW);
+ ShowWindow(PRIVATE(data)->hWnd, data->nCmdShow);
for (;;)
{
switch (MsgWaitForMultipleObjects(1, &data->hSynchro, FALSE, INFINITE, QS_ALLINPUT))
More information about the wine-patches
mailing list