注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

dingchaoqun12 的博客

上海股票期货开户

 
 
 

日志

 
 
 
 

reactos操作系统实现(162) - 大坡3D软件开发 - 博客频道 - CSDN.NET  

2012-10-06 01:17:11|  分类: 默认分类 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

co_IntCreateWindowEx函数主要用创建一个显示的窗口,具体实现代码如下:

#002  co_IntCreateWindowEx(DWORD dwExStyle,

#003                       PUNICODE_STRING ClassName,

#004                       PUNICODE_STRING WindowName,

#005                       DWORD dwStyle,

#006                       LONG x,

#007                       LONG y,

#008                       LONG nWidth,

#009                       LONG nHeight,

#010                       HWND hWndParent,

#011                       HMENU hMenu,

#012          HINSTANCE hInstance,

#013                       LPVOID lpParam,

#014                       DWORD dwShowMode,

#015                       BOOL bUnicodeWindow)

#017     PWINSTATION_OBJECT WinSta;

#018     PWINDOW Wnd = NULL;

#019     PWINDOWCLASS *ClassLink, >

#020     RTL_ATOM ClassAtom;

#021     PWINDOW_OBJECT Window = NULL;

#022     PWINDOW_OBJECT ParentWindow = NULL, OwnerWindow;

#023     HWND ParentWindowHandle;

#024     HWND OwnerWindowHandle;

#025     PMENU_OBJECT SystemMenu;

#029     PW32THREADINFO ti = NULL;

#032     POINT MaxSize, MaxPos, MinTrack, MaxTrack;

#038     CBT_CREATEWNDW CbtCreate;

#041     DECLARE_RETURN(HWND);

#043     USER_REFERENCE_ENTRY ParentRef, Ref;

#046     pti = PsGetCurrentThreadWin32Thread();

#047     ParentWindowHandle = pti->Desktop->DesktopWindow;

#048     OwnerWindowHandle = NULL;

#050     if (hWndParent == HWND_MESSAGE)

#053         * native ole32.OleInitialize uses HWND_MESSAGE to create the

#054         * message window (style: WS_POPUP|WS_DISABLED)

#056        DPRINT1("FIXME - Parent is HWND_MESSAGE/n");

#057        // ParentWindowHandle set already.     

#059     else if (hWndParent)

#061        if ((dwStyle & (WS_CHILD | WS_POPUP)) != WS_CHILD)

#063           PWINDOW_OBJECT Par = UserGetWindowObject(hWndParent), Root;

#064           if (Par && (Root = UserGetAncestor(Par, GA_ROOT)))

#065              OwnerWindowHandle = Root->hSelf;

#068           ParentWindowHandle = hWndParent;

#070     else if ((dwStyle & (WS_CHILD | WS_POPUP)) == WS_CHILD)

#072   SetLastWin32Error(ERROR_TLW_WITH_WSCHILD);

#073        RETURN( (HWND)0);  /* WS_CHILD needs a parent, but WS_POPUP doesn't */

#076  //   if (NULL != ParentWindowHandle)

#078     ParentWindow = UserGetWindowObject(ParentWindowHandle);

#080     if (ParentWindow) UserRefObjectCo(ParentWindow, &ParentRef);

#084  //      ParentWindow = NULL;

#087     /* FIXME: parent must belong to the current process */

#089     /* Check the window station. */

#090     ti = GetW32ThreadInfo();

#091     if (ti == NULL || pti->Desktop == NULL)

#093        DPRINT1("Thread is not attached to a desktop! Cannot create window!/n");

#097     /* Check the class. */

#099     ClassAtom = IntGetClassAtom(ClassName,

#100                                 hInstance,

#101                                 ti->kpi,

#103                                 &ClassLink);

#105     if (ClassAtom == (RTL_ATOM)0)

#107        if (IS_ATOM(ClassName->Buffer))

#109           DPRINT1("Class 0x%p not found/n", (DWORD_PTR) ClassName->Buffer);

#113           DPRINT1("Class /"%wZ/" not found/n", ClassName);

#116        SetLastWin32Error(ERROR_CANNOT_FIND_WND_CLASS);

#117        RETURN((HWND)0);

#120     >

#121                               ClassLink,

#122                               pti->Desktop);

#125         DPRINT1("Failed to reference window class!/n");

#129     WinSta = pti->Desktop->WindowStation;

