Create the AHCI branch for Aman's work
[reactos.git] / base / shell / progman / string.c
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
22 #include "progman.h"
23
24 /* Class names */
25
26 WCHAR STRING_MAIN_WIN_CLASS_NAME[] = {'P','M','M','a','i','n',0};
27 WCHAR STRING_MDI_WIN_CLASS_NAME[] = {'M','D','I','C','L','I','E','N','T',0};
28 WCHAR STRING_GROUP_WIN_CLASS_NAME[] = {'P','M','G','r','o','u','p',0};
29 WCHAR STRING_PROGRAM_WIN_CLASS_NAME[] = {'P','M','P','r','o','g','r','a','m',0};
30
31 VOID STRING_LoadMenus(VOID)
32 {
33 #ifdef __REACTOS__
34 WCHAR caption[MAX_STRING_LEN];
35 #else
36 CHAR caption[MAX_STRING_LEN];
37 #endif
38 HMENU hMainMenu;
39
40 /* Set frame caption */
41 #ifdef __REACTOS__
42 LoadStringW(Globals.hInstance, IDS_PROGRAM_MANAGER, caption, sizeof(caption));
43 SetWindowTextW(Globals.hMainWnd, caption);
44 #else
45 LoadStringA(Globals.hInstance, IDS_PROGRAM_MANAGER, caption, sizeof(caption));
46 SetWindowTextA(Globals.hMainWnd, caption);
47 #endif
48
49 /* Create menu */
50 hMainMenu = LoadMenuW(Globals.hInstance, MAKEINTRESOURCEW(MAIN_MENU));
51 Globals.hFileMenu = GetSubMenu(hMainMenu, 0);
52 Globals.hOptionMenu = GetSubMenu(hMainMenu, 1);
53 Globals.hWindowsMenu = GetSubMenu(hMainMenu, 2);
54 Globals.hLanguageMenu = GetSubMenu(hMainMenu, 3);
55
56 if (Globals.hMDIWnd)
57 SendMessageW(Globals.hMDIWnd, WM_MDISETMENU,
58 (WPARAM) hMainMenu,
59 (LPARAM) Globals.hWindowsMenu);
60 else SetMenu(Globals.hMainWnd, hMainMenu);
61
62 /* Destroy old menu */
63 if (Globals.hMainMenu) DestroyMenu(Globals.hMainMenu);
64 Globals.hMainMenu = hMainMenu;
65 }