string.c 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * Program Manager
  3. *
  4. * Copyright 1996 Ulrich Schmid
  5. * Copyright 2002 Sylvain Petreolle
  6. *
  7. * This library is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU Lesser General Public
  9. * License as published by the Free Software Foundation; either
  10. * version 2.1 of the License, or (at your option) any later version.
  11. *
  12. * This library is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Lesser General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General Public
  18. * License along with this library; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  20. */
  21. #define WIN32_LEAN_AND_MEAN
  22. #include "windows.h"
  23. #include "progman.h"
  24. /* Class names */
  25. const WCHAR STRING_MAIN_WIN_CLASS_NAME[] = L"PMMain";
  26. const WCHAR STRING_MDI_WIN_CLASS_NAME[] = L"MDICLIENT";
  27. const WCHAR STRING_GROUP_WIN_CLASS_NAME[] = L"PMGroup";
  28. const WCHAR STRING_PROGRAM_WIN_CLASS_NAME[] = L"PMProgram";
  29. VOID STRING_LoadMenus(VOID)
  30. {
  31. CHAR caption[MAX_STRING_LEN];
  32. HMENU hMainMenu;
  33. /* Set frame caption */
  34. LoadStringA(Globals.hInstance, IDS_PROGRAM_MANAGER, caption, sizeof(caption));
  35. SetWindowTextA(Globals.hMainWnd, caption);
  36. /* Create menu */
  37. hMainMenu = LoadMenuW(Globals.hInstance, MAKEINTRESOURCEW(MAIN_MENU));
  38. Globals.hFileMenu = GetSubMenu(hMainMenu, 0);
  39. Globals.hOptionMenu = GetSubMenu(hMainMenu, 1);
  40. Globals.hWindowsMenu = GetSubMenu(hMainMenu, 2);
  41. Globals.hLanguageMenu = GetSubMenu(hMainMenu, 3);
  42. if (Globals.hMDIWnd)
  43. SendMessageW(Globals.hMDIWnd, WM_MDISETMENU,
  44. (WPARAM) hMainMenu,
  45. (LPARAM) Globals.hWindowsMenu);
  46. else SetMenu(Globals.hMainWnd, hMainMenu);
  47. /* Destroy old menu */
  48. if (Globals.hMainMenu) DestroyMenu(Globals.hMainMenu);
  49. Globals.hMainMenu = hMainMenu;
  50. }