#131     //FIXME: Reference thread/desktop instead

#132     ObReferenceObjectByPointer(WinSta, KernelMode, ExWindowStationObjectType, 0);

#134     /* Create the window object. */

#135     Window = (PWINDOW_OBJECT)

#136              UserCreateObject(gHandleTable, (PHANDLE)&hWnd,

#137                              otWindow, sizeof(WINDOW_OBJECT));

#140         Window->Wnd = DesktopHeapAlloc(pti->Desktop,

#141                                        sizeof(WINDOW) + Class->WndExtra);

#142         if (!Window->Wnd)

#143             goto AllocErr;

#144         RtlZeroMemory(Window->Wnd,

#145                       sizeof(WINDOW) + Class->WndExtra);

#146         Window->Wnd->hdr.Handle = hWnd; /* FIXME: Remove hack */

#147         Wnd = Window->Wnd;

#149         Wnd->ti = ti;

#150         Wnd->pi = ti->kpi;

#151         Wnd->pdesktop = pti->Desktop;

#152         Wnd->hWndLastActive = hWnd;

#155     DPRINT("Created object with handle %X/n", hWnd);

#159        ObDereferenceObject(WinSta);

#160 SetLastNtError(STATUS_INSUFFICIENT_RESOURCES);

#161        RETURN( (HWND)0);

#164     UserRefObjectCo(Window, &Ref);

#166     ObDereferenceObject(WinSta);

#168     if (NULL == pti->Desktop->DesktopWindow)

#170        /* If there is no desktop window yet, we must be creating it */

#171        pti->Desktop->DesktopWindow = hWnd;

#172        pti->Desktop->DesktopInfo->Wnd = Wnd;

#176      * Fill out the structure describing it.

#178     Window->ti = ti;

#179     Wnd->Class = Class;

#182     Window->SystemMenu = (HMENU)0;

#183     Wnd->ContextHelpId = 0;

#184     Wnd->IDMenu = 0;

#185     Wnd->Instance = hInstance;

#186     Window->hSelf = hWnd;

#188     Window->MessageQueue = pti->MessageQueue;

#189     IntReferenceMessageQueue(Window->MessageQueue);

#190     Window->Parent = ParentWindow;

#191     Wnd->Parent = ParentWindow ? ParentWindow->Wnd : NULL;

#192     if (Wnd->Parent != NULL && hWndParent != 0)

#194         Wnd->HideFocus = Wnd->Parent->HideFocus;

#195         Wnd->HideAccel = Wnd->Parent->HideAccel;

#198     if((OwnerWindow = UserGetWindowObject(OwnerWindowHandle)))

#200        Window->hOwner = OwnerWindowHandle;

#201        Wnd->Owner = OwnerWindow->Wnd;

#202        HasOwner = TRUE;

#206        Window->hOwner = NULL;

#207       Wnd->Owner = NULL;

#208        HasOwner = FALSE;

#211     Wnd->UserData = 0;

#213     Wnd->IsSystem = Wnd->Class->System;

#215     /* BugBoy Comments: Comment below say that System classes are always created as UNICODE.

#216        In windows, creating a window with the ANSI version of CreateWindow sets the window

#217        to ansi as verified by testing with IsUnicodeWindow API.

#219        No where can I see in code or through testing does the window change back to ANSI

#220        after being created as UNICODE in ROS. I didnt do more testing to see what problems this would cause.*/

#221      // See NtUserDefSetText! We convert to Unicode all the time and never use Mix. (jt)

根据是否系统里定义的窗口类来选择是否使用UNICODE的窗口。

#222     if (Wnd->Class->System)

#224         /* NOTE: Always create a unicode window for system classes! */

#225         Wnd->Unicode = TRUE;

#226         Wnd->WndProc = Wnd->Class->WndProc;

#227         Wnd->WndProcExtra = Wnd->Class->WndProcExtra;

#231         Wnd->Unicode = Wnd->Class->Unicode;

#232         Wnd->WndProc = Wnd->Class->WndProc;

#233         Wnd->CallProc = NULL;

#236     Window->OwnerThread = PsGetCurrentThread();

#237     Window->FirstChild = NULL;

#238     Window->LastChild = NULL;

#239     Window->PrevSibling = NULL;

#240     Window->NextSibling = NULL;

