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.

129 lines
2.9 KiB

  1. /*++
  2. Copyright (c) 1994-1998, Microsoft Corporation All rights reserved.
  3. Module Name:
  4. mouse.c
  5. Abstract:
  6. This module contains the routines for the "fake" applets.
  7. Revision History:
  8. --*/
  9. //
  10. // Include Files.
  11. //
  12. #include "main.h"
  13. #include "rc.h"
  14. #include "applet.h"
  15. //
  16. // From shell\inc\shsemip.h
  17. //
  18. #define ARRAYSIZE(a) (sizeof(a)/sizeof(a[0]))
  19. //
  20. // From shelldll\help.c.
  21. //
  22. VOID WINAPI SHHelpShortcuts_RunDLL( HWND, HINSTANCE, LPCSTR, int );
  23. VOID WINAPI SHHelpShortcuts_RunDLLW( HWND, HINSTANCE, LPCWSTR, int );
  24. static const TCHAR c_szPrintersFolder[] = TEXT("PrintersFolder");
  25. static const TCHAR c_szFontsFolder[] = TEXT("FontsFolder");
  26. ////////////////////////////////////////////////////////////////////////////
  27. //
  28. // PrintApplet
  29. //
  30. ////////////////////////////////////////////////////////////////////////////
  31. int PrintApplet(
  32. HINSTANCE instance,
  33. HWND parent,
  34. LPCTSTR cmdline)
  35. {
  36. #ifdef UNICODE
  37. SHHelpShortcuts_RunDLLW( NULL,
  38. GetModuleHandle(NULL),
  39. c_szPrintersFolder,
  40. SW_SHOWNORMAL );
  41. #else
  42. SHHelpShortcuts_RunDLL( NULL,
  43. GetModuleHandle(NULL),
  44. c_szPrintersFolder,
  45. SW_SHOWNORMAL );
  46. #endif
  47. return (0);
  48. }
  49. ////////////////////////////////////////////////////////////////////////////
  50. //
  51. // FontsApplet
  52. //
  53. ////////////////////////////////////////////////////////////////////////////
  54. int FontsApplet(
  55. HINSTANCE instance,
  56. HWND parent,
  57. LPCTSTR cmdline)
  58. {
  59. #ifdef UNICODE
  60. SHHelpShortcuts_RunDLLW( NULL,
  61. GetModuleHandle(NULL),
  62. c_szFontsFolder,
  63. SW_SHOWNORMAL );
  64. #else
  65. SHHelpShortcuts_RunDLL( NULL,
  66. GetModuleHandle(NULL),
  67. c_szFontsFolder,
  68. SW_SHOWNORMAL );
  69. #endif
  70. return (0);
  71. }
  72. ////////////////////////////////////////////////////////////////////////////
  73. //
  74. // AdmApplet
  75. //
  76. ////////////////////////////////////////////////////////////////////////////
  77. int AdmApplet(
  78. HINSTANCE instance,
  79. HWND parent,
  80. LPCTSTR cmdline)
  81. {
  82. TCHAR szPath[MAX_PATH];
  83. TCHAR szAdminTools[MAX_PATH];
  84. if ( !SHGetSpecialFolderPath(parent, szPath, CSIDL_COMMON_PROGRAMS, 0) )
  85. return 1;
  86. // load the string for the tools folder, then path combine the two so that
  87. // we can open that directory.
  88. if ( !LoadString(instance, IDS_ADM_TITLE, szAdminTools, ARRAYSIZE(szAdminTools)) )
  89. return 1;
  90. //+1 for backslash and +1 for '\0'
  91. if ( (lstrlen(szPath)+lstrlen(szAdminTools)+1+1) > ARRAYSIZE(szPath) )
  92. return 1;
  93. PathCombine(szPath, szPath, szAdminTools);
  94. ShellExecute(parent, NULL, szPath, NULL, NULL, SW_SHOWDEFAULT);
  95. return (0);
  96. }