Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

98 lines
2.4 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. dialogs.c
  5. Abstract:
  6. This file implements the dialog proc for the tapi
  7. device status page.
  8. Environment:
  9. WIN32 User Mode
  10. Author:
  11. Wesley Witt (wesw) 17-Feb-1996
  12. --*/
  13. #include "wizard.h"
  14. #pragma hdrstop
  15. LRESULT
  16. DeviceStatusDlgProc(
  17. HWND hwnd,
  18. UINT msg,
  19. WPARAM wParam,
  20. LPARAM lParam
  21. )
  22. {
  23. static BOOL OkToProceed = FALSE;
  24. static HANDLE hThread;
  25. DWORD ThreadId;
  26. switch( msg ) {
  27. case WM_INITDIALOG:
  28. SetWindowText( GetDlgItem( hwnd, IDC_DEVICEINIT_LABEL01 ), GetString(IDS_DEVICEINIT_LABEL01) );
  29. break;
  30. case WM_MY_PROGRESS:
  31. if (wParam == 0xff) {
  32. SendDlgItemMessage( hwnd, IDC_DEVICE_PROGRESS, PBM_SETRANGE, 0, MAKELPARAM(0,(lParam)));
  33. SendDlgItemMessage( hwnd, IDC_DEVICE_PROGRESS, PBM_SETSTEP, 1, 0 );
  34. } else {
  35. SendDlgItemMessage( hwnd, IDC_DEVICE_PROGRESS, PBM_DELTAPOS, wParam, 0 );
  36. }
  37. break;
  38. case WM_NOTIFY:
  39. switch( ((LPNMHDR)lParam)->code ) {
  40. case PSN_SETACTIVE:
  41. StopFaxService();
  42. if (InstallMode != INSTALL_NEW) {
  43. SetWindowLong( hwnd, DWL_MSGRESULT, -1 );
  44. return TRUE;
  45. }
  46. if (Unattended) {
  47. DeviceInitThread( hwnd );
  48. SetWindowLong( hwnd, DWL_MSGRESULT, -1 );
  49. return TRUE;
  50. } else {
  51. hThread = CreateThread(
  52. NULL,
  53. 0,
  54. (LPTHREAD_START_ROUTINE) DeviceInitThread,
  55. hwnd,
  56. 0,
  57. &ThreadId
  58. );
  59. if (hThread) {
  60. SetWindowLong( hwnd, DWL_MSGRESULT, -1 );
  61. PropSheet_SetWizButtons( GetParent(hwnd), 0 );
  62. return FALSE;
  63. } else {
  64. //
  65. // popup an error
  66. //
  67. }
  68. }
  69. break;
  70. }
  71. break;
  72. }
  73. return FALSE;
  74. }