#241     Wnd->ExtraDataSize = Wnd->Class->WndExtra;

#243     InitializeListHead(&Wnd->PropListHead);

#244     InitializeListHead(&Window->WndObjListHead);

#246     if (NULL != WindowName->Buffer && WindowName->Length > 0)

#248        Wnd->WindowName.Buffer = DesktopHeapAlloc(Wnd->pdesktop,

#249                            WindowName->Length + sizeof(UNICODE_NULL));

#250        if (Wnd->WindowName.Buffer == NULL)

#252            SetLastNtError(STATUS_INSUFFICIENT_RESOURCES);

#253            RETURN( (HWND)0);

#256      Wnd->WindowName.Buffer[WindowName->Length / sizeof(WCHAR)] = L'/0';

#259            RtlCopyMemory(Wnd->WindowName.Buffer,

#260                          WindowName->Buffer,

#261                          WindowName->Length);

#262            Wnd->WindowName.Length = WindowName->Length;

#264        _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)

#266            WindowName->Length = 0;

#267            Wnd->WindowName.Buffer[0] = L'/0';

#273      * This has been tested for WS_CHILD | WS_VISIBLE.  It has not been

#274      * tested for WS_POPUP

#276     if ((dwExStyle & WS_EX_DLGMODALFRAME) ||

#277           ((!(dwExStyle & WS_EX_STATICEDGE)) &&

#278            (dwStyle & (WS_DLGFRAME | WS_THICKFRAME))))

#279        dwExStyle |= WS_EX_WINDOWEDGE;

#281        dwExStyle &= ~WS_EX_WINDOWEDGE;

#283     /* Correct the window style. */

#284     if (!(dwStyle & WS_CHILD))

#286        dwStyle |= WS_CLIPSIBLINGS;

#287        DPRINT("3: Style is now %lx/n", dwStyle);

#288        if (!(dwStyle & WS_POPUP))

#290           dwStyle |= WS_CAPTION;

#291           Window->Flags |= WINDOWOBJECT_NEED_SIZE;

#292           DPRINT("4: Style is now %lx/n", dwStyle);

#296     /* create system menu */

#297     if((dwStyle & WS_SYSMENU) )//&& (dwStyle & WS_CAPTION) == WS_CAPTION)

#299        SystemMenu = IntGetSystemMenu(Window, TRUE, TRUE);

#302           Window->SystemMenu = SystemMenu->MenuInfo.Self;

#303           IntReleaseMenuObject(SystemMenu);

#307     /* Set the window menu */

#308     if ((dwStyle & (WS_CHILD | WS_POPUP)) != WS_CHILD)

#311           IntSetMenu(Window, hMenu, &MenuChanged);

#314            hMenu = Wnd->Class->hMenu;

#315            if (hMenu) IntSetMenu(Window, hMenu, &MenuChanged);

#319         Wnd->IDMenu = (UINT) hMenu;

#321     /* Insert the window into the thread's window list. */

#322     InsertTailList (&pti->WindowListHead, &Window->ThreadListEntry);

为窗口分配设备DC,可以分配窗口类的DC,也可以是窗口的DC。这里调用驱动程序来创建一个设备。

#324     /*  Handle "CS_CLASSDC", it is tested first. */

#325     if ((Wnd->Class->Style & CS_CLASSDC) && !(Wnd->Class->Dce)) // One DCE per class to have CLASS.

#326        Wnd->Class->Dce = DceAllocDCE(Window, DCE_CLASS_DC);

#327     /* Allocate a DCE for this window. */

#328     else if ( Wnd->Class->Style & CS_OWNDC)

#329        Window->Dce = DceAllocDCE(Window, DCE_WINDOW_DC);

#336     Wnd->ExStyle = dwExStyle;

#337     Wnd->Style = dwStyle & ~WS_VISIBLE;

#340     Cs.lpCreateParams = lpParam;

#341     Cs.hInstance = hInstance;

#343     Cs.hwndParent = hWndParent; //Pass the original Parent handle!

#348     Cs.style = Wnd->Style;

#349     Cs.lpszName = (LPCWSTR) WindowName;

#350     Cs.lpszClass = (LPCWSTR) ClassName;

#351     Cs.dwExStyle = dwExStyle;

#352     CbtCreate.lpcs = &Cs;

#353     CbtCreate.hwndInsertAfter = HWND_TOP;

