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.

78 lines
1.9 KiB

  1. ////////////////////////////////////////////////////////////////////////////////
  2. //
  3. // File: Menu.cpp
  4. // Created: Jan 1996
  5. // By: Martin Holladay (a-martih) and Ryan Marshall (a-ryanm)
  6. //
  7. // Project: Resource Kit Desktop Switcher
  8. //
  9. // Main Functions:
  10. // PopupDesktopMenu() - Desktop/Button popup menu
  11. // PopupMainMenu(HWND hBtn, UINT x, UINT y)
  12. //
  13. // Misc. Functions (helpers)
  14. // GetPopupLocation() - returns POINT to popup a btn menu at
  15. //
  16. ////////////////////////////////////////////////////////////////////////////////
  17. #include <windows.h>
  18. #include <assert.h>
  19. #include <string.h>
  20. #include <shellapi.h>
  21. #include "DeskSpc.h"
  22. #include "Desktop.h"
  23. #include "Resource.h"
  24. #include "User.h"
  25. extern APPVARS AppMember;
  26. /*------------------------------------------------------------------------------*/
  27. /*------------------------------------------------------------------------------*/
  28. HMENU CreateListviewPopupMenu(VOID)
  29. {
  30. HMENU hFileMenu;
  31. CHAR szTitle[MAX_TITLELEN+1];
  32. //
  33. // Create the File Menus
  34. //
  35. hFileMenu = CreatePopupMenu();
  36. if (!hFileMenu) {
  37. return NULL;
  38. }
  39. LoadString(AppMember.hInstance, IDS_ADD_DESKTOP, szTitle, MAX_TITLELEN);
  40. if (!AppendMenu(hFileMenu, MF_STRING, (UINT) IDM_NEW_DESKTOP, szTitle)) {
  41. DestroyMenu(hFileMenu);
  42. return NULL;
  43. }
  44. AppendMenu(hFileMenu, MF_SEPARATOR, 0, NULL);
  45. LoadString(AppMember.hInstance, IDS_DELETE_DESKTOP, szTitle, MAX_TITLELEN);
  46. if (!AppendMenu(hFileMenu, MF_STRING, (UINT) IDM_DELETE_DESKTOP, szTitle)) {
  47. DestroyMenu(hFileMenu);
  48. return NULL;
  49. }
  50. AppendMenu(hFileMenu, MF_SEPARATOR, 0, NULL);
  51. LoadString(AppMember.hInstance, IDS_PROPERTIES, szTitle, MAX_TITLELEN);
  52. if (!AppendMenu(hFileMenu, MF_STRING, (UINT) IDM_DESKTOP_PROPERTIES, szTitle)) {
  53. DestroyMenu(hFileMenu);
  54. return NULL;
  55. }
  56. return hFileMenu;
  57. }
  58. /*------------------------------------------------------------------------------*/
  59. /*------------------------------------------------------------------------------*/