Leaked source code of windows server 2003
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.

140 lines
2.8 KiB

  1. /*******************************************************************************
  2. *
  3. * (C) COPYRIGHT MICROSOFT CORP., 2000
  4. *
  5. * TITLE: Firstpg.cpp
  6. *
  7. * VERSION: 1.0
  8. *
  9. * AUTHOR: KeisukeT
  10. *
  11. * DATE: 27 Mar, 2000
  12. *
  13. * DESCRIPTION:
  14. * First page of WIA class installer.
  15. *
  16. *******************************************************************************/
  17. //
  18. // Precompiled header
  19. //
  20. #include "precomp.h"
  21. #pragma hdrstop
  22. //
  23. // Include
  24. //
  25. #include "firstpg.h"
  26. //
  27. // Function
  28. //
  29. CFirstPage::CFirstPage(PINSTALLER_CONTEXT pInstallerContext) :
  30. CInstallWizardPage(pInstallerContext, IDD_DYNAWIZ_FIRSTPAGE)
  31. {
  32. //
  33. // Set link to previous/next page.
  34. //
  35. m_uPreviousPage = 0;
  36. m_uNextPage = IDD_DYNAWIZ_SELECTDEV_PAGE;
  37. //
  38. // See if this page shuld be skipped.
  39. //
  40. m_bShowThisPage = pInstallerContext->bShowFirstPage;
  41. }
  42. BOOL
  43. CFirstPage::OnInit()
  44. {
  45. HFONT hFont;
  46. HICON hIcon;
  47. //
  48. // Initialize locals.
  49. //
  50. hFont = NULL;
  51. hIcon = NULL;
  52. //
  53. // Change icon if it's invoked from S&C folder.
  54. //
  55. if(m_bShowThisPage){
  56. hIcon = ::LoadIcon(g_hDllInstance, MAKEINTRESOURCE(ImageIcon));
  57. if(NULL != hIcon){
  58. SendMessage(m_hwndWizard, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
  59. SendMessage(m_hwndWizard, WM_SETICON, ICON_SMALL, (LPARAM)hIcon);
  60. } // if(NULL != hIcon)
  61. } // if(m_bShowThisPage)
  62. //
  63. // Enable "NEXT" button, disable "Back" button.
  64. //
  65. SendMessage(m_hwndWizard, PSM_SETWIZBUTTONS, 0, PSWIZB_NEXT);
  66. //
  67. // Set font of title.
  68. //
  69. hFont = GetIntroFont(m_hwndWizard);
  70. if( hFont ){
  71. HWND hwndControl = GetDlgItem(m_hwnd, WelcomeMessage);
  72. if( hwndControl ){
  73. SetWindowFont(hwndControl, hFont, TRUE);
  74. } // if( hwndControl )
  75. } // if( hFont )
  76. return TRUE;
  77. }
  78. //
  79. // This page is a NOP...return -1 to activate the Next or Previous page.
  80. //
  81. BOOL
  82. CFirstPage::OnNotify(
  83. LPNMHDR lpnmh
  84. )
  85. {
  86. if (lpnmh->code == PSN_SETACTIVE) {
  87. TCHAR szTitle[MAX_PATH] = {TEXT('\0')};
  88. //
  89. // Set Window title.
  90. //
  91. if(0 != ::LoadString(g_hDllInstance, MessageTitle, szTitle, MAX_PATH)){
  92. PropSheet_SetTitle(m_hwndWizard ,0 , szTitle);
  93. } // if(0 != ::LoadString(m_DllHandle, 0, szTitle, MAX_PATH)
  94. if(!m_bShowThisPage){
  95. //
  96. // Jump to device seleciton page.
  97. //
  98. SetWindowLongPtr(m_hwnd, DWLP_MSGRESULT, IDD_DYNAWIZ_SELECTDEV_PAGE);
  99. return TRUE;
  100. } // if(!m_bShowThisPage)
  101. } // if (lpnmh->code == PSN_SETACTIVE)
  102. return FALSE;
  103. }