#354     if (co_HOOK_CallHooks(WH_CBT, HCBT_CREATEWND, (WPARAM) hWnd, (LPARAM) &CbtCreate))

#356        /* FIXME - Delete window object and remove it from the thread windows list */

#357        /* FIXME - delete allocated DCE */

#358        DPRINT1("CBT-hook returned !0/n");

#359        RETURN( (HWND) NULL);

#367     /* default positioning for overlapped windows */

#368     if(!(Wnd->Style & (WS_POPUP | WS_CHILD)))

#370        RECT rc, WorkArea;

#371        PRTL_USER_PROCESS_PARAMETERS ProcessParams;

#372        BOOL CalculatedDefPosSize = FALSE;

#374        IntGetDesktopWorkArea(((PTHREADINFO)Window->OwnerThread->Tcb.Win32Thread)->Desktop, &WorkArea);

#377        ProcessParams = PsGetCurrentProcess()->Peb->ProcessParameters;

#379        if(x == CW_USEDEFAULT || x == CW_USEDEFAULT16)

#381           CalculatedDefPosSize = IntCalcDefPosSize(ParentWindow, Window, &rc, TRUE);

#383           if(ProcessParams->WindowFlags & STARTF_USEPOSITION)

#385              ProcessParams->WindowFlags &= ~STARTF_USEPOSITION;

#386              Pos.x = WorkArea.left + ProcessParams->StartingX;

#387              Pos.y = WorkArea.top + ProcessParams->StartingY;

#391              Pos.x = rc.left;

#392              Pos.y = rc.top;

#396     According to wine, the ShowMode is set to y if x == CW_USEDEFAULT(16) and

#397     y is something else. and Quote!

#400  /* Never believe Microsoft's documentation... CreateWindowEx doc says

#401   * that if an overlapped window is created with WS_VISIBLE style bit

#402   * set and the x parameter is set to CW_USEDEFAULT, the system ignores

#403   * the y parameter. However, disassembling NT implementation (WIN32K.SYS)

#406   * 1) not only it checks for CW_USEDEFAULT but also for CW_USEDEFAULT16

#407   * 2) it does not ignore the y parameter as the docs claim; instead, it

#408   *    uses it as second parameter to ShowWindow() unless y is either

#409   *    CW_USEDEFAULT or CW_USEDEFAULT16.

#411   * The fact that we didn't do 2) caused bogus windows pop up when wine

#412   * was running apps that were using this obscure feature. Example -

#413   * calc.exe that comes with Win98 (only Win98, it's different from

#414   * the one that comes with Win95 and NT)

#416           if(y != CW_USEDEFAULT && y != CW_USEDEFAULT16)

#418              dwShowMode = y;

#421        if(nWidth == CW_USEDEFAULT || nWidth == CW_USEDEFAULT16)

#423           if(!CalculatedDefPosSize)

#425              IntCalcDefPosSize(ParentWindow, Window, &rc, FALSE);

#427           if(ProcessParams->WindowFlags & STARTF_USESIZE)

#429              ProcessParams->WindowFlags &= ~STARTF_USESIZE;

#430              Size.cx = ProcessParams->CountX;

#431              Size.cy = ProcessParams->CountY;

#435              Size.cx = rc.right - rc.left;

#436              Size.cy = rc.bottom - rc.top;

#439           /* move the window if necessary */

#440           if(Pos.x > rc.left)

#441              Pos.x = max(rc.left, 0);

#442           if(Pos.y > rc.top)

#443              Pos.y = max(rc.top, 0);

#448        /* if CW_USEDEFAULT(16) is set for non-overlapped windows, both values are set to zero) */

#449        if(x == CW_USEDEFAULT || x == CW_USEDEFAULT16)

#454        if(nWidth == CW_USEDEFAULT || nWidth == CW_USEDEFAULT16)

#461     /* Initialize the window dimensions. */

#462     Wnd->WindowRect.left = Pos.x;

#463     Wnd->WindowRect.top = Pos.y;

#464     Wnd->WindowRect.right = Pos.x + Size.cx;

#465     Wnd->WindowRect.bottom = Pos.y + Size.cy;

#466     if (0 != (Wnd->Style & WS_CHILD) && ParentWindow)

#468        IntGdiOffsetRect(&(Wnd->WindowRect), ParentWindow->Wnd->ClientRect.left,

