|
|
1.1.1.3 ! root 1: ! 2: /******************************************************************************\ ! 3: * This is a part of the Microsoft Source Code Samples. ! 4: * Copyright (C) 1993 Microsoft Corporation. ! 5: * All rights reserved. ! 6: * This source code is only intended as a supplement to ! 7: * Microsoft Development Tools and/or WinHelp documentation. ! 8: * See these sources for detailed information regarding the ! 9: * Microsoft samples programs. ! 10: \******************************************************************************/ ! 11: 1.1 root 12: /******************************Module*Header*******************************\ 13: * Module Name: mdi.c 14: * 15: * MDI demonstration 16: * + Associating data with a MDI window (using Set/GetWindowLong ) 17: * 18: * Dependencies: 19: * 20: * (#defines) 21: * (#includes) 22: * MDI.H 23: * 24: \**************************************************************************/ 25: #define STRICT 26: #include <stdlib.h> 27: #include "mdi.h" 28: #include <stdarg.h> 29: 30: HANDLE ghModule; 31: HWND ghwndMain = NULL; 32: HWND ghwndClient = NULL; 33: 1.1.1.3 ! root 34: HMENU hMenu, hMenuWindow; 1.1 root 35: HMENU hChildMenu, hChildMenuWindow; 36: 37: CHAR gszFile[20]; 38: CHAR gszMapName[20]; 39: 40: // 41: // Instance data for each MDI child window 42: // 43: typedef struct _PerWndInfo { 44: HWND hParent; 45: HWND hTextWnd; 46: RECT rcClient; 47: char CaptionBarText[SIZEOFCAPTIONTEXT]; 48: } INFO, *PINFO; 49: 50: // 51: // Forward declarations. 52: // 53: BOOL InitializeApp (void); 1.1.1.2 root 54: LONG APIENTRY MainWndProc (HWND, UINT, DWORD, LONG); 55: LONG APIENTRY MDIWndProc (HWND, UINT, DWORD, LONG); 1.1.1.3 ! root 56: BOOL CALLBACK About (HWND, UINT, DWORD, LONG); 1.1.1.2 root 57: LONG APIENTRY TextWndProc (HWND, UINT, DWORD, LONG); 1.1.1.3 ! root 58: VOID vTest (PINFO); 1.1.1.2 root 59: 1.1 root 60: /***************************************************************************\ 61: * WinMain 62: * 63: * 64: * History: 65: * 11-Feb-1992 Petrus Wong [] 66: * Added conditional compile statement for internal build environment. 67: * 04-17-91 ???? Created. 68: \***************************************************************************/ 1.1.1.2 root 69: int APIENTRY WinMain( 70: HINSTANCE hInstance, 71: HINSTANCE hPrevInstance, 1.1 root 72: LPSTR lpCmdLine, 73: int nShowCmd) 74: { 75: MSG msg; 76: HANDLE hAccel; 77: 78: ghModule = GetModuleHandle(NULL); 79: if (!InitializeApp()) { 1.1.1.3 ! root 80: MessageBox(ghwndMain, "MDI: InitializeApp failure!", "Error", MB_OK); 1.1 root 81: return 0; 82: } 83: 84: if (!(hAccel = LoadAccelerators (ghModule, MAKEINTRESOURCE(ACCEL_ID)))) 1.1.1.3 ! root 85: MessageBox(ghwndMain, "MDI: Load Accel failure!", "Error", MB_OK); 1.1 root 86: 87: 88: while (GetMessage(&msg, NULL, 0, 0)) { 89: if (!TranslateAccelerator( ghwndMain, hAccel, &msg) && 90: !TranslateMDISysAccel( ghwndClient, &msg) ) { 91: TranslateMessage(&msg); 92: DispatchMessage(&msg); 93: } 94: } 95: 96: return 1; 97: 98: UNREFERENCED_PARAMETER(lpCmdLine); 99: UNREFERENCED_PARAMETER(nShowCmd); 100: UNREFERENCED_PARAMETER(hInstance); 101: UNREFERENCED_PARAMETER(hPrevInstance); 102: } 103: 104: 105: /***************************************************************************\ 106: * InitializeApp 107: * 108: * History: 109: * 11-Feb-1992 Petrus Wong [] 110: * Name changes. 1.1.1.3 ! root 111: * 09-09-91 Created. 1.1 root 112: \***************************************************************************/ 113: 114: BOOL InitializeApp(void) 115: { 116: WNDCLASS wc; 117: 118: wc.style = CS_OWNDC; 119: wc.lpfnWndProc = (WNDPROC) MainWndProc; 120: wc.cbClsExtra = 0; 1.1.1.3 ! root 121: wc.cbWndExtra = sizeof(LONG); 1.1 root 122: wc.hInstance = ghModule; 123: wc.hIcon = LoadIcon(NULL, IDI_APPLICATION); 124: wc.hCursor = LoadCursor(NULL, IDC_ARROW); 1.1.1.3 ! root 125: wc.hbrBackground = (HBRUSH)(COLOR_APPWORKSPACE); 1.1 root 126: wc.lpszMenuName = "MainMenu"; 1.1.1.3 ! root 127: wc.lpszClassName = "MDIDemoClass"; 1.1 root 128: 129: if (!RegisterClass(&wc)) 1.1.1.3 ! root 130: return FALSE; 1.1 root 131: 1.1.1.3 ! root 132: wc.lpfnWndProc = (WNDPROC) MDIWndProc; 1.1 root 133: wc.hIcon = LoadIcon(NULL, IDI_APPLICATION); 1.1.1.3 ! root 134: wc.lpszMenuName = NULL; ! 135: wc.lpszClassName = "MDIClass"; 1.1 root 136: 137: if (!RegisterClass(&wc)) 138: return FALSE; 139: 1.1.1.3 ! root 140: wc.style = CS_OWNDC | CS_HREDRAW | CS_VREDRAW; ! 141: wc.lpfnWndProc = (WNDPROC) TextWndProc; ! 142: wc.hIcon = NULL; 1.1 root 143: wc.hCursor = LoadCursor(NULL, IDC_ARROW); 1.1.1.3 ! root 144: wc.hbrBackground = (HBRUSH)(COLOR_BTNSHADOW); ! 145: wc.lpszMenuName = NULL; ! 146: wc.lpszClassName = "Text"; 1.1 root 147: 148: if (!RegisterClass(&wc)) 149: return FALSE; 150: 151: 152: 1.1.1.3 ! root 153: hMenu = LoadMenu(ghModule, "MainMenu"); 1.1 root 154: hChildMenu = LoadMenu(ghModule, "ChildMenu"); 155: hMenuWindow = GetSubMenu(hMenu, 1); 156: hChildMenuWindow = GetSubMenu(hChildMenu, 2); 157: 158: ghwndMain = CreateWindowEx(0L, "MDIDemoClass", "MDI Demonstration", 1.1.1.3 ! root 159: WS_OVERLAPPED | WS_CAPTION | WS_BORDER | ! 160: WS_THICKFRAME | WS_MAXIMIZEBOX | WS_MINIMIZEBOX | ! 161: WS_CLIPCHILDREN | WS_VISIBLE | WS_SYSMENU, 1.1 root 162: 80, 70, 400, 300, 1.1.1.3 ! root 163: NULL, hMenu, ghModule, NULL); 1.1 root 164: 165: if (ghwndMain == NULL) 1.1.1.3 ! root 166: return FALSE; 1.1 root 167: 168: SetWindowLong(ghwndMain, GWL_USERDATA, 0L); 169: 170: SetFocus(ghwndMain); /* set initial focus */ 171: 172: return TRUE; 173: } 174: 175: 176: /***************************************************************************\ 177: * MainWndProc 178: * 179: * History: 180: * 11-Feb-1992 Petrus Wong [] 181: * Name changes. Added comments. 1.1.1.3 ! root 182: * 09-09-91 Created. 1.1 root 183: \***************************************************************************/ 184: 1.1.1.2 root 185: long APIENTRY MainWndProc( 1.1 root 186: HWND hwnd, 187: UINT message, 188: DWORD wParam, 189: LONG lParam) 190: { 1.1.1.3 ! root 191: static int iMDICount=1; 1.1 root 192: CLIENTCREATESTRUCT clientcreate; 193: HWND hwndChildWindow; 194: 195: 196: switch (message) { 197: 198: case WM_CREATE: 1.1.1.3 ! root 199: SetWindowLong(hwnd, 0, (LONG)NULL); 1.1 root 200: 1.1.1.3 ! root 201: clientcreate.hWindowMenu = hMenuWindow; ! 202: clientcreate.idFirstChild = 1; 1.1 root 203: 1.1.1.3 ! root 204: ghwndClient = CreateWindow("MDICLIENT", NULL, ! 205: WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE, ! 206: 0,0,0,0, ! 207: hwnd, NULL, ghModule, (LPVOID)&clientcreate); ! 208: return 0L; 1.1 root 209: 210: case WM_DESTROY: { 1.1.1.3 ! root 211: PostQuitMessage(0); ! 212: return 0L; 1.1 root 213: } 214: 215: case WM_COMMAND: 216: 1.1.1.3 ! root 217: switch (LOWORD(wParam)) { 1.1 root 218: // 219: // Getting default MDI functionalities... 220: // 1.1.1.3 ! root 221: case IDM_TILE: ! 222: SendMessage(ghwndClient, WM_MDITILE, 0L, 0L); ! 223: return 0L; ! 224: case IDM_CASCADE: ! 225: SendMessage(ghwndClient, WM_MDICASCADE, 0L, 0L); ! 226: return 0L; ! 227: case IDM_ARRANGE: ! 228: SendMessage(ghwndClient, WM_MDIICONARRANGE, 0L, 0L); ! 229: return 0L; 1.1 root 230: 231: // 232: // Creates MDI child 233: // 1.1.1.3 ! root 234: case MM_MDI: { ! 235: HANDLE hInfo; ! 236: PINFO pInfo; 1.1 root 237: MDICREATESTRUCT mdicreate; 238: 239: // 240: // Allocating memory for INFO to be associated with the 241: // new child 242: // 1.1.1.3 ! root 243: hInfo = LocalAlloc(LHND, (WORD) sizeof(INFO)); ! 244: if (hInfo) { ! 245: if ((pInfo = (PINFO)LocalLock(hInfo)) == NULL) ! 246: MessageBox(ghwndMain, "Failed in LocalLock", "Error", MB_OK); 1.1 root 247: 1.1.1.3 ! root 248: wsprintf((LPSTR) &(pInfo->CaptionBarText), ! 249: "MDI %d", iMDICount); 1.1 root 250: pInfo->hParent = ghwndClient; 251: 1.1.1.3 ! root 252: mdicreate.szClass = "MDIClass"; ! 253: mdicreate.szTitle = (LPTSTR)&(pInfo->CaptionBarText); ! 254: mdicreate.hOwner = ghModule; ! 255: mdicreate.x = ! 256: mdicreate.y = ! 257: mdicreate.cx = ! 258: mdicreate.cy = CW_USEDEFAULT; ! 259: mdicreate.style = 0L; 1.1 root 260: // 261: // passing the handle of the per MDI child INFO to the 262: // child MDI window for storage 263: // 1.1.1.3 ! root 264: mdicreate.lParam = (LONG) hInfo; ! 265: ! 266: /*Create Child Window*/ ! 267: hwndChildWindow = ! 268: (HANDLE) SendMessage(ghwndClient, WM_MDICREATE, ! 269: 0L, ! 270: (LONG)(LPMDICREATESTRUCT)&mdicreate); ! 271: ! 272: if (hwndChildWindow == NULL) { ! 273: MessageBox(ghwndMain, "Failed in Creating Child Window", "Error", MB_OK); ! 274: return 0L; ! 275: } ! 276: ! 277: iMDICount++; ! 278: ! 279: LocalUnlock(hInfo); ! 280: } else { ! 281: MessageBox(ghwndMain, "Failed to Allocate INFO data!", "Error", MB_OK); ! 282: } ! 283: return 0L; ! 284: } ! 285: 1.1 root 286: 1.1.1.3 ! root 287: case MM_ABOUT: ! 288: if (DialogBox(ghModule, "AboutBox", ghwndMain, (DLGPROC)About) == -1) ! 289: MessageBox(ghwndMain, "DEMO: About Dialog Creation Error!", "Error", MB_OK); ! 290: return 0L; 1.1 root 291: 292: // 293: // Passes these WM_COMMAND messages to the appropriate active child 294: // window proc for processing 295: // 1.1.1.3 ! root 296: case MM_OPT_1: ! 297: case MM_OPT_2: ! 298: case MM_OPT_3: ! 299: case MM_OPT_4: ! 300: case MM_OPT_5: ! 301: case MM_OPT_6: ! 302: case MM_OPT_7: ! 303: case MM_OPT_8: { ! 304: HWND hActiveChild; ! 305: ! 306: hActiveChild = (HANDLE) SendMessage(ghwndClient, WM_MDIGETACTIVE, 0L, 0L); ! 307: if (hActiveChild) ! 308: SendMessage(hActiveChild, WM_COMMAND, wParam, lParam); ! 309: return 0L; ! 310: } 1.1 root 311: 1.1.1.3 ! root 312: default: ! 313: return DefFrameProc(hwnd, ghwndClient, message, wParam, lParam); 1.1 root 314: } 315: 316: default: 317: 1.1.1.3 ! root 318: return DefFrameProc(hwnd, ghwndClient, message, wParam, lParam); 1.1 root 319: } 320: } 321: 322: /***************************************************************************\ 323: * MDIWndProc 324: * 325: * History: 326: * 11-Feb-1992 Petrus Wong [] 327: * Name changes. Added comments. 1.1.1.3 ! root 328: * 09-09-91 Petrus Wong Rewrote. 1.1 root 329: * 04-17-91 ???? Created. 330: \***************************************************************************/ 331: 1.1.1.2 root 332: long APIENTRY MDIWndProc( 1.1 root 333: HWND hwnd, 334: UINT message, 335: DWORD wParam, 336: LONG lParam) 337: { 338: 339: switch (message) { 1.1.1.3 ! root 340: case WM_COMMAND: { 1.1 root 341: HANDLE hInfo; 342: PINFO pInfo; 343: HWND hTextWnd; 344: 345: // 346: // Retrieving this child window's INFO data for displaying 347: // messages in the text window 348: // 349: hInfo = (HANDLE) GetWindowLong(hwnd, 0); 350: if (hInfo) { 351: if ((pInfo = (PINFO)LocalLock(hInfo)) == NULL) 352: MessageBox(ghwndMain, "Failed in LocalLock", "Error", MB_OK); 353: 1.1.1.3 ! root 354: hTextWnd = pInfo->hTextWnd; ! 355: vTest(pInfo); 1.1 root 356: LocalUnlock(hInfo); 357: } else { 358: MessageBox(ghwndMain, "Can't get hInfo!", "Error", MB_OK); 359: } 360: 361: 1.1.1.3 ! root 362: switch (LOWORD(wParam)) { ! 363: case MM_OPT_1: { ! 364: SetWindowText(hTextWnd, "MM_OPT_1"); 1.1 root 365: return 0L; 366: } 367: 1.1.1.3 ! root 368: case MM_OPT_2: { 1.1 root 369: SetWindowText(hTextWnd, "MM_OPT_2"); 1.1.1.3 ! root 370: return 0L; ! 371: } 1.1 root 372: 1.1.1.3 ! root 373: case MM_OPT_3: { ! 374: SetWindowText(hTextWnd, "MM_OPT_3"); ! 375: return 0L; ! 376: } ! 377: ! 378: case MM_OPT_4: { ! 379: SetWindowText(hTextWnd, "MM_OPT_4"); ! 380: return 0L; ! 381: } 1.1 root 382: default: 383: return 0L; 384: 1.1.1.3 ! root 385: } 1.1 root 386: 1.1.1.3 ! root 387: } ! 388: case WM_SETFOCUS: ! 389: break; 1.1 root 390: 391: // 392: // Potentially, you can set different menu for different MDI 393: // child which is currently being active. 394: // 1.1.1.3 ! root 395: case WM_MDIACTIVATE: ! 396: if ((HWND) lParam == hwnd) { ! 397: SendMessage(GetParent(hwnd), WM_MDISETMENU, ! 398: (DWORD) hChildMenu, ! 399: (LONG) hChildMenuWindow) ; ! 400: DrawMenuBar(GetParent(GetParent(hwnd))) ; ! 401: } ! 402: return 0L; 1.1 root 403: 404: // 405: // Whenever the MDI child window is resized, its children has to be 406: // resized accordingly. 407: // 1.1.1.3 ! root 408: case WM_SIZE: { 1.1 root 409: HANDLE hInfo; 410: PINFO pInfo; 411: HWND hTextWnd; 412: 413: // 414: // First, get the text window's handle from the per MDI child 415: // INFO data structure 416: // 417: hInfo = (HANDLE) GetWindowLong(hwnd, 0); 418: if (hInfo) { 419: if ((pInfo = (PINFO)LocalLock(hInfo)) == NULL) 420: MessageBox(ghwndMain, "Failed in LocalLock", "Error", MB_OK); 421: 422: hTextWnd = pInfo->hTextWnd; 1.1.1.3 ! root 423: LocalUnlock(hInfo); ! 424: } else { ! 425: MessageBox(ghwndMain, "Can't get hInfo!", "Error", MB_OK); ! 426: } 1.1 root 427: 428: // 429: // Always, put the text window at the bottom of the MDI window 430: // 1.1.1.3 ! root 431: MoveWindow(hTextWnd, ! 432: 0, ! 433: HIWORD(lParam) - GetWindowLong(hTextWnd, GWL_USERDATA), ! 434: LOWORD(lParam), ! 435: HIWORD(lParam), TRUE); ! 436: break; 1.1 root 437: } 438: 439: // 440: // Creates the text window for this MDI child and saves its handle 441: // in the per MDI child INFO data structure. 442: // 1.1.1.3 ! root 443: case WM_CREATE: { 1.1 root 444: PINFO pInfo; 445: HANDLE hInfo; 446: HWND hTextWnd; 447: 448: hTextWnd = CreateWindow("Text", NULL, 449: WS_BORDER | SS_LEFT | WS_CHILD | WS_VISIBLE, 450: 0, 0, 0, 0, 451: hwnd, 452: (HMENU) 2, 453: ghModule, 454: NULL); 455: 456: SetWindowText(hTextWnd, "Select 'Option' menu items"); 457: // 458: // INFO was allocated in the MDIWndProc at MM_MDI time and is 459: // passed to us at WM_CREATE time... 460: // 461: hInfo = (HANDLE) ((LPMDICREATESTRUCT) ((LPCREATESTRUCT) lParam)->lpCreateParams)->lParam ; 462: if (hInfo) { 463: if ((pInfo = (PINFO)LocalLock(hInfo)) == NULL) 464: MessageBox(ghwndMain, "Failed in LocalLock", "Error", MB_OK); 465: 466: if (!GetClientRect(hwnd, &pInfo->rcClient)) 467: MessageBox(ghwndMain, "Failed in GetClientRect!", "Error", MB_OK); 468: 469: pInfo->hTextWnd = hTextWnd; 470: // 471: // Save the handle to INFO in our window structure 472: // 473: SetWindowLong(hwnd, 0, (LONG) hInfo); 1.1.1.3 ! root 474: LocalUnlock(hInfo); ! 475: } else { ! 476: MessageBox(ghwndMain, "Can't allocate hInfo!", "Error", MB_OK); ! 477: } 1.1 root 478: 479: break; 1.1.1.3 ! root 480: } 1.1 root 481: 482: // 483: // Free the INFO data that associates with this window 484: // also, reset the menu. 485: // 1.1.1.3 ! root 486: case WM_CLOSE: { ! 487: HANDLE hInfo; 1.1 root 488: 1.1.1.3 ! root 489: SendMessage(GetParent(hwnd), WM_MDISETMENU, ! 490: (DWORD) hMenu, ! 491: (LONG) hMenuWindow) ; ! 492: DrawMenuBar(GetParent(GetParent(hwnd))) ; 1.1 root 493: 1.1.1.3 ! root 494: hInfo = (HANDLE) GetWindowLong(hwnd, 0); ! 495: LocalFree(hInfo); 1.1 root 496: break; 1.1.1.3 ! root 497: } 1.1 root 498: 1.1.1.3 ! root 499: default: ! 500: return DefMDIChildProc(hwnd, message, wParam, lParam); 1.1 root 501: 502: } //switch 503: return DefMDIChildProc(hwnd, message, wParam, lParam); 504: } 505: 506: /***************************************************************************\ 507: * About 508: * 509: * About dialog proc. 510: * 511: * History: 1.1.1.3 ! root 512: * 09-09-91 Petrus Wong Rewrote. 1.1 root 513: * 04-13-91 ???? Created. 514: \***************************************************************************/ 515: 1.1.1.3 ! root 516: BOOL CALLBACK About ( 1.1 root 517: HWND hDlg, 518: UINT message, 519: DWORD wParam, 520: LONG lParam) 521: { 522: switch (message) { 523: case WM_INITDIALOG: 524: return TRUE; 525: 526: case WM_COMMAND: 527: if (wParam == IDOK) 528: EndDialog(hDlg, wParam); 529: break; 530: } 531: 532: return FALSE; 533: 534: UNREFERENCED_PARAMETER(lParam); 535: UNREFERENCED_PARAMETER(hDlg); 536: } 537: 538: /***************************************************************************\ 539: * 540: * TextWndProc 541: * 542: * Text Window procedure for displaying miscellaneous messages to user. 543: * 544: * History: 545: * 10-07-91 546: * 3D text output 547: * 548: \***************************************************************************/ 549: 1.1.1.2 root 550: LONG APIENTRY TextWndProc (HWND hwnd, UINT message, DWORD wParam, LONG lParam) 1.1 root 551: { 552: static HFONT hFont = (HFONT) NULL; 553: 554: switch (message) 555: { 556: case WM_CREATE: 557: { 1.1.1.3 ! root 558: LOGFONT lf; ! 559: HDC hDC; ! 560: HFONT hOldFont; 1.1 root 561: TEXTMETRIC tm; 1.1.1.3 ! root 562: RECT rect; ! 563: LONG lHeight; 1.1 root 564: 565: SystemParametersInfo(SPI_GETICONTITLELOGFONT, sizeof(lf), (PVOID) &lf, (UINT)FALSE); 566: 1.1.1.3 ! root 567: hDC = GetDC(hwnd); ! 568: // this is the height for 8 point size font in pixels ! 569: lf.lfHeight = 8 * GetDeviceCaps(hDC, LOGPIXELSY) / 72; ! 570: ! 571: hFont = CreateFontIndirect(&lf); ! 572: hOldFont = SelectObject(hDC, hFont); ! 573: GetTextMetrics(hDC, &tm); ! 574: GetClientRect(GetParent(hwnd), &rect); ! 575: ! 576: // base the height of the window on size of text ! 577: lHeight = tm.tmHeight+6*GetSystemMetrics(SM_CYBORDER)+2; ! 578: // saved the height for later reference ! 579: SetWindowLong(hwnd, GWL_USERDATA, lHeight); ! 580: SetWindowPos(hwnd, NULL, ! 581: 0, ! 582: rect.bottom-lHeight, ! 583: rect.right-rect.left, ! 584: lHeight, ! 585: SWP_NOZORDER | SWP_NOMOVE); 1.1 root 586: 587: ReleaseDC(hwnd, hDC); 588: break; 589: } 590: 591: case WM_DESTROY: 1.1.1.3 ! root 592: if (hFont) ! 593: DeleteObject(hFont); ! 594: break; 1.1 root 595: 596: case WM_SETTEXT: 597: DefWindowProc(hwnd, message, wParam, lParam); 598: InvalidateRect(hwnd,NULL,FALSE); 599: UpdateWindow(hwnd); 600: return 0L; 601: 602: case WM_PAINT: 603: { 604: PAINTSTRUCT ps; 605: RECT rc; 606: char ach[128]; 607: int len, nxBorder, nyBorder; 608: HFONT hOldFont = NULL; 609: 610: BeginPaint(hwnd, &ps); 611: 612: GetClientRect(hwnd,&rc); 613: 614: nxBorder = GetSystemMetrics(SM_CXBORDER); 1.1.1.3 ! root 615: rc.left += 9*nxBorder; 1.1 root 616: rc.right -= 9*nxBorder; 617: 618: nyBorder = GetSystemMetrics(SM_CYBORDER); 1.1.1.3 ! root 619: rc.top += 3*nyBorder; ! 620: rc.bottom -= 3*nyBorder; 1.1 root 621: 1.1.1.3 ! root 622: // 3D Text 1.1 root 623: len = GetWindowText(hwnd, ach, sizeof(ach)); 1.1.1.3 ! root 624: SetBkColor(ps.hdc, GetSysColor(COLOR_BTNFACE)); 1.1 root 625: 1.1.1.3 ! root 626: SetBkMode(ps.hdc, TRANSPARENT); ! 627: SetTextColor(ps.hdc, RGB(64,96,96)); ! 628: if (hFont) ! 629: hOldFont = SelectObject(ps.hdc, hFont); ! 630: ExtTextOut(ps.hdc, rc.left+2*nxBorder+2, rc.top+2, ETO_OPAQUE | ETO_CLIPPED, ! 631: &rc, ach, len, NULL); ! 632: ! 633: SetTextColor(ps.hdc, RGB(128,128,128)); ! 634: if (hFont) ! 635: hOldFont = SelectObject(ps.hdc, hFont); ! 636: ExtTextOut(ps.hdc, rc.left+2*nxBorder+1, rc.top+1, ETO_CLIPPED, ! 637: &rc, ach, len, NULL); ! 638: ! 639: SetTextColor(ps.hdc, RGB(255,255,255)); ! 640: if (hFont) ! 641: hOldFont = SelectObject(ps.hdc, hFont); ! 642: ExtTextOut(ps.hdc, rc.left+2*nxBorder, rc.top, ETO_CLIPPED, ! 643: &rc, ach, len, NULL); 1.1 root 644: 1.1.1.3 ! root 645: SetBkMode(ps.hdc, OPAQUE); 1.1 root 646: 1.1.1.3 ! root 647: if (hOldFont) ! 648: SelectObject(ps.hdc, hOldFont); 1.1 root 649: 650: EndPaint(hwnd, &ps); 651: return 0L; 652: } 653: } 654: return DefWindowProc(hwnd, message, wParam, lParam); 655: } 656: 657: VOID vTest(PINFO pInfo) 658: { 659: OutputDebugString("Inside vTest()\n"); 660: 661: UNREFERENCED_PARAMETER(pInfo); 662: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.