全部博文(584)
分类: LINUX
2010-10-29 22:46:12
1: #ifndef _LITE_VERSION
2: if (pCreateInfo->hHosting == HWND_DESKTOP) {
3: // Create message queue for this new main window.
4: if( !(pWin->pMessages = malloc(sizeof(MSGQUEUE))) ) {
5: free(pWin);
6: return HWND_INVALID;
7: }
8:
9: // Init message queue.
10: if (!InitMsgQueue(pWin->pMessages, 0))
11: goto err;
12: }
13: else
14: pWin->pMessages = GetMsgQueue (pCreateInfo->hHosting);
15: #else
16: pWin->pMessages = &__mg_dsk_msgs;
17: #endif |
1: pWin->MainWindowProc = pCreateInfo->MainWindowProc;
2: pWin->iBkColor = pCreateInfo->iBkColor;
3:
4: pWin->pCaretInfo = NULL;
5:
6: pWin->dwAddData = pCreateInfo->dwAddData;
7: pWin->dwAddData2 = 0;
8:
9: if ( !( pWin->pZOrderNode = malloc (sizeof(ZORDERNODE))) )
10: goto err; |
1: SendMessage ((HWND)pWin, MSG_SIZECHANGING,
2: (WPARAM)&pCreateInfo->lx, (LPARAM)&pWin->left);
3: SendMessage ((HWND)pWin, MSG_CHANGESIZE,
4: (WPARAM)&pWin->left, 0);
5:
6: SendMessage (HWND_DESKTOP, MSG_ADDNEWMAINWIN,
7: (WPARAM) pWin, (LPARAM) pWin->pZOrderNode);
8:
9: if (SendMessage ((HWND)pWin, MSG_CREATE, 0, (LPARAM)pCreateInfo)) {
10: SendMessage(HWND_DESKTOP,
11: MSG_REMOVEMAINWIN, (WPARAM)pWin, 0);
12: goto err;
13: } |
1: hDlg = CreateMainWindow (&CreateInfo);
2: if (hDlg == HWND_INVALID)
3: return -1;
4:
5: SetWindowAdditionalData2 (hDlg, (DWORD)(&retCode));
6:
7: if (hOwner)
8: EnableWindow (hOwner, FALSE);
9:
10: hFocus = GetNextDlgTabItem (hDlg, (HWND)0, FALSE);
11: if (SendMessage (hDlg, MSG_INITDIALOG, hFocus, lParam)) {
12: if (hFocus)
13: SetFocus (hFocus);
14: }
15:
16: ShowWindow (hDlg, SW_SHOWNORMAL);
17:
18: while( GetMessage (&Msg, hDlg) ) {
19: TranslateMessage (&Msg);
20: DispatchMessage (&Msg);
21: }
22:
23: isActive = (GetActiveWindow() == hDlg);
24:
25: dlgDestroyAllControls (hDlg);
26: DestroyMainWindow (hDlg);
27: ThrowAwayMessages (hDlg);
28: MainWindowThreadCleanup (hDlg);
29:
30: if (hOwner) {
31: EnableWindow (hOwner, TRUE);
32: if(isActive)
33: {
34: ShowWindow (hOwner, SW_SHOWNORMAL);
35: SetActiveWindow (hOwner);
36: }
37: }
38:
39: return retCode; |
1: if (!(pMainWin = GetMainWindowPtrOfControl (hParentWnd)))
2: return HWND_INVALID;
3:
4: cci = (PCTRLCLASSINFO)SendMessage (HWND_DESKTOP,
5: MSG_GETCTRLCLASSINFO, 0, (LPARAM)spClassName);
6: if (!cci) return HWND_INVALID;
7:
8: pNewCtrl = calloc (1, sizeof (CONTROL));
9:
10: if (!pNewCtrl) return HWND_INVALID;
11:
12: pNewCtrl->DataType = TYPE_HWND;
13: pNewCtrl->WinType = TYPE_CONTROL;
14:
15: pNewCtrl->left = x;
16: pNewCtrl->top = y;
17: pNewCtrl->right = x + w;
18: pNewCtrl->bottom = y + h;
…… |
1: SendMessage (HWND_DESKTOP, MSG_NEWCTRLINSTANCE,
2: (WPARAM)hParentWnd, (LPARAM)pNewCtrl);
3:
4: if (SendMessage ((HWND)pNewCtrl, MSG_CREATE,
5: (WPARAM)hParentWnd, (LPARAM)dwAddData)) {
6: SendMessage (HWND_DESKTOP,
7: MSG_REMOVECTRLINSTANCE,
8: (WPARAM)hParentWnd, (LPARAM)pNewCtrl);
9: goto error;
10:}
11: SendMessage ((HWND)pNewCtrl, MSG_SIZECHANGING,
12: (WPARAM)&rcExpect, (LPARAM)&pNewCtrl->left);
13: SendMessage ((HWND)pNewCtrl, MSG_CHANGESIZE,
14: (WPARAM)(&pNewCtrl->left), 0);
15:
16: if (pNewCtrl->pParent->dwStyle & WS_VISIBLE && pNewCtrl->dwStyle &
17: WS_VISIBLE)
18: UpdateWindow ((HWND)pNewCtrl, TRUE); |