#469                         ParentWindow->Wnd->ClientRect.top);

#471     Wnd->ClientRect = Wnd->WindowRect;

#474      * Get the size and position of the window.

#476     if ((dwStyle & WS_THICKFRAME) || !(dwStyle & (WS_POPUP | WS_CHILD)))

#478        POINT MaxSize, MaxPos, MinTrack, MaxTrack;

#480        /* WinPosGetMinMaxInfo sends the WM_GETMINMAXINFO message */

#481        co_WinPosGetMinMaxInfo(Window, &MaxSize, &MaxPos, &MinTrack,

#482                               &MaxTrack);

#483        if (MaxSize.x < Size.cx)

#484           Size.cx = MaxSize.x;

#485        if (MaxSize.y < Size.cy)

#486           Size.cy = MaxSize.y;

#487    if (Size.cx < MinTrack.x )

#488           Size.cx = MinTrack.x;

#489        if (Size.cy < MinTrack.y )

#490           Size.cy = MinTrack.y;

#491        if (Size.cx < 0)

#493        if (Size.cy < 0)

#497     Wnd->WindowRect.left = Pos.x;

#498     Wnd->WindowRect.top = Pos.y;

#499     Wnd->WindowRect.right = Pos.x + Size.cx;

#500     Wnd->WindowRect.bottom = Pos.y + Size.cy;

#501     if (0 != (Wnd->Style & WS_CHILD) && ParentWindow)

#503        IntGdiOffsetRect(&(Wnd->WindowRect), ParentWindow->Wnd->ClientRect.left,

#504                         ParentWindow->Wnd->ClientRect.top);

#506     Wnd->ClientRect = Wnd->WindowRect;

#508     /* FIXME: Initialize the window menu. */

#510     /* Send a NCCREATE message. */

#516     DPRINT("[win32k.window] IntCreateWindowEx style %d, exstyle %d, parent %d/n", Cs.style, Cs.dwExStyle, Cs.hwndParent);

#517     DPRINT("IntCreateWindowEx(): (%d,%d-%d,%d)/n", x, y, Size.cx, Size.cy);

#518     DPRINT("IntCreateWindowEx(): About to send NCCREATE message./n");

#519     Result = co_IntSendMessage(Window->hSelf, WM_NCCREATE, 0, (LPARAM) &Cs);

#522        /* FIXME: Cleanup. */

#523        DPRINT1("IntCreateWindowEx(): NCCREATE message failed. No cleanup performed!/n");

#524        RETURN((HWND)0);

#527     /* Calculate the non-client size. */

#528     MaxPos.x = Window->Wnd->WindowRect.left;

#529     MaxPos.y = Window->Wnd->WindowRect.top;

#532     DPRINT("IntCreateWindowEx(): About to get non-client size./n");

#533     /* WinPosGetNonClientSize SENDS THE WM_NCCALCSIZE message */

#534     Result = co_WinPosGetNonClientSize(Window,

#535                                        &Window->Wnd->WindowRect,

#536                                        &Window->Wnd->ClientRect);

#538     IntGdiOffsetRect(&Window->Wnd->WindowRect,

#539                      MaxPos.x - Window->Wnd->WindowRect.left,

#540                      MaxPos.y - Window->Wnd->WindowRect.top);

#543     if (NULL != ParentWindow)

#545        /* link the window into the parent's child list */

#546        if ((dwStyle & (WS_CHILD|WS_MAXIMIZE)) == WS_CHILD)

#548           PWINDOW_OBJECT PrevSibling;

#550           PrevSibling = ParentWindow->LastChild;

#552           /* link window as bottom sibling */

#553           IntLinkWindow(Window, ParentWindow, PrevSibling /*prev sibling*/);

#557           /* link window as top sibling (but after topmost siblings) */

#558           PWINDOW_OBJECT InsertAfter, Sibling;

#559           if (!(dwExStyle & WS_EX_TOPMOST))

#561              InsertAfter = NULL;

#562              Sibling = ParentWindow->FirstChild;

#563       while (Sibling && (Sibling->Wnd->ExStyle & WS_EX_TOPMOST))

#565                 InsertAfter = Sibling;

#566                 Sibling = Sibling->NextSibling;

#571              InsertAfter = NULL;

#574           IntLinkWindow(Window, ParentWindow, InsertAfter /* prev sibling */);

