PLIST_ENTRY Current;
PWINDOW_OBJECT Wnd;
USER_REFERENCE_ENTRY Ref;
- WThread = Thread->Tcb.Win32Thread;
+ WThread = (PW32THREAD)Thread->Tcb.Win32Thread;
while (!IsListEmpty(&WThread->WindowListHead))
{
SetLastWin32Error(ERROR_INVALID_PARAMETER);
return 0;
}
- if(!(W32Thread = Thread->Tcb.Win32Thread))
+ if(!(W32Thread = (PW32THREAD)Thread->Tcb.Win32Thread))
{
ObDereferenceObject(Thread);
DPRINT("Thread is not a GUI Thread!\n");
Window->IDMenu = 0;
Window->Instance = hInstance;
Window->hSelf = hWnd;
+
+ if (!hMenu)
+ hMenu = Class->hMenu;
+
if (0 != (dwStyle & WS_CHILD))
{
Window->IDMenu = (UINT) hMenu;
PRTL_USER_PROCESS_PARAMETERS ProcessParams;
BOOL CalculatedDefPosSize = FALSE;
- IntGetDesktopWorkArea(Window->OwnerThread->Tcb.Win32Thread->Desktop, &WorkArea);
+ IntGetDesktopWorkArea(((PW32THREAD)Window->OwnerThread->Tcb.Win32Thread)->Desktop, &WorkArea);
rc = WorkArea;
ProcessParams = PsGetCurrentProcess()->Peb->ProcessParameters;
ASSERT_REFS_CO(Window); //fixme: temp hack?
- /* Check for owner thread and desktop window */
- if ((Window->OwnerThread != PsGetCurrentThread()) || IntIsDesktopWindow(Window))
+ /* Check for owner thread */
+ if ((Window->OwnerThread != PsGetCurrentThread()))
{
SetLastWin32Error(ERROR_ACCESS_DENIED);
return FALSE;
HWND *ChildHandle;
PWINDOW_OBJECT Child, Desktop;
- Desktop = UserGetWindowObject(IntGetDesktopWindow());
+ Desktop = IntIsDesktopWindow(Window) ? Window :
+ UserGetWindowObject(IntGetDesktopWindow());
Children = IntWinListChildren(Desktop);
if (Children)
/* Do not send WM_GETTEXT messages in the kernel mode version!
The user mode version however calls GetWindowText() which will
send WM_GETTEXT messages to windows belonging to its processes */
- if((!CheckWindowName || !RtlCompareUnicodeString(WindowName, &(Child->WindowName), FALSE)) &&
+ if((!CheckWindowName || !RtlCompareUnicodeString(WindowName, &(Child->WindowName), TRUE)) &&
(!ClassAtom || Child->Class->Atom == ClassAtom))
{
Ret = Child->hSelf;
The user mode version however calls GetWindowText() which will
send WM_GETTEXT messages to windows belonging to its processes */
WindowMatches = !CheckWindowName || !RtlCompareUnicodeString(
- &WindowName, &TopLevelWindow->WindowName, FALSE);
+ &WindowName, &TopLevelWindow->WindowName, TRUE);
ClassMatches = !CheckClassName ||
ClassAtom == TopLevelWindow->Class->Atom;
/*
* Remove extended window style bit WS_EX_TOPMOST for shell windows.
*/
- WindowStation = Window->OwnerThread->Tcb.Win32Thread->Desktop->WindowStation;
+ WindowStation = ((PW32THREAD)Window->OwnerThread->Tcb.Win32Thread)->Desktop->WindowStation;
if(WindowStation)
{
if (hWnd == WindowStation->ShellWindow || hWnd == WindowStation->ShellListView)
}
Safepl.flags = 0;
- Safepl.showCmd = ((Window->Flags & WINDOWOBJECT_RESTOREMAX) ? SW_MAXIMIZE : SW_SHOWNORMAL);
+ if (0 == (Window->Style & WS_VISIBLE))
+ {
+ Safepl.showCmd = SW_HIDE;
+ }
+ else if (0 != (Window->Flags & WINDOWOBJECT_RESTOREMAX) ||
+ 0 != (Window->Style & WS_MAXIMIZE))
+ {
+ Safepl.showCmd = SW_MAXIMIZE;
+ }
+ else if (0 != (Window->Style & WS_MINIMIZE))
+ {
+ Safepl.showCmd = SW_MINIMIZE;
+ }
+ else if (0 != (Window->Style & WS_MINIMIZE))
+ {
+ Safepl.showCmd = SW_SHOWNORMAL;
+ }
Size.x = Window->WindowRect.left;
Size.y = Window->WindowRect.top;