dialog.cpp
Upload User: xhy777
Upload Date: 2007-02-14
Package Size: 24088k
Code Size: 1k
Category:

Windows Kernel

Development Platform:

Visual C++

  1. #include "stdafx.h"
  2. #include "dialog.h"
  3. INT_PTR CPropertyPage::StaticProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
  4. {
  5.     CPropertyPage* pthis = (CPropertyPage*) GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
  6.     PROPSHEETPAGE* ppage;
  7.     INT_PTR fProcessed;
  8.     if (uMsg == WM_INITDIALOG)
  9.     {
  10.         ppage = (PROPSHEETPAGE*) lParam;
  11.         pthis = (CPropertyPage*) ppage->lParam;
  12.         SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR) pthis); 
  13.     }
  14.     if (pthis != NULL)
  15.     {
  16.         fProcessed = pthis->DialogProc(hwndDlg, uMsg, wParam, lParam);
  17.     }
  18.     else
  19.     {
  20.         fProcessed = FALSE;
  21.     }
  22.     return fProcessed;
  23. }
  24. INT_PTR CDialog::StaticProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
  25. {
  26.     CDialog* pthis = (CDialog*) GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
  27.     INT_PTR fProcessed;
  28.     if (uMsg == WM_INITDIALOG)
  29.     {
  30.         pthis = (CDialog*) lParam;
  31.         SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR) pthis); 
  32.     }
  33.     if (pthis != NULL)
  34.     {
  35.         fProcessed = pthis->DialogProc(hwndDlg, uMsg, wParam, lParam);
  36.     }
  37.     else
  38.     {
  39.         fProcessed = FALSE;
  40.     }
  41.     return fProcessed;
  42. }