#579     /* Send the WM_CREATE message. */

#580  DPRINT("IntCreateWindowEx(): about to send CREATE message./n");

#581     Result = co_IntSendMessage(Window->hSelf, WM_CREATE, 0, (LPARAM) &Cs);

#583     if (Result == (LRESULT)-1)

#585        /* FIXME: Cleanup. */

#586        DPRINT1("IntCreateWindowEx(): send CREATE message failed. No cleanup performed!/n");

#587        IntUnlinkWindow(Window);

#588        RETURN((HWND)0);

#591     Result = IntNotifyWinEvent(EVENT_OBJECT_CREATE, Window, OBJID_WINDOW, 0);

#593     if (Result == (LRESULT)-1)

#595        /* FIXME: Cleanup. */

#596        DPRINT1("IntCreateWindowEx(): event CREATE hook failed. No cleanup performed!/n");

#597        IntUnlinkWindow(Window);

#598        RETURN((HWND)0);

#601     /* Send move and size messages. */

#602     if (!(Window->Flags & WINDOWOBJECT_NEED_SIZE))

#606        DPRINT("IntCreateWindow(): About to send WM_SIZE/n");

#608      if ((Window->Wnd->ClientRect.right - Window->Wnd->ClientRect.left) < 0 ||

#609              (Window->Wnd->ClientRect.bottom - Window->Wnd->ClientRect.top) < 0)

#611           DPRINT("Sending bogus WM_SIZE/n");

#614     lParam = MAKE_LONG(Window->Wnd->ClientRect.right -

#615                           Window->Wnd->ClientRect.left,

#616                           Window->Wnd->ClientRect.bottom -

#617                           Window->Wnd->ClientRect.top);

#618        co_IntSendMessage(Window->hSelf, WM_SIZE, SIZE_RESTORED,

#619                          lParam);

#621        DPRINT("IntCreateWindow(): About to send WM_MOVE/n");

#623        if (0 != (Wnd->Style & WS_CHILD) && ParentWindow)

#625           lParam = MAKE_LONG(Wnd->ClientRect.left - ParentWindow->Wnd->ClientRect.left,

#626                              Wnd->ClientRect.top - ParentWindow->Wnd->ClientRect.top);

#630       lParam = MAKE_LONG(Wnd->ClientRect.left,

#631                              Wnd->ClientRect.top);

#634        co_IntSendMessage(Window->hSelf, WM_MOVE, 0, lParam);

#636        /* Call WNDOBJ change procs */

#637        IntEngWindowChanged(Window, WOC_RGN_CLIENT);

#640     /* Show or maybe minimize or maximize the window. */

#641     if (Wnd->Style & (WS_MINIMIZE | WS_MAXIMIZE))

#646        SwFlag = (Wnd->Style & WS_MINIMIZE) ? SW_MINIMIZE :

#647                 SW_MAXIMIZE;

#649        co_WinPosMinMaximize(Window, SwFlag, &NewPos);

#651        SwFlag = ((Wnd->Style & WS_CHILD) || UserGetActiveWindow()) ?

#652   SWP_NOACTIVATE | SWP_NOZORDER | SWP_FRAMECHANGED :

#653                  SWP_NOZORDER | SWP_FRAMECHANGED;

#655        DPRINT("IntCreateWindow(): About to minimize/maximize/n");

#656        DPRINT("%d,%d %dx%d/n", NewPos.left, NewPos.top, NewPos.right, NewPos.bottom);

#657        co_WinPosSetWindowPos(Window, 0, NewPos.left, NewPos.top,

#658                              NewPos.right, NewPos.bottom, SwFlag);

#661     /* Notify the parent window of a new child. */

#662     if ((Wnd->Style & WS_CHILD) &&

#663         (!(Wnd->ExStyle & WS_EX_NOPARENTNOTIFY)) && ParentWindow)

#665        DPRINT("IntCreateWindow(): About to notify parent/n");

#666        co_IntSendMessage(ParentWindow->hSelf,

#667                          WM_PARENTNOTIFY,

#668                          MAKEWPARAM(WM_CREATE, Wnd->IDMenu),

#669                          (LPARAM)Window->hSelf);

#672     if ((!hWndParent) && (!HasOwner))

#674        DPRINT("Sending CREATED notify/n");

