NTSTATUS Status = STATUS_SUCCESS;
PTEB pTeb;
LARGE_INTEGER LargeTickCount;
+ PRTL_USER_PROCESS_PARAMETERS ProcessParams;
Process = Thread->ThreadsProcess;
pTeb = NtCurrentTeb();
ASSERT(pTeb);
+ ProcessParams = pTeb->ProcessEnvironmentBlock->ProcessParameters;
+
/* Allocate a new Win32 thread info */
Status = AllocW32Thread(Thread, &ptiCurrent);
if (!NT_SUCCESS(Status))
pci->CodePage = ptiCurrent->KeyboardLayout->CodePage;
}
+ /* Need to pass the user Startup Information to the current process. */
+ if ( ProcessParams )
+ {
+ if ( ptiCurrent->ppi->usi.cb == 0 ) // Not initialized yet.
+ {
+ if ( ProcessParams->WindowFlags != 0 ) // Need window flags set.
+ {
+ ptiCurrent->ppi->usi.cb = sizeof(USERSTARTUPINFO);
+ ptiCurrent->ppi->usi.dwX = ProcessParams->StartingX;
+ ptiCurrent->ppi->usi.dwY = ProcessParams->StartingY;
+ ptiCurrent->ppi->usi.dwXSize = ProcessParams->CountX;
+ ptiCurrent->ppi->usi.dwYSize = ProcessParams->CountY;
+ ptiCurrent->ppi->usi.dwFlags = ProcessParams->WindowFlags;
+ ptiCurrent->ppi->usi.wShowWindow = (WORD)ProcessParams->ShowWindowFlags;
+ }
+ }
+ }
+
/* Assign a default window station and desktop to the process */
/* Do not try to open a desktop or window station before winlogon initializes */
if (ptiCurrent->ppi->hdeskStartup == NULL && gpidLogon != 0)
HDESK hDesk = NULL;
UNICODE_STRING DesktopPath;
PDESKTOP pdesk;
- PRTL_USER_PROCESS_PARAMETERS ProcessParams;
/*
* inherit the thread desktop and process window station (if not yet inherited) from the process startup
* info structure. See documentation of CreateProcess()
*/
- ProcessParams = pTeb->ProcessEnvironmentBlock->ProcessParameters;
Status = STATUS_UNSUCCESSFUL;
if (ProcessParams && ProcessParams->DesktopInfo.Length > 0)
PTHREADINFO pti;
//HRGN VisibleRgn;
BOOL ShowOwned = FALSE;
+ BOOL FirstTime = FALSE;
ASSERT_REFS_CO(Wnd);
//ERR("co_WinPosShowWindow START\n");
WasVisible = (Wnd->style & WS_VISIBLE) != 0;
style = Wnd->style;
+ ERR("co_WinPosShowWindow START hwnd %p Cmd %d usicmd %d\n",Wnd->head.h,Cmd,pti->ppi->usi.wShowWindow);
+
+ if ( pti->ppi->usi.dwFlags & STARTF_USESHOWWINDOW )
+ {
+ if ((Wnd->style & (WS_POPUP|WS_CHILD)) != WS_CHILD)
+ {
+ if ((Wnd->style & WS_CAPTION) == WS_CAPTION)
+ {
+ if (Wnd->spwndOwner == NULL)
+ {
+ if ( Cmd == SW_SHOWNORMAL || Cmd == SW_SHOW)
+ {
+ Cmd = SW_SHOWDEFAULT;
+ }
+ FirstTime = TRUE;
+ ERR("co_WPSW FT 1\n");
+ }
+ }
+ }
+ }
+
+ if ( Cmd == SW_SHOWDEFAULT )
+ {
+ if ( pti->ppi->usi.dwFlags & STARTF_USESHOWWINDOW )
+ {
+ Cmd = pti->ppi->usi.wShowWindow;
+ FirstTime = TRUE;
+ ERR("co_WPSW FT 2\n");
+ }
+ }
+
+ if (FirstTime)
+ {
+ pti->ppi->usi.dwFlags &= ~(STARTF_USEPOSITION|STARTF_USESIZE|STARTF_USESHOWWINDOW);
+ }
+
switch (Cmd)
{
case SW_HIDE:
if (!WasVisible)
{
//ERR("co_WinPosShowWindow Exit Bad\n");
- return(FALSE);
+ return FALSE;
}
Swp |= SWP_HIDEWINDOW | SWP_NOSIZE | SWP_NOMOVE;
if (Wnd != pti->MessageQueue->spwndActive)
if (!(style & WS_CHILD)) co_IntSendMessageNoWait(UserHMGetHandle(Wnd), WM_ACTIVATE, WA_ACTIVE, 0);
}
//ERR("co_WinPosShowWindow EXIT\n");
- return(WasVisible);
+ return WasVisible;
}
static PWND