Home | Info | Community | Development | myReactOS | Contact Us
[static]
Definition at line 1152 of file connectdialog.c.
{ PINFO pInfo; /* Get the window context */ pInfo = (PINFO)GetWindowLongPtrW(hDlg, GWLP_USERDATA); if (pInfo == NULL && Message != WM_INITDIALOG) { goto HandleDefaultMessage; } switch(Message) { case WM_INITDIALOG: OnMainCreate(hDlg, (PRDPSETTINGS)lParam); break; case WM_COMMAND: { if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL) { if (LOWORD(wParam) == IDOK ) { SaveAllSettings(pInfo); SaveRdpSettingsToFile(NULL, pInfo->pRdpSettings); } Cleanup(pInfo); EndDialog(hDlg, LOWORD(wParam)); } break; } case WM_NOTIFY: { //INT idctrl; LPNMHDR pnmh; //idctrl = (int)wParam; pnmh = (LPNMHDR)lParam; if (//(pnmh->hwndFrom == pInfo->hSelf) && (pnmh->idFrom == IDC_TAB) && (pnmh->code == TCN_SELCHANGE)) { OnTabWndSelChange(pInfo); } break; } case WM_PAINT: { PAINTSTRUCT ps; HDC hdc; hdc = BeginPaint(hDlg, &ps); if (hdc != NULL) { HDC hdcMem = CreateCompatibleDC(hdc); if (hdcMem) { WCHAR szBuffer[32]; RECT bmpRc, txtRc; LOGFONTW lf; HFONT hFont, hFontOld; HBITMAP hBmpOld; GetClientRect(pInfo->hSelf, &bmpRc); hBmpOld = SelectObject(hdcMem, pInfo->hHeader); StretchBlt(hdc, 0, 0, bmpRc.right, pInfo->headerbitmap.bmHeight, hdcMem, 0, 0, pInfo->headerbitmap.bmWidth, pInfo->headerbitmap.bmHeight, SRCCOPY); SelectObject(hdcMem, hBmpOld); txtRc.left = bmpRc.right / 4; txtRc.top = 10; txtRc.right = bmpRc.right * 3 / 4; txtRc.bottom = pInfo->headerbitmap.bmHeight / 2; ZeroMemory(&lf, sizeof(LOGFONTW)); if (LoadStringW(hInst, IDS_HEADERTEXT1, szBuffer, sizeof(szBuffer) / sizeof(WCHAR))) { lf.lfHeight = 24; lf.lfCharSet = OEM_CHARSET; lf.lfQuality = DEFAULT_QUALITY; lf.lfWeight = FW_MEDIUM; wcscpy(lf.lfFaceName, L"Tahoma"); hFont = CreateFontIndirectW(&lf); if (hFont) { hFontOld = SelectObject(hdc, hFont); DPtoLP(hdc, (PPOINT)&txtRc, 2); SetTextColor(hdc, RGB(255,255,255)); SetBkMode(hdc, TRANSPARENT); DrawTextW(hdc, szBuffer, -1, &txtRc, DT_BOTTOM | DT_SINGLELINE | DT_NOCLIP); SelectObject(hdc, hFontOld); DeleteObject(hFont); } } txtRc.left = bmpRc.right / 4; txtRc.top = txtRc.bottom - 5; txtRc.right = bmpRc.right * 3 / 4; txtRc.bottom = pInfo->headerbitmap.bmHeight * 9 / 10; if (LoadStringW(hInst, IDS_HEADERTEXT2, szBuffer, sizeof(szBuffer) / sizeof(WCHAR))) { lf.lfHeight = 30; lf.lfCharSet = OEM_CHARSET; lf.lfQuality = DEFAULT_QUALITY; lf.lfWeight = FW_EXTRABOLD; wcscpy(lf.lfFaceName, L"Tahoma"); hFont = CreateFontIndirectW(&lf); if (hFont) { hFontOld = SelectObject(hdc, hFont); DPtoLP(hdc, (PPOINT)&txtRc, 2); SetTextColor(hdc, RGB(255,255,255)); SetBkMode(hdc, TRANSPARENT); DrawTextW(hdc, szBuffer, -1, &txtRc, DT_TOP | DT_SINGLELINE); SelectObject(hdc, hFontOld); DeleteObject(hFont); } } DeleteDC(hdcMem); } EndPaint(hDlg, &ps); } break; } case WM_CLOSE: { Cleanup(pInfo); EndDialog(hDlg, 0); } break; HandleDefaultMessage: default: return FALSE; } return FALSE; }