#675        co_IntShellHookNotify(HSHELL_WINDOWCREATED, (LPARAM)hWnd);

#679        DPRINT("Not sending CREATED notify, %x %d/n", ParentWindow, HasOwner);

#682     /* Initialize and show the window's scrollbars */

#683     if (Wnd->Style & WS_VSCROLL)

#685        co_UserShowScrollBar(Window, SB_VERT, TRUE);

#687     if (Wnd->Style & WS_HSCROLL)

#689        co_UserShowScrollBar(Window, SB_HORZ, TRUE);

#692     if (dwStyle & WS_VISIBLE)

#694        if (Wnd->Style & WS_MAXIMIZE)

#695           dwShowMode = SW_SHOW;

#696        else if (Wnd->Style & WS_MINIMIZE)

#697           dwShowMode = SW_SHOWMINIMIZED;

#699        DPRINT("IntCreateWindow(): About to show window/n");

#700        co_WinPosShowWindow(Window, dwShowMode);

#702        if (Wnd->ExStyle & WS_EX_MDICHILD)

#704          co_IntSendMessage(ParentWindow->hSelf, WM_MDIREFRESHMENU, 0, 0);

#705          /* ShowWindow won't activate child windows */

#706          co_WinPosSetWindowPos(Window, HWND_TOP, 0, 0, 0, 0, SWP_SHOWWINDOW | SWP_NOMOVE | SWP_NOSIZE);

#710     /* BugBoy Comments: if the window being created is a edit control, ATOM 0xC007,

#711        then my testing shows that windows (2k and XP) creates a CallProc for it immediately

#712        Dont understand why it does this. */

#713     if (ClassAtom == 0XC007)

#715        PCALLPROC CallProc;

#716        //CallProc = CreateCallProc(NULL, Wnd->WndProc, bUnicodeWindow, Wnd->ti->kpi);

#717        CallProc = CreateCallProc(NULL, Wnd->WndProc, Wnd->Unicode , Wnd->ti->kpi);

#721           SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);

#722           DPRINT1("Warning: Unable to create CallProc for edit control. Control may not operate correctly! hwnd %x/n",hWnd);

#726           UserAddCallProcToClass(Wnd->Class, CallProc);

#727           Wnd->CallProc = CallProc;

#728           Wnd->IsSystem = FALSE;

#732     DPRINT("IntCreateWindow(): = %X/n", hWnd);

#733     DPRINT("WindowObject->SystemMenu = 0x%x/n", Window->SystemMenu);

#737     if (!_ret_ && Window && Window->Wnd && ti)

#738         UserFreeWindowInfo(ti, Window);

#741        UserDerefObjectCo(Window);

#742        UserDereferenceObject(Window);

#744     if (ParentWindow) UserDerefObjectCo(ParentWindow);

#745     if (!_ret_ && ti != NULL)

#747         if (Class != NULL)

#749             IntDereferenceClass(Class,

#750                                 ti->Desktop,

#751                                 ti->kpi);

个人资料
文章分类
阅读排行
最新评论Android培训班(24)

shuaiziyihao: 太感谢了

Windows API一日一练(1)第一个应用程序

Liar0606: @kj399035165:VC的话#025 ::MessageBox(hWnd, _T("第一...

daoyuan2012: FindFirstFile、FindNextFile和FindClose三段代码还是读不懂。。。汗挂...

VC++ 2008 Express的wxWidgets培训班

ywq111: 支持下,收费不贵,也是辛苦活。我其实也想学习,一直苦于部分问题没法解答。观望下先。。。

ren0065: MSDN也比这个详细

Android培训班(全世界最便宜,还送6410开发板)

zh634455283: @caimouse:怕android过眼云烟,上半年诺基亚裁员一万,肯定很多人往android和ip...

Android培训班(104)start_kernel函数1

caimouse: 有C++的基础,转JAVA没有太大的问题,关键熟悉一下语法和开发工具,就可以开发了。其实也可以做系统...

Android培训班(全世界最便宜,还送6410开发板)

caimouse: android比较好,比较有前途。这个新兴的市场。@zh634455283:

Android培训班(全世界最便宜,还送6410开发板)

zh634455283: 搞C++培训吧




引文来源  reactos操作系统实现(162) - 大坡3D软件开发 - 博客频道 - CSDN.NET
  评论这张
 
阅读(489)| 评论(0)
推荐 转载

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017