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.

105 lines
2.0 KiB

  1. //
  2. // ALERT.C Application installation wizard CPL
  3. //
  4. // Copyright (C) Microsoft, 1994,1995 All Rights Reserved.
  5. //
  6. // History:
  7. // ravir 05/01/95
  8. //
  9. #include "alertpg.h"
  10. #include <cpl.h>
  11. HINSTANCE hInst = NULL;
  12. BOOL APIENTRY LibMain(HANDLE hDll, DWORD dwReason, LPVOID lpReserved)
  13. {
  14. if (dwReason == DLL_PROCESS_ATTACH)
  15. {
  16. hInst = hDll;
  17. }
  18. return TRUE;
  19. }
  20. LONG CALLBACK CPlApplet(HWND hwnd, UINT Msg, LPARAM lParam1, LPARAM lParam2 )
  21. {
  22. UINT nStartPage;
  23. LPTSTR lpStartPage;
  24. switch (Msg)
  25. {
  26. case CPL_INIT:
  27. return TRUE;
  28. case CPL_GETCOUNT:
  29. return 1;
  30. case CPL_INQUIRE:
  31. #define lpCPlInfo ((LPCPLINFO)lParam2)
  32. lpCPlInfo->idIcon = IDI_ALERTICON;
  33. lpCPlInfo->idName = IDS_NAME;
  34. lpCPlInfo->idInfo = IDS_INFO;
  35. lpCPlInfo->lData = 0;
  36. #undef lpCPlInfo
  37. break;
  38. case CPL_DBLCLK:
  39. case CPL_STARTWPARMS:
  40. return LoadComputerObjectAlertPage(hwnd);
  41. default:
  42. return FALSE;
  43. }
  44. return TRUE;
  45. } // CPlApplet
  46. BOOL LoadComputerObjectAlertPage(HWND hwnd)
  47. {
  48. PASLOADCOMPUTEROBJECTALERTPAGE pfunc = NULL;
  49. HINSTANCE hInst = NULL;
  50. hInst = LoadLibrary(TEXT("alertsys.dll"));
  51. if (hInst == NULL)
  52. {
  53. #ifdef DEBUG
  54. ShellMessageBox(hInst, hwnd, TEXT("LoadLibrary"), NULL,
  55. MB_OK | MB_ICONEXCLAMATION,
  56. TEXT("Failed to load library alertsys.dll. (%d)"),
  57. GetLastError());
  58. #endif
  59. return FALSE;
  60. }
  61. pfunc = (PASLOADCOMPUTEROBJECTALERTPAGE)GetProcAddress(
  62. (HMODULE)hInst, "AsLoadComputerObjectAlertPage");
  63. if (pfunc != NULL)
  64. {
  65. pfunc(hwnd);
  66. }
  67. else
  68. {
  69. #ifdef DEBUG
  70. ShellMessageBox(hInst, hwnd, TEXT("GetProcAddress"), NULL,
  71. MB_OK | MB_ICONEXCLAMATION,
  72. TEXT("Failed to get AsLoadComputerObjectAlertPage's address. (%d)"),
  73. GetLastError());
  74. #endif
  75. return FALSE;
  76. }
  77. return TRUE;
  78. }