ReactOS  0.4.14-dev-293-g2b39b42
progman.h
Go to the documentation of this file.
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 /*
23  * PROJECT: ReactOS Program Manager
24  * COPYRIGHT: GPL - See COPYING in the top level directory
25  * FILE: base/shell/progman/progman.h
26  * PURPOSE: ProgMan header
27  * PROGRAMMERS: Ulrich Schmid
28  * Sylvain Petreolle
29  * Hermes Belusca-Maito (hermes.belusca@sfr.fr)
30  */
31 
32 #ifndef PROGMAN_H
33 #define PROGMAN_H
34 
35 #include <stdio.h>
36 #include <stdlib.h>
37 
38 #define WIN32_NO_STATUS
39 #include <windef.h>
40 #include <winbase.h>
41 #include <winreg.h>
42 #include <wingdi.h>
43 #include <winuser.h>
44 
45 #include <shellapi.h>
46 
47 #include <commctrl.h>
48 #include <richedit.h>
49 
50 #include <windowsx.h>
51 #include <strsafe.h>
52 
53 #define MAX_STRING_LEN 255
54 #define MAX_PATHNAME_LEN 1024
55 #define MAX_LANGUAGE_NUMBER (PM_LAST_LANGUAGE - PM_FIRST_LANGUAGE)
56 
57 #include "resource.h"
58 
59 /* Fallback icon */
60 #define DEFAULTICON OIC_WINLOGO
61 
62 #define DEF_GROUP_WIN_XPOS 100
63 #define DEF_GROUP_WIN_YPOS 100
64 #define DEF_GROUP_WIN_WIDTH 300
65 #define DEF_GROUP_WIN_HEIGHT 200
66 
67 
68 /*
69  * windowsx.h extensions
70  */
71 #define EnableDlgItem(hDlg, nID, bEnable) \
72  EnableWindow(GetDlgItem((hDlg), (nID)), (bEnable))
73 
74 
75 
76 
77 
78 typedef struct _PROGRAM PROGRAM, *PPROGRAM;
79 typedef struct _PROGGROUP PROGGROUP, *PPROGGROUP;
80 
81 struct _PROGRAM
82 {
87 
89  INT x;
90  INT y;
96  LPWSTR hWorkDir; /* Extension 0x8101 */
97  INT nHotKey; /* Extension 0x8102 */
98  INT nCmdShow; /* Extension 0x8103 */
99  BOOL bNewVDM; /* Extension 0x8104 */
100 
103 }; // PROGRAM, *PPROGRAM;
104 
105 typedef enum _GROUPFORMAT
106 {
107  Win_311 = 0x0,
108  NT_Ansi = 0x1, // 0x02
109  NT_Unicode = 0x2, // 0x03
110 } GROUPFORMAT;
111 
113 {
117 
124 
127  // BOOL bFileNameModified;
141 
144 }; // PROGGROUP, *PPROGGROUP;
145 
146 
147 typedef struct _GLOBALS
148 {
150  HACCEL hAccel;
155  // HICON hGroupIcon;
163 
172 
178  // int field_74;
179  // int field_78;
180  // PROGGROUP* field_79;
181 } GLOBALS, *PGLOBALS;
182 
183 extern GLOBALS Globals;
184 extern WCHAR szTitle[256];
185 
186 
187 /*
188  * Memory management functions
189  */
190 PVOID
192  IN SIZE_T dwBytes);
193 
194 BOOL
195 Free(IN PVOID lpMem);
196 
197 PVOID
199  IN PVOID lpMem,
200  IN SIZE_T dwBytes);
201 
202 PVOID
204  IN PSIZE_T pdwBufferSize,
205  IN PVOID pData,
206  IN SIZE_T dwDataSize);
207 
208 
209 INT MAIN_MessageBoxIDS(UINT ids_text, UINT ids_title, WORD type);
210 INT MAIN_MessageBoxIDS_s(UINT ids_text, LPCWSTR str, UINT ids_title, WORD type);
212 
213 DWORD GRPFILE_ReadGroupFile(LPCWSTR lpszPath, BOOL bIsCommonGroup);
215 
217 PROGGROUP* GROUP_AddGroup(GROUPFORMAT format, BOOL bIsCommonGroup, LPCWSTR lpszName, LPCWSTR lpszGrpFile,
218  INT left, INT top, INT right, INT bottom, INT xMin, INT yMin, INT nCmdShow,
219  WORD cxIcon, WORD cyIcon, BOOL bOverwriteFileOk,
220  /* FIXME shouldn't be necessary */
221  BOOL bSuppressShowWindow);
222 VOID GROUP_NewGroup(GROUPFORMAT format, BOOL bIsCommonGroup);
225 /* FIXME shouldn't be necessary */
228 
230  INT x, INT y, LPCWSTR lpszCmdLine, LPCWSTR lpszIconFile, INT nIconIndex,
231  LPCWSTR lpszWorkDir, INT nHotKey, INT nCmdShow, BOOL bNewVDM);
234 VOID PROGRAM_CopyMoveProgram(PROGRAM* hProgram, BOOL bMove);
235 VOID PROGRAM_DeleteProgram(PROGRAM* hProgram, BOOL bUpdateGrpFile);
238 
239 BOOL DIALOG_New(INT nDefault, PINT pnResult);
240 PROGGROUP* DIALOG_CopyMove(PROGRAM* hProgram, BOOL bMove);
241 BOOL DIALOG_Delete(UINT ids_text_s, LPCWSTR lpszName);
243 BOOL DIALOG_ProgramAttributes(LPWSTR lpszTitle, LPWSTR lpszCmdLine, LPWSTR lpszWorkDir, LPWSTR lpszIconFile,
244  HICON* lphIcon, INT* lpnIconIndex, INT* lpnHotKey, INT* lpnCmdShow, BOOL* lpbNewVDM, INT nSize);
246 
249 
250 /* Class names */
251 #define STRING_MAIN_WIN_CLASS_NAME L"PMMain"
252 #define STRING_GROUP_WIN_CLASS_NAME L"PMGroup"
253 
254 #endif /* PROGMAN_H */
VOID MAIN_ReplaceString(LPWSTR *string, LPWSTR replace)
Definition: main.c:1192
#define IN
Definition: typedefs.h:38
static HICON
Definition: imagelist.c:84
HICON hMainIcon
Definition: progman.h:154
VOID PROGRAM_CopyMoveProgram(PROGRAM *hProgram, BOOL bMove)
Definition: program.c:236
PROGRAM * hNext
Definition: progman.h:85
PROGRAM * PROGRAM_ActiveProgram(PROGGROUP *hGroup)
Definition: program.c:331
HWND hMainWnd
Definition: progman.h:151
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
POINT ptStart
Definition: progman.h:122
SIZE_T TagsSize
Definition: progman.h:101
INT seqnum
Definition: progman.h:130
WORD ATOM
Definition: dimm.idl:113
PROGGROUP * hActiveGroup
Definition: progman.h:177
BOOL bDragging
Definition: progman.h:123
LPWSTR hIconFile
Definition: progman.h:95
INT icony
Definition: progman.h:137
INT height
Definition: progman.h:135
*nSize LPSTR _Inout_ LPDWORD nSize
Definition: winbase.h:2031
PROGGROUP * hPrior
Definition: progman.h:114
HMENU hFileMenu
Definition: progman.h:159
INT iconx
Definition: progman.h:136
VOID STRING_LoadMenus(VOID)
Definition: string.c:41
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
HWND hWnd
Definition: progman.h:116
PVOID Tags
Definition: progman.h:102
ATOM GROUP_RegisterGroupWinClass(VOID)
Definition: group.c:369
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
VOID STRING_LoadStrings(VOID)
Definition: string.c:36
HKEY hKeyProgMan
Definition: progman.h:164
LPWSTR hGrpFile
Definition: progman.h:129
VOID PROGRAM_DeleteProgram(PROGRAM *hProgram, BOOL bUpdateGrpFile)
Definition: program.c:289
int32_t INT
Definition: typedefs.h:56
INT MAIN_MessageBoxIDS(UINT ids_text, UINT ids_title, WORD type)
Definition: main.c:1159
GROUPFORMAT format
Definition: progman.h:125
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
struct _GLOBALS * PGLOBALS
VOID GROUP_ModifyGroup(PROGGROUP *hGroup)
Definition: group.c:596
HWND hWnd
Definition: progman.h:86
ULONG_PTR * PSIZE_T
Definition: typedefs.h:78
enum _GROUPFORMAT GROUPFORMAT
unsigned int BOOL
Definition: ntddk_ex.h:94
LPWSTR hCmdLine
Definition: progman.h:94
BOOL DIALOG_ProgramAttributes(LPWSTR lpszTitle, LPWSTR lpszCmdLine, LPWSTR lpszWorkDir, LPWSTR lpszIconFile, HICON *lphIcon, INT *lpnIconIndex, INT *lpnHotKey, INT *lpnCmdShow, BOOL *lpbNewVDM, INT nSize)
Definition: dialog.c:864
SIZE_T TagsSize
Definition: progman.h:142
LPWSTR hName
Definition: progman.h:138
BOOL DIALOG_New(INT nDefault, PINT pnResult)
Definition: dialog.c:233
HKEY hKeyPMAnsiGroups
Definition: progman.h:167
VOID PROGRAM_ExecuteProgram(PROGRAM *hProgram)
Definition: program.c:274
const WCHAR * str
PROGGROUP * GROUP_ActiveGroup(VOID)
Definition: group.c:671
PROGRAM * PROGRAM_AddProgram(PROGGROUP *hGroup, HICON hIcon, LPCWSTR lpszName, INT x, INT y, LPCWSTR lpszCmdLine, LPCWSTR lpszIconFile, INT nIconIndex, LPCWSTR lpszWorkDir, INT nHotKey, INT nCmdShow, BOOL bNewVDM)
Definition: program.c:157
PROGGROUP * hNext
Definition: progman.h:115
PVOID pBuffer
PVOID Alloc(IN DWORD dwFlags, IN SIZE_T dwBytes)
Definition: main.c:63
GLint GLint bottom
Definition: glext.h:7726
PROGGROUP * hGroups
Definition: progman.h:176
INT iItem
Definition: progman.h:88
HKEY hKeyAnsiGroups
Definition: progman.h:169
HINSTANCE hInstance
Definition: progman.h:149
BOOL DIALOG_GroupAttributes(GROUPFORMAT format, LPWSTR lpszTitle, LPWSTR lpszGrpFile, INT nSize)
Definition: dialog.c:484
BOOL DIALOG_Delete(UINT ids_text_s, LPCWSTR lpszName)
Definition: dialog.c:361
INT replace(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], DWORD dwFlags, BOOL *doMore)
Definition: replace.c:47
struct _PROGRAM * PPROGRAM
Definition: progman.h:78
HMENU hLanguageMenu
Definition: progman.h:162
int * PINT
Definition: windef.h:177
LPWSTR hWorkDir
Definition: progman.h:96
BOOL bMinOnRun
Definition: progman.h:175
HMENU hOptionMenu
Definition: progman.h:160
__wchar_t WCHAR
Definition: xmlstorage.h:180
HICON hOldCursor
Definition: progman.h:121
HICON hDefaultIcon
Definition: progman.h:153
INT nCmdShow
Definition: progman.h:98
struct _PROGGROUP * PPROGGROUP
Definition: progman.h:79
unsigned short WORD
Definition: ntddk_ex.h:93
VOID GROUP_ShowGroupWindow(PROGGROUP *hGroup)
Definition: group.c:660
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint left
Definition: glext.h:7726
HMENU hWindowsMenu
Definition: progman.h:161
HMENU hMainMenu
Definition: progman.h:158
BOOL bSaveSettings
Definition: progman.h:174
GLdouble GLdouble right
Definition: glext.h:10859
VOID DIALOG_Execute(VOID)
Definition: dialog.c:1021
VOID GROUP_NewGroup(GROUPFORMAT format, BOOL bIsCommonGroup)
Definition: group.c:392
WCHAR szTitle[256]
Definition: magnifier.c:35
INT y
Definition: progman.h:90
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
PROGGROUP * DIALOG_CopyMove(PROGRAM *hProgram, BOOL bMove)
Definition: dialog.c:343
INT width
Definition: progman.h:134
PVOID ReAlloc(IN DWORD dwFlags, IN PVOID lpMem, IN SIZE_T dwBytes)
Definition: main.c:76
INT nHotKey
Definition: progman.h:97
_GROUPFORMAT
Definition: progman.h:105
HKEY hKeyPMUnicodeGroups
Definition: progman.h:168
HWND hMDIWnd
Definition: progman.h:152
ULONG_PTR SIZE_T
Definition: typedefs.h:78
HIMAGELIST hDragImageList
Definition: progman.h:120
PROGRAM * hActiveProgram
Definition: progman.h:140
HWND hListView
Definition: progman.h:118
HICON hPersonalGroupIcon
Definition: progman.h:156
HICON hIcon
Definition: msconfig.c:44
HKEY hKeyPMSettings
Definition: progman.h:165
LPWSTR hName
Definition: progman.h:93
INT nCmdShow
Definition: progman.h:131
BOOL GRPFILE_WriteGroupFile(PROGGROUP *hGroup)
Definition: grpfile.c:358
VOID PROGRAM_ModifyProgram(PROGRAM *hProgram)
Definition: program.c:116
struct _GLOBALS GLOBALS
unsigned int UINT
Definition: ndis.h:50
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLOBALS Globals
Definition: clipbrd.c:13
HACCEL hAccel
Definition: progman.h:150
PROGGROUP * hGroup
Definition: progman.h:83
HKEY hKeyCommonGroups
Definition: progman.h:171
HIMAGELIST hListLarge
Definition: progman.h:119
BOOL bIsCommonGroup
Definition: progman.h:126
DWORD GRPFILE_ReadGroupFile(LPCWSTR lpszPath, BOOL bIsCommonGroup)
Definition: grpfile.c:65
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859
PVOID Tags
Definition: progman.h:143
VOID PROGRAM_NewProgram(PROGGROUP *hGroup)
Definition: program.c:80
HICON hIcon
Definition: progman.h:92
WCHAR * LPWSTR
Definition: xmlstorage.h:184
BOOL bOverwriteFileOk
Definition: progman.h:128
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1827
PVOID AppendToBuffer(IN PVOID pBuffer, IN PSIZE_T pdwBufferSize, IN PVOID pData, IN SIZE_T dwDataSize)
Definition: main.c:84
HKEY hKeyUnicodeGroups
Definition: progman.h:170
INT x
Definition: progman.h:89
INT nIconIndex
Definition: progman.h:91
PROGRAM * hPrograms
Definition: progman.h:139
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
HICON hCommonGroupIcon
Definition: progman.h:157
VOID GROUP_DeleteGroup(PROGGROUP *hGroup)
Definition: group.c:627
HKEY hKeyPMCommonGroups
Definition: progman.h:166
BOOL Free(IN PVOID lpMem)
Definition: main.c:70
PROGGROUP * GROUP_AddGroup(GROUPFORMAT format, BOOL bIsCommonGroup, LPCWSTR lpszName, LPCWSTR lpszGrpFile, INT left, INT top, INT right, INT bottom, INT xMin, INT yMin, INT nCmdShow, WORD cxIcon, WORD cyIcon, BOOL bOverwriteFileOk, BOOL bSuppressShowWindow)
Definition: group.c:435
PROGRAM * hPrior
Definition: progman.h:84
BOOL bAutoArrange
Definition: progman.h:173
BOOL bNewVDM
Definition: progman.h:99
INT MAIN_MessageBoxIDS_s(UINT ids_text, LPCWSTR str, UINT ids_title, WORD type)
Definition: main.c:1174