mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
[PROGMAN]: Commit 90% of the work I did on progman since its first inclusion in ReactOS: this concerns upgrading its user interface code from Wine's Win3.11-compatible code to WinNT-compatible code.
As this is *recovered* code from what I had in my local trunk before my HDD crash that occurred last month, this is almost pure code without most of the comments (this especially concerns the MAIN_LoadSettings function). The 10% code that is not restored yet concerns the reader/writer code for program group files, and it will be committed separately later. This (missing) code is the core of progman; without it progrman does nothing interesting apart from displaying its main window (and its utility dialogs). svn path=/trunk/; revision=71317
This commit is contained in:
parent
bae547dcec
commit
6df01a9cb0
13 changed files with 3160 additions and 1436 deletions
|
@ -11,7 +11,7 @@ list(APPEND SOURCE
|
|||
progman.h)
|
||||
|
||||
add_executable(progman ${SOURCE} progman.rc)
|
||||
set_module_type(progman win32gui)
|
||||
add_importlibs(progman advapi32 user32 gdi32 comdlg32 shell32 msvcrt kernel32)
|
||||
set_module_type(progman win32gui UNICODE)
|
||||
add_importlibs(progman advapi32 user32 gdi32 comctl32 comdlg32 shell32 msvcrt kernel32)
|
||||
add_pch(progman progman.h SOURCE)
|
||||
add_cd_file(TARGET progman DESTINATION reactos/system32 FOR all)
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -18,6 +18,15 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
/*
|
||||
* PROJECT: ReactOS Program Manager
|
||||
* COPYRIGHT: GPL - See COPYING in the top level directory
|
||||
* FILE: base/shell/progman/group.c
|
||||
* PURPOSE: Program group files helper functions
|
||||
* PROGRAMMERS: Ulrich Schmid
|
||||
* Hermes Belusca-Maito (hermes.belusca@sfr.fr)
|
||||
*/
|
||||
|
||||
#include "progman.h"
|
||||
|
||||
/***********************************************************************
|
||||
|
@ -25,23 +34,77 @@
|
|||
* GROUP_GroupWndProc
|
||||
*/
|
||||
|
||||
static LRESULT CALLBACK GROUP_GroupWndProc(HWND hWnd, UINT msg,
|
||||
WPARAM wParam, LPARAM lParam)
|
||||
static
|
||||
LRESULT
|
||||
CALLBACK
|
||||
GROUP_GroupWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch (msg)
|
||||
{
|
||||
case WM_SYSCOMMAND:
|
||||
if (wParam == SC_CLOSE) wParam = SC_MINIMIZE;
|
||||
break;
|
||||
PROGGROUP* group;
|
||||
|
||||
case WM_CHILDACTIVATE:
|
||||
case WM_NCLBUTTONDOWN:
|
||||
Globals.hActiveGroup = (HLOCAL)GetWindowLongPtrW(hWnd, 0);
|
||||
EnableMenuItem(Globals.hFileMenu, PM_MOVE , MF_GRAYED);
|
||||
EnableMenuItem(Globals.hFileMenu, PM_COPY , MF_GRAYED);
|
||||
break;
|
||||
group = (PROGGROUP*)GetWindowLongPtrW(hWnd, 0);
|
||||
|
||||
switch (uMsg)
|
||||
{
|
||||
case WM_NCCREATE:
|
||||
{
|
||||
LPCREATESTRUCTW pcs = (LPCREATESTRUCTW)lParam;
|
||||
LPMDICREATESTRUCTW pMDIcs = (LPMDICREATESTRUCTW)pcs->lpCreateParams;
|
||||
group = (PROGGROUP*)pMDIcs->lParam;
|
||||
SetWindowLongPtrW(hWnd, 0, (LONG_PTR)group);
|
||||
|
||||
if (group->bIsCommonGroup)
|
||||
{
|
||||
DefMDIChildProcW(hWnd, WM_SETICON, ICON_BIG,
|
||||
(LPARAM)CopyImage(Globals.hCommonGroupIcon,
|
||||
IMAGE_ICON,
|
||||
GetSystemMetrics(SM_CXICON),
|
||||
GetSystemMetrics(SM_CYICON),
|
||||
LR_COPYFROMRESOURCE));
|
||||
DefMDIChildProcW(hWnd, WM_SETICON, ICON_SMALL,
|
||||
(LPARAM)CopyImage(Globals.hCommonGroupIcon,
|
||||
IMAGE_ICON,
|
||||
GetSystemMetrics(SM_CXSMICON),
|
||||
GetSystemMetrics(SM_CYSMICON),
|
||||
LR_COPYFROMRESOURCE));
|
||||
}
|
||||
else
|
||||
{
|
||||
DefMDIChildProcW(hWnd, WM_SETICON, ICON_BIG,
|
||||
(LPARAM)CopyImage(Globals.hPersonalGroupIcon,
|
||||
IMAGE_ICON,
|
||||
GetSystemMetrics(SM_CXICON),
|
||||
GetSystemMetrics(SM_CYICON),
|
||||
LR_COPYFROMRESOURCE));
|
||||
DefMDIChildProcW(hWnd, WM_SETICON, ICON_SMALL,
|
||||
(LPARAM)CopyImage(Globals.hPersonalGroupIcon,
|
||||
IMAGE_ICON,
|
||||
GetSystemMetrics(SM_CXSMICON),
|
||||
GetSystemMetrics(SM_CYSMICON),
|
||||
LR_COPYFROMRESOURCE));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case WM_NCDESTROY:
|
||||
SetWindowLongPtrW(hWnd, 0, 0);
|
||||
break;
|
||||
|
||||
case WM_CLOSE:
|
||||
SendMessageW(hWnd, WM_SYSCOMMAND, SC_MINIMIZE, 0);
|
||||
break;
|
||||
|
||||
case WM_SYSCOMMAND:
|
||||
if (wParam == SC_CLOSE) wParam = SC_MINIMIZE;
|
||||
break;
|
||||
|
||||
case WM_CHILDACTIVATE:
|
||||
case WM_NCLBUTTONDOWN:
|
||||
Globals.hActiveGroup = (PROGGROUP*)GetWindowLongPtrW(hWnd, 0);
|
||||
Globals.hActiveGroup->hActiveProgram = NULL;
|
||||
break;
|
||||
}
|
||||
return DefMDIChildProcW(hWnd, msg, wParam, lParam);
|
||||
|
||||
return DefMDIChildProcW(hWnd, uMsg, wParam, lParam);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
@ -49,22 +112,22 @@ static LRESULT CALLBACK GROUP_GroupWndProc(HWND hWnd, UINT msg,
|
|||
* GROUP_RegisterGroupWinClass
|
||||
*/
|
||||
|
||||
ATOM GROUP_RegisterGroupWinClass(void)
|
||||
ATOM GROUP_RegisterGroupWinClass(VOID)
|
||||
{
|
||||
WNDCLASSW class;
|
||||
WNDCLASSW wndClass;
|
||||
|
||||
class.style = CS_HREDRAW | CS_VREDRAW;
|
||||
class.lpfnWndProc = GROUP_GroupWndProc;
|
||||
class.cbClsExtra = 0;
|
||||
class.cbWndExtra = sizeof(LONG_PTR);
|
||||
class.hInstance = Globals.hInstance;
|
||||
class.hIcon = LoadIconW (0, (LPWSTR)IDI_WINLOGO);
|
||||
class.hCursor = LoadCursorW (0, (LPWSTR)IDC_ARROW);
|
||||
class.hbrBackground = GetStockObject (WHITE_BRUSH);
|
||||
class.lpszMenuName = 0;
|
||||
class.lpszClassName = STRING_GROUP_WIN_CLASS_NAME;
|
||||
wndClass.style = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW;
|
||||
wndClass.lpfnWndProc = GROUP_GroupWndProc;
|
||||
wndClass.cbClsExtra = 0;
|
||||
wndClass.cbWndExtra = sizeof(LONG_PTR);
|
||||
wndClass.hInstance = Globals.hInstance;
|
||||
wndClass.hIcon = LoadIconW(Globals.hInstance, MAKEINTRESOURCEW(IDI_GROUP_ICON));
|
||||
wndClass.hCursor = LoadCursorW(NULL, MAKEINTRESOURCEW(IDC_ARROW));
|
||||
wndClass.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
|
||||
wndClass.lpszMenuName = NULL;
|
||||
wndClass.lpszClassName = STRING_GROUP_WIN_CLASS_NAME;
|
||||
|
||||
return RegisterClassW(&class);
|
||||
return RegisterClassW(&wndClass);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
@ -72,29 +135,41 @@ ATOM GROUP_RegisterGroupWinClass(void)
|
|||
* GROUP_NewGroup
|
||||
*/
|
||||
|
||||
VOID GROUP_NewGroup(void)
|
||||
VOID GROUP_NewGroup(GROUPFORMAT format, BOOL bIsCommonGroup)
|
||||
{
|
||||
CHAR szName[MAX_PATHNAME_LEN] = "";
|
||||
CHAR szFile[MAX_PATHNAME_LEN] = "";
|
||||
OFSTRUCT dummy;
|
||||
HANDLE hFile;
|
||||
WCHAR szGrpFile[MAX_PATHNAME_LEN] = L"";
|
||||
WCHAR szTitle[MAX_PATHNAME_LEN] = L"";
|
||||
|
||||
if (!DIALOG_GroupAttributes(szName, szFile, MAX_PATHNAME_LEN)) return;
|
||||
// ZeroMemory(szTitle, sizeof(szTitle));
|
||||
// ZeroMemory(szGrpFile, sizeof(szGrpFile));
|
||||
|
||||
if (OpenFile(szFile, &dummy, OF_EXIST) == HFILE_ERROR)
|
||||
if (!DIALOG_GroupAttributes(format, szTitle, szGrpFile, MAX_PATHNAME_LEN))
|
||||
return;
|
||||
|
||||
/*
|
||||
* Just check whether the group file does exist. If it does, close the handle, because GRPFILE_ReadGroupFile will
|
||||
* reopen the file for loading. If it doesn't exist, we create a new one.
|
||||
*/
|
||||
hFile = CreateFileW(szGrpFile, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
if (hFile == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
/* File doesn't exist */
|
||||
HLOCAL hGroup =
|
||||
GROUP_AddGroup(szName, szFile, SW_SHOWNORMAL,
|
||||
DEF_GROUP_WIN_XPOS, DEF_GROUP_WIN_YPOS,
|
||||
DEF_GROUP_WIN_WIDTH, DEF_GROUP_WIN_HEIGHT, 0, 0,
|
||||
FALSE, FALSE, FALSE);
|
||||
if (!hGroup) return;
|
||||
GRPFILE_WriteGroupFile(hGroup);
|
||||
/* File doesn't exist */
|
||||
PROGGROUP* hGroup = GROUP_AddGroup(format, bIsCommonGroup, szTitle, szGrpFile,
|
||||
DEF_GROUP_WIN_XPOS, DEF_GROUP_WIN_YPOS,
|
||||
DEF_GROUP_WIN_XPOS + DEF_GROUP_WIN_WIDTH, DEF_GROUP_WIN_YPOS + DEF_GROUP_WIN_HEIGHT,
|
||||
0, 0, SW_SHOWNORMAL, 0, 0, FALSE, FALSE);
|
||||
if (hGroup)
|
||||
GRPFILE_WriteGroupFile(hGroup);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* File exist */
|
||||
CloseHandle(hFile);
|
||||
GRPFILE_ReadGroupFile(szGrpFile, bIsCommonGroup);
|
||||
}
|
||||
else /* File exist */
|
||||
GRPFILE_ReadGroupFile(szFile);
|
||||
|
||||
/* FIXME Update progman.ini */
|
||||
/* FIXME Update progman.ini */
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
@ -102,121 +177,224 @@ VOID GROUP_NewGroup(void)
|
|||
* GROUP_AddGroup
|
||||
*/
|
||||
|
||||
HLOCAL GROUP_AddGroup(LPCSTR lpszName, LPCSTR lpszGrpFile, INT nCmdShow,
|
||||
INT x, INT y, INT width, INT height,
|
||||
INT iconx, INT icony,
|
||||
BOOL bFileNameModified, BOOL bOverwriteFileOk,
|
||||
/* FIXME shouldn't be necessary */
|
||||
BOOL bSuppressShowWindow)
|
||||
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,
|
||||
/* FIXME shouldn't be necessary */
|
||||
BOOL bSuppressShowWindow)
|
||||
{
|
||||
PROGGROUP *group, *prior;
|
||||
MDICREATESTRUCTW cs;
|
||||
INT seqnum;
|
||||
HLOCAL hPrior, *p;
|
||||
HLOCAL hGroup = LocalAlloc(LMEM_FIXED, sizeof(PROGGROUP));
|
||||
HLOCAL hName = LocalAlloc(LMEM_FIXED, 1 + strlen(lpszName));
|
||||
HLOCAL hGrpFile = LocalAlloc(LMEM_FIXED, 1 + strlen(lpszGrpFile));
|
||||
if (!hGroup || !hName || !hGrpFile)
|
||||
PROGGROUP* hGroup;
|
||||
PROGGROUP* hPrior;
|
||||
PROGGROUP** p;
|
||||
LPWSTR hName;
|
||||
LPWSTR hGrpFile;
|
||||
LPCWSTR GroupFileName;
|
||||
INT skip;
|
||||
INT width;
|
||||
INT height;
|
||||
INT seqnum;
|
||||
MDICREATESTRUCTW mcs;
|
||||
WINDOWPLACEMENT WndPl;
|
||||
|
||||
WndPl.length = sizeof(WndPl);
|
||||
|
||||
// FIXME: Use system default position in case we don't place the window at a given (x,y) coordinate.
|
||||
|
||||
if (bIsCommonGroup)
|
||||
{
|
||||
MAIN_MessageBoxIDS(IDS_OUT_OF_MEMORY, IDS_ERROR, MB_OK);
|
||||
if (hGroup) LocalFree(hGroup);
|
||||
if (hName) LocalFree(hName);
|
||||
if (hGrpFile) LocalFree(hGrpFile);
|
||||
return(0);
|
||||
}
|
||||
memcpy(LocalLock(hName), lpszName, 1 + strlen(lpszName));
|
||||
memcpy(LocalLock(hGrpFile), lpszGrpFile, 1 + strlen(lpszGrpFile));
|
||||
|
||||
Globals.hActiveGroup = hGroup;
|
||||
|
||||
seqnum = 1;
|
||||
hPrior = 0;
|
||||
p = &Globals.hGroups;
|
||||
while (*p)
|
||||
{
|
||||
hPrior = *p;
|
||||
prior = LocalLock(hPrior);
|
||||
p = &prior->hNext;
|
||||
if (prior->seqnum >= seqnum)
|
||||
seqnum = prior->seqnum + 1;
|
||||
}
|
||||
*p = hGroup;
|
||||
|
||||
group = LocalLock(hGroup);
|
||||
group->hPrior = hPrior;
|
||||
group->hNext = 0;
|
||||
group->hName = hName;
|
||||
group->hGrpFile = hGrpFile;
|
||||
group->bFileNameModified = bFileNameModified;
|
||||
group->bOverwriteFileOk = bOverwriteFileOk;
|
||||
group->seqnum = seqnum;
|
||||
group->nCmdShow = nCmdShow;
|
||||
group->x = x;
|
||||
group->y = y;
|
||||
group->width = width;
|
||||
group->height = height;
|
||||
group->iconx = iconx;
|
||||
group->icony = icony;
|
||||
group->hPrograms = 0;
|
||||
group->hActiveProgram = 0;
|
||||
|
||||
cs.szClass = STRING_GROUP_WIN_CLASS_NAME;
|
||||
cs.szTitle = NULL;
|
||||
cs.hOwner = 0;
|
||||
cs.x = x;
|
||||
cs.y = y;
|
||||
cs.cx = width;
|
||||
cs.cy = height;
|
||||
cs.style = 0;
|
||||
cs.lParam = 0;
|
||||
|
||||
#ifdef __REACTOS__
|
||||
group->hWnd = (HWND)SendMessageW(Globals.hMDIWnd, WM_MDICREATE, 0, (LPARAM)&cs);
|
||||
if (swscanf(lpszGrpFile,
|
||||
L"%d %d %d %d %d %d %d %n",
|
||||
&WndPl.rcNormalPosition.left,
|
||||
&WndPl.rcNormalPosition.top,
|
||||
&WndPl.rcNormalPosition.right,
|
||||
&WndPl.rcNormalPosition.bottom,
|
||||
&WndPl.ptMinPosition,
|
||||
&WndPl.ptMinPosition.y,
|
||||
&WndPl.showCmd,
|
||||
&skip) == 7)
|
||||
{
|
||||
WndPl.flags = WPF_SETMINPOSITION;
|
||||
width = WndPl.rcNormalPosition.right - WndPl.rcNormalPosition.left;
|
||||
height = WndPl.rcNormalPosition.bottom - WndPl.rcNormalPosition.top;
|
||||
GroupFileName = &lpszGrpFile[skip];
|
||||
}
|
||||
else
|
||||
{
|
||||
#if 0 // FIXME!
|
||||
WndPl.rcNormalPosition.top = CW_USEDEFAULT;
|
||||
WndPl.rcNormalPosition.left = CW_USEDEFAULT;
|
||||
WndPl.rcNormalPosition.right = 0;
|
||||
WndPl.rcNormalPosition.bottom = 0;
|
||||
width = CW_USEDEFAULT;
|
||||
height = CW_USEDEFAULT;
|
||||
WndPl.showCmd = SW_SHOWNORMAL;
|
||||
GroupFileName = lpszGrpFile;
|
||||
#else
|
||||
group->hWnd = (HWND)SendMessageA(Globals.hMDIWnd, WM_MDICREATE, 0, (LPARAM)&cs);
|
||||
WndPl.flags = WPF_SETMINPOSITION;
|
||||
WndPl.ptMinPosition.x = xMin;
|
||||
WndPl.ptMinPosition.y = yMin;
|
||||
WndPl.rcNormalPosition.left = left;
|
||||
WndPl.rcNormalPosition.top = top;
|
||||
WndPl.rcNormalPosition.right = right;
|
||||
WndPl.rcNormalPosition.bottom = bottom;
|
||||
width = right - left;
|
||||
height = bottom - top;
|
||||
WndPl.showCmd = nCmdShow;
|
||||
GroupFileName = lpszGrpFile;
|
||||
#endif
|
||||
SetWindowTextA( group->hWnd, lpszName );
|
||||
SetWindowLongPtrW(group->hWnd, 0, (LONG_PTR) hGroup);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
WndPl.flags = WPF_SETMINPOSITION;
|
||||
WndPl.ptMinPosition.x = xMin;
|
||||
WndPl.ptMinPosition.y = yMin;
|
||||
WndPl.rcNormalPosition.left = left;
|
||||
WndPl.rcNormalPosition.top = top;
|
||||
WndPl.rcNormalPosition.right = right;
|
||||
WndPl.rcNormalPosition.bottom = bottom;
|
||||
width = right - left;
|
||||
height = bottom - top;
|
||||
WndPl.showCmd = nCmdShow;
|
||||
GroupFileName = lpszGrpFile;
|
||||
}
|
||||
|
||||
hGroup = Alloc(HEAP_ZERO_MEMORY, sizeof(*hGroup));
|
||||
hName = Alloc(HEAP_ZERO_MEMORY, (wcslen(lpszName) + 1) * sizeof(WCHAR));
|
||||
hGrpFile = Alloc(HEAP_ZERO_MEMORY, (wcslen(GroupFileName) + 1) * sizeof(WCHAR));
|
||||
if (!hGroup || !hName || !hGrpFile)
|
||||
{
|
||||
MAIN_MessageBoxIDS(IDS_OUT_OF_MEMORY, IDS_ERROR, MB_OK);
|
||||
if (hGroup) Free(hGroup);
|
||||
if (hName) Free(hName);
|
||||
if (hGrpFile) Free(hGrpFile);
|
||||
return NULL;
|
||||
}
|
||||
memcpy(hName , lpszName , (wcslen(lpszName) + 1) * sizeof(WCHAR));
|
||||
memcpy(hGrpFile, GroupFileName, (wcslen(GroupFileName) + 1) * sizeof(WCHAR));
|
||||
|
||||
Globals.hActiveGroup = hGroup;
|
||||
|
||||
seqnum = 1;
|
||||
hPrior = NULL;
|
||||
for (p = &Globals.hGroups; *p; p = &hPrior->hNext)
|
||||
{
|
||||
hPrior = *p;
|
||||
if (hPrior->seqnum >= seqnum)
|
||||
seqnum = hPrior->seqnum + 1;
|
||||
}
|
||||
*p = hGroup;
|
||||
|
||||
hGroup->hPrior = hPrior;
|
||||
hGroup->hNext = NULL;
|
||||
hGroup->format = format;
|
||||
hGroup->bIsCommonGroup = bIsCommonGroup;
|
||||
hGroup->hName = hName;
|
||||
hGroup->hGrpFile = hGrpFile;
|
||||
hGroup->bOverwriteFileOk = bOverwriteFileOk;
|
||||
hGroup->seqnum = seqnum;
|
||||
hGroup->nCmdShow = nCmdShow;
|
||||
#if 0
|
||||
hGroup->x = x;
|
||||
hGroup->y = y;
|
||||
hGroup->width = width;
|
||||
hGroup->height = height;
|
||||
#endif
|
||||
hGroup->iconx = cxIcon;
|
||||
hGroup->icony = cyIcon;
|
||||
hGroup->hPrograms = NULL;
|
||||
hGroup->hActiveProgram = NULL;
|
||||
hGroup->TagsSize = 0;
|
||||
hGroup->Tags = NULL;
|
||||
|
||||
mcs.szClass = STRING_GROUP_WIN_CLASS_NAME;
|
||||
mcs.szTitle = lpszName;
|
||||
mcs.hOwner = NULL;
|
||||
mcs.x = WndPl.rcNormalPosition.left;
|
||||
mcs.y = WndPl.rcNormalPosition.top;
|
||||
mcs.cx = width;
|
||||
mcs.cy = height;
|
||||
mcs.style = 0;
|
||||
mcs.lParam = (LPARAM)hGroup;
|
||||
|
||||
hGroup->hWnd = (HWND)SendMessageW(Globals.hMDIWnd, WM_MDICREATE, 0, (LPARAM)&mcs);
|
||||
|
||||
SetWindowPlacement(hGroup->hWnd, &WndPl);
|
||||
|
||||
#if 1
|
||||
if (!bSuppressShowWindow) /* FIXME shouldn't be necessary */
|
||||
if (!bSuppressShowWindow) /* FIXME shouldn't be necessary */
|
||||
#endif
|
||||
{
|
||||
ShowWindow (group->hWnd, nCmdShow);
|
||||
UpdateWindow (group->hWnd);
|
||||
}
|
||||
UpdateWindow(hGroup->hWnd);
|
||||
|
||||
return(hGroup);
|
||||
return hGroup;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* GROUP_ModifyGroup
|
||||
*/
|
||||
|
||||
VOID GROUP_ModifyGroup(HLOCAL hGroup)
|
||||
VOID GROUP_ModifyGroup(PROGGROUP* hGroup)
|
||||
{
|
||||
PROGGROUP *group = LocalLock(hGroup);
|
||||
CHAR szName[MAX_PATHNAME_LEN];
|
||||
CHAR szFile[MAX_PATHNAME_LEN];
|
||||
lstrcpynA(szName, LocalLock(group->hName), MAX_PATHNAME_LEN);
|
||||
lstrcpynA(szFile, LocalLock(group->hGrpFile), MAX_PATHNAME_LEN);
|
||||
WCHAR Dest[MAX_PATHNAME_LEN]; // szName
|
||||
WCHAR szGrpFile[MAX_PATHNAME_LEN]; // szFile
|
||||
|
||||
if (!DIALOG_GroupAttributes(szName, szFile, MAX_PATHNAME_LEN)) return;
|
||||
wcsncpy(Dest, hGroup->hName, ARRAYSIZE(Dest));
|
||||
wcsncpy(szGrpFile, hGroup->hGrpFile, ARRAYSIZE(szGrpFile));
|
||||
|
||||
if (strcmp(szFile, LocalLock(group->hGrpFile)))
|
||||
group->bOverwriteFileOk = FALSE;
|
||||
if (!DIALOG_GroupAttributes(hGroup->format, Dest, szGrpFile, MAX_PATHNAME_LEN))
|
||||
return;
|
||||
|
||||
MAIN_ReplaceString(&group->hName, szName);
|
||||
MAIN_ReplaceString(&group->hGrpFile, szFile);
|
||||
if (wcscmp(szGrpFile, hGroup->hGrpFile))
|
||||
hGroup->bOverwriteFileOk = FALSE;
|
||||
|
||||
GRPFILE_WriteGroupFile(hGroup);
|
||||
MAIN_ReplaceString(&hGroup->hName, Dest);
|
||||
MAIN_ReplaceString(&hGroup->hGrpFile, szGrpFile);
|
||||
|
||||
/* FIXME Delete old GrpFile if GrpFile changed */
|
||||
GRPFILE_WriteGroupFile(hGroup);
|
||||
|
||||
/* FIXME Update progman.ini */
|
||||
/* FIXME Delete old GrpFile if GrpFile changed */
|
||||
|
||||
SetWindowTextA(group->hWnd, szName);
|
||||
/* FIXME Update progman.ini */
|
||||
|
||||
SetWindowTextW(hGroup->hWnd, Dest);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* GROUP_DeleteGroup
|
||||
*/
|
||||
|
||||
VOID GROUP_DeleteGroup(PROGGROUP* hGroup)
|
||||
{
|
||||
if (Globals.hActiveGroup == hGroup)
|
||||
Globals.hActiveGroup = NULL;
|
||||
|
||||
if (hGroup->hPrior)
|
||||
hGroup->hPrior->hNext = hGroup->hNext;
|
||||
else
|
||||
Globals.hGroups = hGroup->hNext;
|
||||
|
||||
if (hGroup->hNext)
|
||||
hGroup->hNext->hPrior = hGroup->hPrior;
|
||||
|
||||
while (hGroup->hPrograms)
|
||||
PROGRAM_DeleteProgram(hGroup->hPrograms, FALSE);
|
||||
|
||||
/* FIXME Update progman.ini */
|
||||
|
||||
SendMessageW(Globals.hMDIWnd, WM_MDIDESTROY, (WPARAM)hGroup->hWnd, 0);
|
||||
|
||||
if (hGroup->Tags)
|
||||
Free(hGroup->Tags);
|
||||
Free(hGroup->hName);
|
||||
Free(hGroup->hGrpFile);
|
||||
Free(hGroup);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
@ -225,64 +403,10 @@ VOID GROUP_ModifyGroup(HLOCAL hGroup)
|
|||
*/
|
||||
|
||||
/* FIXME shouldn't be necessary */
|
||||
VOID GROUP_ShowGroupWindow(HLOCAL hGroup)
|
||||
VOID GROUP_ShowGroupWindow(PROGGROUP* hGroup)
|
||||
{
|
||||
PROGGROUP *group = LocalLock(hGroup);
|
||||
ShowWindow (group->hWnd, group->nCmdShow);
|
||||
UpdateWindow (group->hWnd);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* GROUP_DeleteGroup
|
||||
*/
|
||||
|
||||
VOID GROUP_DeleteGroup(HLOCAL hGroup)
|
||||
{
|
||||
PROGGROUP *group = LocalLock(hGroup);
|
||||
|
||||
Globals.hActiveGroup = 0;
|
||||
|
||||
if (group->hPrior)
|
||||
((PROGGROUP*)LocalLock(group->hPrior))->hNext = group->hNext;
|
||||
else Globals.hGroups = group->hNext;
|
||||
|
||||
if (group->hNext)
|
||||
((PROGGROUP*)LocalLock(group->hNext))->hPrior = group->hPrior;
|
||||
|
||||
while (group->hPrograms)
|
||||
PROGRAM_DeleteProgram(group->hPrograms, FALSE);
|
||||
|
||||
/* FIXME Update progman.ini */
|
||||
|
||||
SendMessageW(Globals.hMDIWnd, WM_MDIDESTROY, (WPARAM)group->hWnd, 0);
|
||||
|
||||
LocalFree(group->hName);
|
||||
LocalFree(group->hGrpFile);
|
||||
LocalFree(hGroup);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* GROUP_FirstGroup
|
||||
*/
|
||||
|
||||
HLOCAL GROUP_FirstGroup(void)
|
||||
{
|
||||
return(Globals.hGroups);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* GROUP_NextGroup
|
||||
*/
|
||||
|
||||
HLOCAL GROUP_NextGroup(HLOCAL hGroup)
|
||||
{
|
||||
PROGGROUP *group;
|
||||
if (!hGroup) return(0);
|
||||
group = LocalLock(hGroup);
|
||||
return(group->hNext);
|
||||
ShowWindow(hGroup->hWnd, hGroup->nCmdShow);
|
||||
UpdateWindow(hGroup->hWnd);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
@ -290,33 +414,7 @@ HLOCAL GROUP_NextGroup(HLOCAL hGroup)
|
|||
* GROUP_ActiveGroup
|
||||
*/
|
||||
|
||||
HLOCAL GROUP_ActiveGroup(void)
|
||||
PROGGROUP* GROUP_ActiveGroup(VOID)
|
||||
{
|
||||
return(Globals.hActiveGroup);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* GROUP_GroupWnd
|
||||
*/
|
||||
|
||||
HWND GROUP_GroupWnd(HLOCAL hGroup)
|
||||
{
|
||||
PROGGROUP *group;
|
||||
if (!hGroup) return(0);
|
||||
group = LocalLock(hGroup);
|
||||
return(group->hWnd);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* GROUP_GroupName
|
||||
*/
|
||||
|
||||
LPCSTR GROUP_GroupName(HLOCAL hGroup)
|
||||
{
|
||||
PROGGROUP *group;
|
||||
if (!hGroup) return(0);
|
||||
group = LocalLock(hGroup);
|
||||
return(LocalLock(group->hName));
|
||||
return Globals.hActiveGroup;
|
||||
}
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
#include "progman.h"
|
||||
|
||||
#if 0
|
||||
#define MALLOCHUNK 1000
|
||||
|
||||
#define GET_USHORT(buffer, i)\
|
||||
|
@ -35,6 +36,7 @@ static HLOCAL GRPFILE_ScanGroup(LPCSTR, INT, LPCSTR, BOOL);
|
|||
static HLOCAL GRPFILE_ScanProgram(LPCSTR, INT, LPCSTR, INT,
|
||||
LPCSTR, HLOCAL,LPCSTR);
|
||||
static BOOL GRPFILE_DoWriteGroupFile(HFILE file, PROGGROUP *group);
|
||||
#endif
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -43,6 +45,7 @@ static BOOL GRPFILE_DoWriteGroupFile(HFILE file, PROGGROUP *group);
|
|||
* Change extension `.grp' to `.gr'
|
||||
*/
|
||||
|
||||
#if 0
|
||||
static VOID GRPFILE_ModifyFileName(LPSTR lpszNewName, LPCSTR lpszOrigName,
|
||||
INT nSize, BOOL bModify)
|
||||
{
|
||||
|
@ -52,14 +55,16 @@ static VOID GRPFILE_ModifyFileName(LPSTR lpszNewName, LPCSTR lpszOrigName,
|
|||
if (!lstrcmpiA(lpszNewName + strlen(lpszNewName) - 4, ".grp"))
|
||||
lpszNewName[strlen(lpszNewName) - 1] = '\0';
|
||||
}
|
||||
#endif
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* GRPFILE_ReadGroupFile
|
||||
*/
|
||||
|
||||
HLOCAL GRPFILE_ReadGroupFile(LPCSTR lpszPath)
|
||||
DWORD GRPFILE_ReadGroupFile(LPCWSTR lpszPath, BOOL bIsCommonGroup)
|
||||
{
|
||||
#if 0
|
||||
CHAR szPath_gr[MAX_PATHNAME_LEN];
|
||||
BOOL bFileNameModified = FALSE;
|
||||
OFSTRUCT dummy;
|
||||
|
@ -90,6 +95,10 @@ HLOCAL GRPFILE_ReadGroupFile(LPCSTR lpszPath)
|
|||
LocalFree(hBuffer);
|
||||
|
||||
return(hGroup);
|
||||
|
||||
#else
|
||||
return ERROR_SUCCESS;
|
||||
#endif
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
@ -97,6 +106,7 @@ HLOCAL GRPFILE_ReadGroupFile(LPCSTR lpszPath)
|
|||
* GRPFILE_ReadFileToBuffer
|
||||
*/
|
||||
|
||||
#if 0
|
||||
static BOOL GRPFILE_ReadFileToBuffer(LPCSTR path, HLOCAL *phBuffer,
|
||||
INT *piSize)
|
||||
{
|
||||
|
@ -143,11 +153,13 @@ static BOOL GRPFILE_ReadFileToBuffer(LPCSTR path, HLOCAL *phBuffer,
|
|||
*piSize = size;
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
/***********************************************************************
|
||||
* GRPFILE_ScanGroup
|
||||
*/
|
||||
|
||||
#if 0
|
||||
static HLOCAL GRPFILE_ScanGroup(LPCSTR buffer, INT size,
|
||||
LPCSTR lpszGrpFile,
|
||||
BOOL bModifiedFileName)
|
||||
|
@ -221,11 +233,13 @@ static HLOCAL GRPFILE_ScanGroup(LPCSTR buffer, INT size,
|
|||
|
||||
return hGroup;
|
||||
}
|
||||
#endif
|
||||
|
||||
/***********************************************************************
|
||||
* GRPFILE_ScanProgram
|
||||
*/
|
||||
|
||||
#if 0
|
||||
static HLOCAL GRPFILE_ScanProgram(LPCSTR buffer, INT size,
|
||||
LPCSTR program_ptr, INT seqnum,
|
||||
LPCSTR extension, HLOCAL hGroup,
|
||||
|
@ -276,11 +290,7 @@ static HLOCAL GRPFILE_ScanProgram(LPCSTR buffer, INT size,
|
|||
if (iconANDbits_ptr + iconANDsize > buffer + size ||
|
||||
iconXORbits_ptr + iconXORsize > buffer + size) return(0);
|
||||
|
||||
#ifdef __REACTOS__
|
||||
hIcon = CreateIcon(Globals.hInstance, width, height, planes, bpp, (PBYTE)iconANDbits_ptr, (PBYTE)iconXORbits_ptr);
|
||||
#else
|
||||
hIcon = CreateIcon( Globals.hInstance, width, height, planes, bpp, iconANDbits_ptr, iconXORbits_ptr );
|
||||
#endif
|
||||
|
||||
lpszName = buffer + GET_USHORT(program_ptr, 18);
|
||||
lpszCmdLine = buffer + GET_USHORT(program_ptr, 20);
|
||||
|
@ -338,14 +348,16 @@ static HLOCAL GRPFILE_ScanProgram(LPCSTR buffer, INT size,
|
|||
nIconIndex, lpszWorkDir,
|
||||
nHotKey, nCmdShow));
|
||||
}
|
||||
#endif
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* GRPFILE_WriteGroupFile
|
||||
*/
|
||||
|
||||
BOOL GRPFILE_WriteGroupFile(HLOCAL hGroup)
|
||||
BOOL GRPFILE_WriteGroupFile(PROGGROUP* hGroup)
|
||||
{
|
||||
#if 0
|
||||
CHAR szPath[MAX_PATHNAME_LEN];
|
||||
PROGGROUP *group = LocalLock(hGroup);
|
||||
OFSTRUCT dummy;
|
||||
|
@ -403,8 +415,14 @@ BOOL GRPFILE_WriteGroupFile(HLOCAL hGroup)
|
|||
MAIN_MessageBoxIDS_s(IDS_FILE_WRITE_ERROR_s, szPath, IDS_ERROR, MB_OK);
|
||||
|
||||
return(ret);
|
||||
|
||||
#else
|
||||
return TRUE;
|
||||
#endif
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* GRPFILE_CalculateSizes
|
||||
|
@ -511,11 +529,9 @@ static BOOL GRPFILE_DoWriteGroupFile(HFILE file, PROGGROUP *group)
|
|||
HLOCAL hProgram;
|
||||
INT NumProg, Title, Progs, Icons, Extension;
|
||||
INT CurrProg, CurrIcon, nCmdShow, ptr, seqnum;
|
||||
#ifdef __REACTOS__
|
||||
|
||||
UINT sizeAnd, sizeXor;
|
||||
#else
|
||||
DWORD sizeAnd, sizeXor;
|
||||
#endif
|
||||
|
||||
BOOL need_extension;
|
||||
LPCSTR lpszTitle = LocalLock(group->hName);
|
||||
|
||||
|
@ -732,3 +748,5 @@ static BOOL GRPFILE_DoWriteGroupFile(HFILE file, PROGGROUP *group)
|
|||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
File diff suppressed because it is too large
Load diff
299
reactos/base/shell/progman/new_resources.rc
Normal file
299
reactos/base/shell/progman/new_resources.rc
Normal file
|
@ -0,0 +1,299 @@
|
|||
// Microsoft Visual C++ generated resource script.
|
||||
//
|
||||
#include "resource_2.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "afxres.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Anglais (États-Unis) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
#pragma code_page(1252)
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE
|
||||
BEGIN
|
||||
"resource_2.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE
|
||||
BEGIN
|
||||
"#include ""afxres.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE
|
||||
BEGIN
|
||||
"\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog
|
||||
//
|
||||
|
||||
IDD_NEW DIALOGEX 0, 0, 240, 70
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "New Object"
|
||||
FONT 8, "MS Shell Dlg", 0, 0, 0x1
|
||||
BEGIN
|
||||
GROUPBOX "",IDC_STATIC,5,5,165,44
|
||||
CONTROL "Program &Group",PM_NEW_GROUP,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,10,4,66,11
|
||||
CONTROL "&Personal",PM_PERSONAL_GROUP,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,20,15,44,14
|
||||
CONTROL "&Common",PM_COMMON_GROUP,"Button",BS_AUTORADIOBUTTON,73,15,39,14
|
||||
LTEXT "&Format:",PM_FORMAT_TXT,20,33,35,11
|
||||
COMBOBOX PM_FORMAT,61,31,104,15,CBS_DROPDOWNLIST | WS_TABSTOP
|
||||
CONTROL "Program &Item",PM_NEW_PROGRAM,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,10,52,59,12
|
||||
DEFPUSHBUTTON "OK",IDOK,175,5,60,15
|
||||
PUSHBUTTON "Cancel",IDCANCEL,175,25,60,15
|
||||
PUSHBUTTON "&Help",IDHELP,175,49,60,15
|
||||
END
|
||||
|
||||
IDD_COPY_MOVE DIALOGEX 0, 0, 250, 65
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Copy Program"
|
||||
FONT 8, "MS Shell Dlg", 0, 0, 0x0
|
||||
BEGIN
|
||||
LTEXT "Copy program:",PM_COPY_MOVE_TXT,5,5,70,10
|
||||
LTEXT "P",PM_PROGRAM,80,5,100,10
|
||||
LTEXT "From group:",IDC_STATIC,5,18,70,10
|
||||
LTEXT "G",PM_FROM_GROUP,80,18,100,10
|
||||
LTEXT "&To group:",IDC_STATIC,5,32,70,10
|
||||
COMBOBOX PM_TO_GROUP,5,46,140,50,CBS_DROPDOWNLIST | WS_TABSTOP
|
||||
DEFPUSHBUTTON "OK",IDOK,185,5,60,15
|
||||
PUSHBUTTON "Cancel",IDCANCEL,185,25,60,15
|
||||
PUSHBUTTON "&Help",IDHELP,185,45,60,15
|
||||
END
|
||||
|
||||
IDD_GROUP DIALOGEX 0, 0, 250, 65
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Program Group Attributes"
|
||||
FONT 8, "MS Shell Dlg", 0, 0, 0x0
|
||||
BEGIN
|
||||
LTEXT "&Description:",IDC_STATIC,5,16,50,11
|
||||
EDITTEXT PM_DESCRIPTION,60,14,120,15,ES_AUTOHSCROLL
|
||||
LTEXT "&Group file:",IDC_STATIC,5,38,50,11
|
||||
EDITTEXT PM_FILE,60,35,120,15,ES_AUTOHSCROLL
|
||||
DEFPUSHBUTTON "OK",IDOK,185,5,60,15
|
||||
PUSHBUTTON "Cancel",IDCANCEL,185,25,60,15
|
||||
PUSHBUTTON "&Help",IDHELP,185,45,60,15
|
||||
END
|
||||
|
||||
IDD_PROGRAM DIALOGEX 0, 0, 270, 105
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Program Attributes"
|
||||
FONT 8, "MS Shell Dlg", 0, 0, 0x0
|
||||
BEGIN
|
||||
LTEXT "&Description:",IDC_STATIC,5,11,65,10
|
||||
EDITTEXT PM_DESCRIPTION,75,7,115,15,ES_AUTOHSCROLL
|
||||
LTEXT "&Command line:",IDC_STATIC,5,26,65,10
|
||||
EDITTEXT PM_COMMAND_LINE,75,23,115,15,ES_AUTOHSCROLL
|
||||
LTEXT "&Working directory:",IDC_STATIC,5,41,65,10
|
||||
EDITTEXT PM_DIRECTORY,75,39,115,15,ES_AUTOHSCROLL
|
||||
LTEXT "&Key combination:",IDC_STATIC,5,56,65,10
|
||||
CONTROL "",PM_HOT_KEY,"msctls_hotkey32",WS_BORDER | WS_TABSTOP,75,55,115,15
|
||||
ICON "",PM_ICON,24,72,20,20
|
||||
CHECKBOX "&Run minimized",PM_SYMBOL,75,74,115,10
|
||||
CONTROL "Run in separate &memory space",PM_NEW_VDM,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,75,87,115,11
|
||||
DEFPUSHBUTTON "OK",IDOK,195,5,70,15
|
||||
PUSHBUTTON "Cancel",IDCANCEL,195,25,70,15
|
||||
PUSHBUTTON "&Browse...",PM_BROWSE,195,45,70,15
|
||||
PUSHBUTTON "Change &icon...",PM_OTHER_SYMBOL,195,65,70,15
|
||||
PUSHBUTTON "&Help",IDHELP,195,85,70,15
|
||||
END
|
||||
|
||||
IDD_SYMBOL DIALOGEX 0, 0, 240, 85
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Change Icon"
|
||||
FONT 8, "MS Shell Dlg", 0, 0, 0x0
|
||||
BEGIN
|
||||
LTEXT "&Filename:",IDC_STATIC,5,11,50,10
|
||||
EDITTEXT PM_ICON_FILE,60,9,110,15,ES_AUTOHSCROLL
|
||||
LTEXT "Current &icon:",IDC_STATIC,5,32,50,10
|
||||
DEFPUSHBUTTON "OK",IDOK,175,5,60,15
|
||||
PUSHBUTTON "Cancel",IDCANCEL,175,25,60,15
|
||||
PUSHBUTTON "&Browse...",PM_BROWSE,175,45,60,15
|
||||
PUSHBUTTON "&Help",IDHELP,175,65,60,15
|
||||
LISTBOX PM_SYMBOL_LIST,5,45,165,35,LBS_SORT | LBS_OWNERDRAWFIXED | LBS_NOINTEGRALHEIGHT | LBS_MULTICOLUMN | LBS_DISABLENOSCROLL | WS_HSCROLL | WS_TABSTOP
|
||||
END
|
||||
|
||||
IDD_EXECUTE DIALOGEX 0, 0, 200, 85
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Execute Program"
|
||||
FONT 8, "MS Shell Dlg", 0, 0, 0x0
|
||||
BEGIN
|
||||
LTEXT "&Command line:",IDC_STATIC,5,15,125,10
|
||||
COMBOBOX PM_COMMAND,5,26,125,15,CBS_DROPDOWN | CBS_HASSTRINGS | CBS_AUTOHSCROLL | CBS_SORT | WS_VSCROLL | WS_TABSTOP
|
||||
CHECKBOX "&Run minimized",PM_SYMBOL,5,46,115,10
|
||||
CONTROL "Run in separate &memory space",PM_NEW_VDM,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,59,115,11
|
||||
DEFPUSHBUTTON "OK",IDOK,135,5,60,15
|
||||
PUSHBUTTON "Cancel",IDCANCEL,135,25,60,15
|
||||
PUSHBUTTON "&Browse...",PM_BROWSE,135,45,60,15
|
||||
PUSHBUTTON "&Help",IDHELP,135,65,60,15
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Menu
|
||||
//
|
||||
|
||||
MAIN_MENU MENU
|
||||
BEGIN
|
||||
POPUP "&File"
|
||||
BEGIN
|
||||
MENUITEM "&New...", PM_NEW
|
||||
MENUITEM "O&pen\tEnter", PM_OPEN
|
||||
MENUITEM "&Move...\tF7", PM_MOVE
|
||||
MENUITEM "&Copy...\tF8", PM_COPY
|
||||
MENUITEM "&Delete\tDel", PM_DELETE
|
||||
MENUITEM "&Properties\tAlt+Enter", PM_ATTRIBUTES
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "&Execute...", PM_EXECUTE
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "E&xit Windows", PM_EXIT
|
||||
END
|
||||
POPUP "&Options"
|
||||
BEGIN
|
||||
MENUITEM "&Arrange automatically", PM_AUTO_ARRANGE
|
||||
MENUITEM "&Minimize on run", PM_MIN_ON_RUN
|
||||
MENUITEM "&Save settings on exit", PM_SAVE_SETTINGS
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Save settings &now", PM_SAVE_SETTINGS_NOW
|
||||
END
|
||||
POPUP "&Windows"
|
||||
BEGIN
|
||||
MENUITEM "&Overlapped\tShift+F5", PM_OVERLAP
|
||||
MENUITEM "&Side by side\tShift+F4", PM_SIDE_BY_SIDE
|
||||
MENUITEM "&Arrange Icons", PM_ARRANGE
|
||||
END
|
||||
POPUP "&Help"
|
||||
BEGIN
|
||||
MENUITEM "&Contents\tF1", PM_CONTENTS
|
||||
MENUITEM "&About Program Manager", PM_ABOUT
|
||||
END
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Accelerator
|
||||
//
|
||||
|
||||
IDA_ACCEL ACCELERATORS
|
||||
BEGIN
|
||||
VK_RETURN, PM_ATTRIBUTES, VIRTKEY, ALT, NOINVERT
|
||||
VK_F1, PM_CONTENTS, VIRTKEY, NOINVERT
|
||||
VK_F4, PM_SIDE_BY_SIDE, VIRTKEY, SHIFT, NOINVERT
|
||||
VK_F5, PM_OVERLAP, VIRTKEY, SHIFT, NOINVERT
|
||||
VK_F7, PM_MOVE, VIRTKEY, NOINVERT
|
||||
VK_F8, PM_COPY, VIRTKEY, NOINVERT
|
||||
VK_DELETE, PM_DELETE, VIRTKEY, NOINVERT
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// DESIGNINFO
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
GUIDELINES DESIGNINFO
|
||||
BEGIN
|
||||
IDD_NEW, DIALOG
|
||||
BEGIN
|
||||
END
|
||||
|
||||
IDD_COPY_MOVE, DIALOG
|
||||
BEGIN
|
||||
END
|
||||
|
||||
IDD_GROUP, DIALOG
|
||||
BEGIN
|
||||
END
|
||||
|
||||
IDD_PROGRAM, DIALOG
|
||||
BEGIN
|
||||
END
|
||||
|
||||
IDD_SYMBOL, DIALOG
|
||||
BEGIN
|
||||
END
|
||||
|
||||
IDD_EXECUTE, DIALOG
|
||||
BEGIN
|
||||
END
|
||||
END
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// String Table
|
||||
//
|
||||
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
IDS_PROGRAM_MANAGER "Program Manager"
|
||||
IDS_ERROR "ERROR"
|
||||
IDS_WARNING "WARNING"
|
||||
IDS_INFO "Information"
|
||||
IDS_DELETE "Delete"
|
||||
IDS_DELETE_GROUP_s "Delete group `%s'?"
|
||||
IDS_DELETE_PROGRAM_s "Delete program `%s'?"
|
||||
IDS_MOVE_PROGRAM_1 "Move Program"
|
||||
IDS_MOVE_PROGRAM_2 "Move program:"
|
||||
IDS_NOT_IMPLEMENTED "Not implemented"
|
||||
IDS_FILE_READ_ERROR_s "Error reading `%s'."
|
||||
IDS_FILE_WRITE_ERROR_s "Error writing `%s'."
|
||||
IDS_GRPFILE_READ_ERROR_s
|
||||
"The group file `%s' cannot be opened.\nShould it be tried further on?"
|
||||
IDS_OUT_OF_MEMORY "Out of memory."
|
||||
END
|
||||
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
IDS_WINHELP_ERROR "Help not available."
|
||||
IDS_UNKNOWN_FEATURE_s "Unknown feature in %s"
|
||||
IDS_FILE_NOT_OVERWRITTEN_s "File `%s' exists. Not overwritten."
|
||||
IDS_SAVE_GROUP_AS_s "Save group as `%s' to prevent overwriting original files."
|
||||
IDS_ALL_FILES "All files (*.*)"
|
||||
IDS_PROGRAMS "Programs (*.exe)"
|
||||
IDS_LIBRARIES_DLL "Libraries (*.dll)"
|
||||
IDS_SYMBOL_FILES "Icon files (*.ico;*.exe;*.dll)"
|
||||
IDS_SYMBOLS_ICO "Icons (*.ico)"
|
||||
END
|
||||
|
||||
#endif // Anglais (États-Unis) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
|
@ -19,17 +19,36 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
/*
|
||||
* PROJECT: ReactOS Program Manager
|
||||
* COPYRIGHT: GPL - See COPYING in the top level directory
|
||||
* FILE: base/shell/progman/progman.h
|
||||
* PURPOSE: ProgMan header
|
||||
* PROGRAMMERS: Ulrich Schmid
|
||||
* Sylvain Petreolle
|
||||
* Hermes Belusca-Maito (hermes.belusca@sfr.fr)
|
||||
*/
|
||||
|
||||
#ifndef PROGMAN_H
|
||||
#define PROGMAN_H
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#define WIN32_NO_STATUS
|
||||
#include <windef.h>
|
||||
#include <winbase.h>
|
||||
#include <winreg.h>
|
||||
#include <wingdi.h>
|
||||
#include <winuser.h>
|
||||
|
||||
#include <shellapi.h>
|
||||
|
||||
#include <commctrl.h>
|
||||
#include <richedit.h>
|
||||
|
||||
#define MAX_STRING_LEN 255
|
||||
#define MAX_PATHNAME_LEN 1024
|
||||
#define MAX_LANGUAGE_NUMBER (PM_LAST_LANGUAGE - PM_FIRST_LANGUAGE)
|
||||
|
@ -39,173 +58,196 @@
|
|||
/* Fallback icon */
|
||||
#define DEFAULTICON OIC_WINLOGO
|
||||
|
||||
/* Icon index in MS Windows' progman.exe */
|
||||
#define PROGMAN_ICON_INDEX 0
|
||||
#define GROUP_ICON_INDEX 6
|
||||
#define DEFAULT_ICON_INDEX 7
|
||||
|
||||
#define DEF_GROUP_WIN_XPOS 100
|
||||
#define DEF_GROUP_WIN_YPOS 100
|
||||
#define DEF_GROUP_WIN_WIDTH 300
|
||||
#define DEF_GROUP_WIN_HEIGHT 200
|
||||
|
||||
typedef struct
|
||||
|
||||
/*
|
||||
* windowsx.h extensions
|
||||
*/
|
||||
#define EnableDlgItem(hDlg, nID, bEnable) \
|
||||
EnableWindow(GetDlgItem((hDlg), (nID)), (bEnable))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
typedef struct _PROGRAM PROGRAM, *PPROGRAM;
|
||||
typedef struct _PROGGROUP PROGGROUP, *PPROGGROUP;
|
||||
|
||||
struct _PROGRAM
|
||||
{
|
||||
HLOCAL hGroup;
|
||||
HLOCAL hPrior;
|
||||
HLOCAL hNext;
|
||||
HWND hWnd;
|
||||
/**/ /* Numbers are byte indexes in *.grp */
|
||||
PROGGROUP* hGroup;
|
||||
PROGRAM* hPrior;
|
||||
PROGRAM* hNext;
|
||||
HWND hWnd;
|
||||
|
||||
/**/ /* Program entry */
|
||||
INT x, y; /* 0 - 3 */
|
||||
INT nIconIndex; /* 4 - 5 */
|
||||
HICON hIcon;
|
||||
/* icon flags ??? */ /* 6 - 7 */
|
||||
/* iconANDsize */ /* 8 - 9 */
|
||||
/* iconXORsize */ /* 10 - 11 */
|
||||
/* pointer to IconInfo */ /* 12 - 13 */
|
||||
/* pointer to iconXORbits */ /* 14 - 15 */ /* sometimes iconANDbits ?! */
|
||||
/* pointer to iconANDbits */ /* 16 - 17 */ /* sometimes iconXORbits ?! */
|
||||
HLOCAL hName; /* 18 - 19 */
|
||||
HLOCAL hCmdLine; /* 20 - 21 */
|
||||
HLOCAL hIconFile; /* 22 - 23 */
|
||||
HLOCAL hWorkDir; /* Extension 0x8101 */
|
||||
INT nHotKey; /* Extension 0x8102 */
|
||||
/* Modifier: bit 8... */
|
||||
INT nCmdShow; /* Extension 0x8103 */
|
||||
INT iItem;
|
||||
INT x;
|
||||
INT y;
|
||||
INT nIconIndex;
|
||||
HICON hIcon;
|
||||
LPWSTR hName;
|
||||
LPWSTR hCmdLine;
|
||||
LPWSTR hIconFile;
|
||||
LPWSTR hWorkDir; /* Extension 0x8101 */
|
||||
INT nHotKey; /* Extension 0x8102 */
|
||||
INT nCmdShow; /* Extension 0x8103 */
|
||||
BOOL bNewVDM; /* Extension 0x8104 */
|
||||
|
||||
/**/ /* IconInfo */
|
||||
/* HotSpot x ??? */ /* 0 - 1 */
|
||||
/* HotSpot y ??? */ /* 2 - 3 */
|
||||
/* Width */ /* 4 - 5 */
|
||||
/* Height */ /* 6 - 7 */
|
||||
/* WidthBytes ??? */ /* 8 - 9 */
|
||||
/* Planes */ /* 10 - 10 */
|
||||
/* BitsPerPixel */ /* 11 - 11 */
|
||||
} PROGRAM;
|
||||
SIZE_T TagsSize;
|
||||
PVOID Tags;
|
||||
}; // PROGRAM, *PPROGRAM;
|
||||
|
||||
typedef struct
|
||||
typedef enum _GROUPFORMAT
|
||||
{
|
||||
HLOCAL hPrior;
|
||||
HLOCAL hNext;
|
||||
HWND hWnd;
|
||||
HLOCAL hGrpFile;
|
||||
HLOCAL hActiveProgram;
|
||||
BOOL bFileNameModified;
|
||||
BOOL bOverwriteFileOk;
|
||||
INT seqnum;
|
||||
Win_311 = 0x0,
|
||||
NT_Ansi = 0x1, // 0x02
|
||||
NT_Unicode = 0x2, // 0x03
|
||||
} GROUPFORMAT;
|
||||
|
||||
/**/ /* Absolute */
|
||||
/* magic `PMCC' */ /* 0 - 3 */
|
||||
/* checksum */ /* 4 - 5 */
|
||||
/* Extension ptr */ /* 6 - 7 */
|
||||
INT nCmdShow; /* 8 - 9 */
|
||||
INT x, y; /* 10 - 13 */
|
||||
INT width, height; /* 14 - 17 */
|
||||
INT iconx, icony; /* 18 - 21 */
|
||||
HLOCAL hName; /* 22 - 23 */
|
||||
/* unknown */ /* 24 - 31 */
|
||||
/* number of programs */ /* 32 - 33 */
|
||||
HLOCAL hPrograms; /* 34 ... */
|
||||
|
||||
/**/ /* Extensions */
|
||||
/* Extension type */ /* 0 - 1 */
|
||||
/* Program number */ /* 2 - 3 */
|
||||
/* Size of entry */ /* 4 - 5 */
|
||||
/* Data */ /* 6 ... */
|
||||
|
||||
/* magic `PMCC' */ /* Extension 0x8000 */
|
||||
/* End of Extensions */ /* Extension 0xffff */
|
||||
} PROGGROUP;
|
||||
|
||||
typedef struct
|
||||
struct _PROGGROUP
|
||||
{
|
||||
HANDLE hInstance;
|
||||
HANDLE hAccel;
|
||||
HWND hMainWnd;
|
||||
HWND hMDIWnd;
|
||||
HICON hMainIcon;
|
||||
HICON hGroupIcon;
|
||||
HICON hDefaultIcon;
|
||||
HMENU hMainMenu;
|
||||
HMENU hFileMenu;
|
||||
HMENU hOptionMenu;
|
||||
HMENU hWindowsMenu;
|
||||
HMENU hLanguageMenu;
|
||||
LPCSTR lpszIniFile;
|
||||
#ifndef __REACTOS__
|
||||
LPCSTR lpszIcoFile;
|
||||
#endif
|
||||
BOOL bAutoArrange;
|
||||
BOOL bSaveSettings;
|
||||
BOOL bMinOnRun;
|
||||
HLOCAL hGroups;
|
||||
HLOCAL hActiveGroup;
|
||||
} GLOBALS;
|
||||
PROGGROUP* hPrior;
|
||||
PROGGROUP* hNext;
|
||||
HWND hWnd;
|
||||
|
||||
HWND hListView;
|
||||
HIMAGELIST hListLarge;
|
||||
HIMAGELIST hDragImageList;
|
||||
HICON hOldCursor;
|
||||
POINT ptStart;
|
||||
BOOL bDragging;
|
||||
|
||||
GROUPFORMAT format;
|
||||
BOOL bIsCommonGroup;
|
||||
// BOOL bFileNameModified;
|
||||
BOOL bOverwriteFileOk;
|
||||
LPWSTR hGrpFile;
|
||||
INT seqnum;
|
||||
INT nCmdShow;
|
||||
INT x;
|
||||
INT y;
|
||||
INT width;
|
||||
INT height;
|
||||
INT iconx;
|
||||
INT icony;
|
||||
LPWSTR hName;
|
||||
PROGRAM* hPrograms;
|
||||
PROGRAM* hActiveProgram;
|
||||
|
||||
SIZE_T TagsSize;
|
||||
PVOID Tags;
|
||||
}; // PROGGROUP, *PPROGGROUP;
|
||||
|
||||
|
||||
typedef struct _GLOBALS
|
||||
{
|
||||
HINSTANCE hInstance;
|
||||
HACCEL hAccel;
|
||||
HWND hMainWnd;
|
||||
HWND hMDIWnd;
|
||||
//HICON hMainIcon;
|
||||
HICON hGroupIcon;
|
||||
HICON hPersonalGroupIcon;
|
||||
HICON hCommonGroupIcon;
|
||||
HICON hDefaultIcon;
|
||||
HMENU hMainMenu;
|
||||
HMENU hFileMenu;
|
||||
HMENU hOptionMenu;
|
||||
HMENU hWindowsMenu;
|
||||
HMENU hLanguageMenu;
|
||||
|
||||
HKEY hKeyProgMan;
|
||||
HKEY hKeyPMSettings;
|
||||
HKEY hKeyPMCommonGroups;
|
||||
HKEY hKeyPMAnsiGroups;
|
||||
HKEY hKeyPMUnicodeGroups;
|
||||
HKEY hKeyAnsiGroups;
|
||||
HKEY hKeyUnicodeGroups;
|
||||
HKEY hKeyCommonGroups;
|
||||
|
||||
BOOL bAutoArrange;
|
||||
BOOL bSaveSettings;
|
||||
BOOL bMinOnRun;
|
||||
PROGGROUP* hGroups;
|
||||
PROGGROUP* hActiveGroup;
|
||||
// int field_74;
|
||||
// int field_78;
|
||||
// PROGGROUP* field_79;
|
||||
} GLOBALS, *PGLOBALS;
|
||||
|
||||
extern GLOBALS Globals;
|
||||
extern WCHAR szTitle[256];
|
||||
|
||||
|
||||
/*
|
||||
* Memory management functions
|
||||
*/
|
||||
PVOID
|
||||
Alloc(IN DWORD dwFlags,
|
||||
IN SIZE_T dwBytes);
|
||||
|
||||
BOOL
|
||||
Free(IN PVOID lpMem);
|
||||
|
||||
PVOID
|
||||
ReAlloc(IN DWORD dwFlags,
|
||||
IN PVOID lpMem,
|
||||
IN SIZE_T dwBytes);
|
||||
|
||||
PVOID
|
||||
AppendToBuffer(IN PVOID pBuffer,
|
||||
IN PSIZE_T pdwBufferSize,
|
||||
IN PVOID pData,
|
||||
IN SIZE_T dwDataSize);
|
||||
|
||||
|
||||
INT MAIN_MessageBoxIDS(UINT ids_text, UINT ids_title, WORD type);
|
||||
INT MAIN_MessageBoxIDS_s(UINT ids_text_s, LPCSTR str, UINT ids_title, WORD type);
|
||||
VOID MAIN_ReplaceString(HLOCAL *handle, LPSTR replacestring);
|
||||
INT MAIN_MessageBoxIDS_s(UINT ids_text, LPCWSTR str, UINT ids_title, WORD type);
|
||||
VOID MAIN_ReplaceString(LPWSTR* string, LPWSTR replace);
|
||||
|
||||
HLOCAL GRPFILE_ReadGroupFile(const char* path);
|
||||
BOOL GRPFILE_WriteGroupFile(HLOCAL hGroup);
|
||||
DWORD GRPFILE_ReadGroupFile(LPCWSTR lpszPath, BOOL bIsCommonGroup);
|
||||
BOOL GRPFILE_WriteGroupFile(PROGGROUP* hGroup);
|
||||
|
||||
ATOM GROUP_RegisterGroupWinClass(void);
|
||||
HLOCAL GROUP_AddGroup(LPCSTR lpszName, LPCSTR lpszGrpFile, INT nCmdShow,
|
||||
INT x, INT y, INT width, INT height,
|
||||
INT iconx, INT icony,
|
||||
BOOL bFileNameModified, BOOL bOverwriteFileOk,
|
||||
/* FIXME shouldn't be necessary */
|
||||
BOOL bSuppressShowWindow);
|
||||
VOID GROUP_NewGroup(void);
|
||||
VOID GROUP_ModifyGroup(HLOCAL hGroup);
|
||||
VOID GROUP_DeleteGroup(HLOCAL hGroup);
|
||||
ATOM GROUP_RegisterGroupWinClass(VOID);
|
||||
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,
|
||||
/* FIXME shouldn't be necessary */
|
||||
BOOL bSuppressShowWindow);
|
||||
VOID GROUP_NewGroup(GROUPFORMAT format, BOOL bIsCommonGroup);
|
||||
VOID GROUP_ModifyGroup(PROGGROUP* hGroup);
|
||||
VOID GROUP_DeleteGroup(PROGGROUP* hGroup);
|
||||
/* FIXME shouldn't be necessary */
|
||||
VOID GROUP_ShowGroupWindow(HLOCAL hGroup);
|
||||
HLOCAL GROUP_FirstGroup(void);
|
||||
HLOCAL GROUP_NextGroup(HLOCAL hGroup);
|
||||
HLOCAL GROUP_ActiveGroup(void);
|
||||
HWND GROUP_GroupWnd(HLOCAL hGroup);
|
||||
LPCSTR GROUP_GroupName(HLOCAL hGroup);
|
||||
VOID GROUP_ShowGroupWindow(PROGGROUP* hGroup);
|
||||
PROGGROUP* GROUP_ActiveGroup(VOID);
|
||||
|
||||
ATOM PROGRAM_RegisterProgramWinClass(void);
|
||||
HLOCAL PROGRAM_AddProgram(HLOCAL hGroup, HICON hIcon, LPCSTR lpszName,
|
||||
INT x, INT y, LPCSTR lpszCmdLine,
|
||||
LPCSTR lpszIconFile, INT nIconIndex,
|
||||
LPCSTR lpszWorkDir, INT nHotKey, INT nCmdShow);
|
||||
VOID PROGRAM_NewProgram(HLOCAL hGroup);
|
||||
VOID PROGRAM_ModifyProgram(HLOCAL hProgram);
|
||||
VOID PROGRAM_CopyMoveProgram(HLOCAL hProgram, BOOL bMove);
|
||||
VOID PROGRAM_DeleteProgram(HLOCAL hProgram, BOOL BUpdateGrpFile);
|
||||
HLOCAL PROGRAM_FirstProgram(HLOCAL hGroup);
|
||||
HLOCAL PROGRAM_NextProgram(HLOCAL hProgram);
|
||||
HLOCAL PROGRAM_ActiveProgram(HLOCAL hGroup);
|
||||
LPCSTR PROGRAM_ProgramName(HLOCAL hProgram);
|
||||
VOID PROGRAM_ExecuteProgram(HLOCAL hLocal);
|
||||
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);
|
||||
VOID PROGRAM_NewProgram(PROGGROUP* hGroup);
|
||||
VOID PROGRAM_ModifyProgram(PROGRAM* hProgram);
|
||||
VOID PROGRAM_CopyMoveProgram(PROGRAM* hProgram, BOOL bMove);
|
||||
VOID PROGRAM_DeleteProgram(PROGRAM* hProgram, BOOL bUpdateGrpFile);
|
||||
VOID PROGRAM_ExecuteProgram(PROGRAM* hProgram);
|
||||
PROGRAM* PROGRAM_ActiveProgram(PROGGROUP* hGroup);
|
||||
|
||||
INT DIALOG_New(INT nDefault);
|
||||
HLOCAL DIALOG_CopyMove(LPCSTR lpszProgramName, LPCSTR lpszGroupName, BOOL bMove);
|
||||
BOOL DIALOG_Delete(UINT ids_format_s, LPCSTR lpszName);
|
||||
BOOL DIALOG_GroupAttributes(LPSTR lpszTitle, LPSTR lpszPath, INT nSize);
|
||||
BOOL DIALOG_ProgramAttributes(LPSTR lpszTitle, LPSTR lpszCmdLine,
|
||||
LPSTR lpszWorkDir, LPSTR lpszIconFile,
|
||||
HICON *lphIcon, INT *nIconIndex,
|
||||
INT *lpnHotKey, INT *lpnCmdShow, INT nSize);
|
||||
VOID DIALOG_Execute(void);
|
||||
BOOL DIALOG_New(INT nDefault, PINT pnResult);
|
||||
PROGGROUP* DIALOG_CopyMove(PROGRAM* hProgram, BOOL bMove);
|
||||
BOOL DIALOG_Delete(UINT ids_text_s, LPCWSTR lpszName);
|
||||
BOOL DIALOG_GroupAttributes(GROUPFORMAT format, LPWSTR lpszTitle, LPWSTR lpszGrpFile, INT nSize);
|
||||
BOOL DIALOG_ProgramAttributes(LPWSTR lpszTitle, LPWSTR lpszCmdLine, LPWSTR lpszWorkDir, LPWSTR lpszIconFile,
|
||||
HICON* lphIcon, INT* lpnIconIndex, INT* lpnHotKey, INT* lpnCmdShow, BOOL* lpbNewVDM, INT nSize);
|
||||
VOID DIALOG_Execute(VOID);
|
||||
|
||||
VOID STRING_LoadMenus(VOID);
|
||||
VOID STRING_LoadStrings(VOID);
|
||||
VOID STRING_LoadMenus(VOID);
|
||||
|
||||
/* Class names */
|
||||
extern WCHAR STRING_MAIN_WIN_CLASS_NAME[];
|
||||
extern WCHAR STRING_MDI_WIN_CLASS_NAME[];
|
||||
extern WCHAR STRING_GROUP_WIN_CLASS_NAME[];
|
||||
extern WCHAR STRING_PROGRAM_WIN_CLASS_NAME[];
|
||||
#define STRING_MAIN_WIN_CLASS_NAME L"PMMain"
|
||||
#define STRING_GROUP_WIN_CLASS_NAME L"PMGroup"
|
||||
|
||||
#endif /* PROGMAN_H */
|
||||
|
||||
/* Local Variables: */
|
||||
/* c-file-style: "GNU" */
|
||||
/* End: */
|
||||
|
|
|
@ -31,74 +31,22 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
|
|||
#define REACTOS_STR_ORIGINAL_FILENAME "progman.exe"
|
||||
#include <reactos/version.rc>
|
||||
|
||||
IDI_APPICON ICON "res/progman.ico"
|
||||
IDI_APPICON ICON "res/progman.ico"
|
||||
IDI_GROUP_PERSONAL_ICON ICON "res/group_personal.ico"
|
||||
IDI_GROUP_COMMON_ICON ICON "res/group_common.ico"
|
||||
IDI_ROSLOGO ICON "res/roslogo.ico"
|
||||
IDI_GROUP_ICON ICON "res/group.ico"
|
||||
IDI_TERMINAL ICON "res/terminal.ico"
|
||||
|
||||
#include <reactos/manifest_exe.rc>
|
||||
|
||||
/* UTF-8 */
|
||||
#pragma code_page(65001)
|
||||
|
||||
#if 0 // Work in progress! See "new_resources.rc"
|
||||
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
|
||||
|
||||
MAIN_MENU MENU
|
||||
{
|
||||
POPUP "&File" {
|
||||
MENUITEM "&New...", PM_NEW
|
||||
MENUITEM "O&pen\tEnter", PM_OPEN
|
||||
MENUITEM "&Move...\tF7", PM_MOVE, GRAYED
|
||||
MENUITEM "&Copy...\tF8", PM_COPY, GRAYED
|
||||
MENUITEM "&Delete\tDel", PM_DELETE
|
||||
MENUITEM "&Properties\tAlt+Enter", PM_ATTRIBUTES
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "&Execute...", PM_EXECUTE
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "E&xit Windows", PM_EXIT
|
||||
}
|
||||
POPUP "&Options" {
|
||||
MENUITEM "&Arrange automatically", PM_AUTO_ARRANGE
|
||||
MENUITEM "&Minimize on run", PM_MIN_ON_RUN
|
||||
MENUITEM "&Save settings on exit", PM_SAVE_SETTINGS
|
||||
}
|
||||
POPUP "&Windows" {
|
||||
MENUITEM "&Overlapped\tShift+F5", PM_OVERLAP
|
||||
MENUITEM "&Side by side\tShift+F4", PM_SIDE_BY_SIDE
|
||||
MENUITEM "&Arrange Icons", PM_ARRANGE
|
||||
}
|
||||
|
||||
POPUP "&Help" {
|
||||
MENUITEM "&Contents\tF1", PM_CONTENTS
|
||||
MENUITEM "&About Program Manager", PM_ABOUT_WINE
|
||||
}
|
||||
}
|
||||
|
||||
STRINGTABLE
|
||||
{
|
||||
IDS_PROGRAM_MANAGER, "Program Manager"
|
||||
IDS_ERROR, "ERROR"
|
||||
IDS_WARNING, "WARNING"
|
||||
IDS_INFO, "Information"
|
||||
IDS_DELETE, "Delete"
|
||||
IDS_DELETE_GROUP_s, "Delete group `%s'?"
|
||||
IDS_DELETE_PROGRAM_s, "Delete program `%s'?"
|
||||
IDS_NOT_IMPLEMENTED, "Not implemented"
|
||||
IDS_FILE_READ_ERROR_s, "Error reading `%s'."
|
||||
IDS_FILE_WRITE_ERROR_s, "Error writing `%s'."
|
||||
IDS_GRPFILE_READ_ERROR_s, "\
|
||||
The group file `%s' cannot be opened.\n\
|
||||
Should it be tried further on?"
|
||||
IDS_OUT_OF_MEMORY, "Out of memory."
|
||||
IDS_WINHELP_ERROR, "Help not available."
|
||||
IDS_UNKNOWN_FEATURE_s, "Unknown feature in %s"
|
||||
IDS_FILE_NOT_OVERWRITTEN_s, "File `%s' exists. Not overwritten."
|
||||
IDS_SAVE_GROUP_AS_s, "Save group as `%s to prevent overwriting original files."
|
||||
IDS_NO_HOT_KEY, "#msgctxt#hotkey#None"
|
||||
IDS_ALL_FILES, "All files (*.*)"
|
||||
IDS_PROGRAMS, "Programs"
|
||||
IDS_LIBRARIES_DLL, "Libraries (*.dll)"
|
||||
IDS_SYMBOL_FILES, "Icon files"
|
||||
IDS_SYMBOLS_ICO, "Icons (*.ico)"
|
||||
}
|
||||
|
||||
IDA_ACCEL ACCELERATORS
|
||||
{
|
||||
VK_F1, PM_CONTENTS, VIRTKEY
|
||||
VK_RETURN, PM_ATTRIBUTES, VIRTKEY, ALT
|
||||
}
|
||||
|
||||
/* Dialog `New' */
|
||||
|
||||
|
@ -118,7 +66,7 @@ PUSHBUTTON "&Help", PM_HELP, 105, 45, 60, 15, WS_TABSTOP
|
|||
|
||||
/* Dialog `Move' */
|
||||
|
||||
IDD_MOVE DIALOG 0, 0, 250, 65
|
||||
IDD_COPY_MOVE DIALOG 0, 0, 250, 65
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
FONT 8, "MS Shell Dlg"
|
||||
CAPTION "Move Program"
|
||||
|
@ -230,3 +178,7 @@ PUSHBUTTON "Cancel", IDCANCEL, 135, 25, 60, 15, WS_TABSTOP
|
|||
PUSHBUTTON "&Browse...", PM_BROWSE, 135, 45, 60, 15, WS_TABSTOP
|
||||
PUSHBUTTON "&Help", PM_HELP, 135, 65, 60, 15, WS_TABSTOP
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#include "new_resources.rc"
|
||||
|
|
|
@ -18,12 +18,18 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
/*
|
||||
* PROJECT: ReactOS Program Manager
|
||||
* COPYRIGHT: GPL - See COPYING in the top level directory
|
||||
* FILE: base/shell/progman/program.c
|
||||
* PURPOSE: Program items helper functions
|
||||
* PROGRAMMERS: Ulrich Schmid
|
||||
* Hermes Belusca-Maito (hermes.belusca@sfr.fr)
|
||||
*/
|
||||
|
||||
#include "progman.h"
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* PROGRAM_ProgramWndProc
|
||||
*/
|
||||
#if 0
|
||||
|
||||
static LRESULT CALLBACK PROGRAM_ProgramWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
|
@ -62,58 +68,44 @@ static LRESULT CALLBACK PROGRAM_ProgramWndProc(HWND hWnd, UINT msg, WPARAM wPara
|
|||
return DefWindowProcW(hWnd, msg, wParam, lParam);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* PROGRAM_RegisterProgramWinClass
|
||||
*/
|
||||
#endif
|
||||
|
||||
ATOM PROGRAM_RegisterProgramWinClass(void)
|
||||
{
|
||||
WNDCLASSW class;
|
||||
|
||||
class.style = CS_HREDRAW | CS_VREDRAW;
|
||||
class.lpfnWndProc = PROGRAM_ProgramWndProc;
|
||||
class.cbClsExtra = 0;
|
||||
class.cbWndExtra = sizeof(LONG_PTR);
|
||||
class.hInstance = Globals.hInstance;
|
||||
class.hIcon = 0;
|
||||
class.hCursor = LoadCursorW (0, (LPWSTR)IDC_ARROW);
|
||||
class.hbrBackground = GetStockObject (WHITE_BRUSH);
|
||||
class.lpszMenuName = 0;
|
||||
class.lpszClassName = STRING_PROGRAM_WIN_CLASS_NAME;
|
||||
|
||||
return RegisterClassW(&class);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* PROGRAM_NewProgram
|
||||
*/
|
||||
|
||||
VOID PROGRAM_NewProgram(HLOCAL hGroup)
|
||||
VOID PROGRAM_NewProgram(PROGGROUP* hGroup)
|
||||
{
|
||||
INT nCmdShow = SW_SHOWNORMAL;
|
||||
INT nHotKey = 0;
|
||||
INT nIconIndex = 0;
|
||||
CHAR szName[MAX_PATHNAME_LEN] = "";
|
||||
CHAR szCmdLine[MAX_PATHNAME_LEN] = "";
|
||||
CHAR szIconFile[MAX_PATHNAME_LEN] = "";
|
||||
CHAR szWorkDir[MAX_PATHNAME_LEN] = "";
|
||||
HICON hIcon = 0;
|
||||
HICON hIcon = NULL;
|
||||
INT nIconIndex = 0;
|
||||
INT nHotKey = 0;
|
||||
INT nCmdShow = SW_SHOWNORMAL;
|
||||
BOOL bNewVDM = FALSE;
|
||||
WCHAR szTitle[MAX_PATHNAME_LEN] = L"";
|
||||
WCHAR szCmdLine[MAX_PATHNAME_LEN] = L"";
|
||||
WCHAR szIconFile[MAX_PATHNAME_LEN] = L"";
|
||||
WCHAR szWorkDir[MAX_PATHNAME_LEN] = L"";
|
||||
|
||||
if (!DIALOG_ProgramAttributes(szName, szCmdLine, szWorkDir, szIconFile,
|
||||
&hIcon, &nIconIndex, &nHotKey,
|
||||
&nCmdShow, MAX_PATHNAME_LEN))
|
||||
return;
|
||||
if (!DIALOG_ProgramAttributes(szTitle, szCmdLine, szWorkDir, szIconFile,
|
||||
&hIcon, &nIconIndex, &nHotKey, &nCmdShow, &bNewVDM,
|
||||
MAX_PATHNAME_LEN))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!hIcon) hIcon = LoadIconW(0, (LPWSTR)IDI_WINLOGO);
|
||||
if (!hIcon)
|
||||
hIcon = LoadIconW(NULL, MAKEINTRESOURCEW(IDI_WINLOGO));
|
||||
|
||||
if (!PROGRAM_AddProgram(hGroup, hIcon, szTitle, -1, -1, szCmdLine, szIconFile,
|
||||
nIconIndex, szWorkDir, nHotKey, nCmdShow, bNewVDM))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!PROGRAM_AddProgram(hGroup, hIcon, szName, 0, 0, szCmdLine, szIconFile,
|
||||
nIconIndex, szWorkDir, nHotKey, nCmdShow))
|
||||
return;
|
||||
|
||||
GRPFILE_WriteGroupFile(hGroup);
|
||||
GRPFILE_WriteGroupFile(hGroup);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
@ -121,36 +113,39 @@ VOID PROGRAM_NewProgram(HLOCAL hGroup)
|
|||
* PROGRAM_ModifyProgram
|
||||
*/
|
||||
|
||||
VOID PROGRAM_ModifyProgram(HLOCAL hProgram)
|
||||
VOID PROGRAM_ModifyProgram(PROGRAM* hProgram)
|
||||
{
|
||||
PROGRAM *program = LocalLock(hProgram);
|
||||
CHAR szName[MAX_PATHNAME_LEN];
|
||||
CHAR szCmdLine[MAX_PATHNAME_LEN];
|
||||
CHAR szIconFile[MAX_PATHNAME_LEN];
|
||||
CHAR szWorkDir[MAX_PATHNAME_LEN];
|
||||
LVITEMW lvItem;
|
||||
WCHAR szName[MAX_PATHNAME_LEN];
|
||||
WCHAR szWorkDir[MAX_PATHNAME_LEN];
|
||||
WCHAR szCmdLine[MAX_PATHNAME_LEN];
|
||||
WCHAR szIconFile[MAX_PATHNAME_LEN];
|
||||
|
||||
lstrcpynA(szName, LocalLock(program->hName), MAX_PATHNAME_LEN);
|
||||
lstrcpynA(szCmdLine, LocalLock(program->hCmdLine), MAX_PATHNAME_LEN);
|
||||
lstrcpynA(szIconFile, LocalLock(program->hIconFile), MAX_PATHNAME_LEN);
|
||||
lstrcpynA(szWorkDir, LocalLock(program->hWorkDir), MAX_PATHNAME_LEN);
|
||||
lstrcpynW(szName , hProgram->hName , ARRAYSIZE(szName));
|
||||
lstrcpynW(szCmdLine , hProgram->hCmdLine , ARRAYSIZE(szCmdLine));
|
||||
lstrcpynW(szIconFile, hProgram->hIconFile, ARRAYSIZE(szIconFile));
|
||||
lstrcpynW(szWorkDir , hProgram->hWorkDir , ARRAYSIZE(szWorkDir));
|
||||
|
||||
if (!DIALOG_ProgramAttributes(szName, szCmdLine, szWorkDir, szIconFile,
|
||||
&program->hIcon, &program->nIconIndex,
|
||||
&program->nHotKey, &program->nCmdShow,
|
||||
MAX_PATHNAME_LEN))
|
||||
return;
|
||||
if (!DIALOG_ProgramAttributes(szName, szCmdLine, szWorkDir, szIconFile,
|
||||
&hProgram->hIcon, &hProgram->nIconIndex,
|
||||
&hProgram->nHotKey, &hProgram->nCmdShow,
|
||||
&hProgram->bNewVDM, MAX_PATHNAME_LEN))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
MAIN_ReplaceString(&program->hName, szName);
|
||||
MAIN_ReplaceString(&program->hCmdLine, szCmdLine);
|
||||
MAIN_ReplaceString(&program->hIconFile, szIconFile);
|
||||
MAIN_ReplaceString(&program->hWorkDir, szWorkDir);
|
||||
MAIN_ReplaceString(&hProgram->hName , szName);
|
||||
MAIN_ReplaceString(&hProgram->hCmdLine , szCmdLine);
|
||||
MAIN_ReplaceString(&hProgram->hIconFile, szIconFile);
|
||||
MAIN_ReplaceString(&hProgram->hWorkDir , szWorkDir);
|
||||
|
||||
SetWindowTextA(program->hWnd, szName);
|
||||
UpdateWindow(program->hWnd);
|
||||
ZeroMemory(&lvItem, sizeof(lvItem));
|
||||
lvItem.mask = LVIF_TEXT;
|
||||
lvItem.iSubItem = 0;
|
||||
lvItem.pszText = szName;
|
||||
SendMessageW(hProgram->hGroup->hListView, LVM_SETITEMTEXTW, hProgram->iItem, (LPARAM)&lvItem);
|
||||
|
||||
GRPFILE_WriteGroupFile(program->hGroup);
|
||||
|
||||
return;
|
||||
GRPFILE_WriteGroupFile(hProgram->hGroup);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
@ -158,106 +153,117 @@ VOID PROGRAM_ModifyProgram(HLOCAL hProgram)
|
|||
* PROGRAM_AddProgram
|
||||
*/
|
||||
|
||||
HLOCAL PROGRAM_AddProgram(HLOCAL hGroup, HICON hIcon, LPCSTR lpszName,
|
||||
INT x, INT y, LPCSTR lpszCmdLine,
|
||||
LPCSTR lpszIconFile, INT nIconIndex,
|
||||
LPCSTR lpszWorkDir, INT nHotKey, INT nCmdShow)
|
||||
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)
|
||||
{
|
||||
PROGGROUP *group = LocalLock(hGroup);
|
||||
PROGRAM *program;
|
||||
HLOCAL hPrior, *p;
|
||||
HLOCAL hProgram = LocalAlloc(LMEM_FIXED, sizeof(PROGRAM));
|
||||
HLOCAL hName = LocalAlloc(LMEM_FIXED, 1 + strlen(lpszName));
|
||||
HLOCAL hCmdLine = LocalAlloc(LMEM_FIXED, 1 + strlen(lpszCmdLine));
|
||||
HLOCAL hIconFile = LocalAlloc(LMEM_FIXED, 1 + strlen(lpszIconFile));
|
||||
HLOCAL hWorkDir = LocalAlloc(LMEM_FIXED, 1 + strlen(lpszWorkDir));
|
||||
if (!hProgram || !hName || !hCmdLine || !hIconFile || !hWorkDir)
|
||||
PROGRAM* hProgram;
|
||||
PROGRAM* hPrior;
|
||||
PROGRAM** p;
|
||||
LPWSTR hCmdLine;
|
||||
LPWSTR hIconFile;
|
||||
LPWSTR hName;
|
||||
LPWSTR hWorkDir;
|
||||
LVITEMW lvItem;
|
||||
INT iItem;
|
||||
|
||||
hProgram = Alloc(HEAP_ZERO_MEMORY, sizeof(*hProgram));
|
||||
hName = Alloc(HEAP_ZERO_MEMORY, (wcslen(lpszName) + 1) * sizeof(WCHAR));
|
||||
hCmdLine = Alloc(HEAP_ZERO_MEMORY, (wcslen(lpszCmdLine) + 1) * sizeof(WCHAR));
|
||||
hIconFile = Alloc(HEAP_ZERO_MEMORY, (wcslen(lpszIconFile) + 1) * sizeof(WCHAR));
|
||||
hWorkDir = Alloc(HEAP_ZERO_MEMORY, (wcslen(lpszWorkDir) + 1) * sizeof(WCHAR));
|
||||
if (!hProgram || !hName || !hCmdLine || !hIconFile || !hWorkDir)
|
||||
{
|
||||
MAIN_MessageBoxIDS(IDS_OUT_OF_MEMORY, IDS_ERROR, MB_OK);
|
||||
if (hProgram) LocalFree(hProgram);
|
||||
if (hName) LocalFree(hName);
|
||||
if (hCmdLine) LocalFree(hCmdLine);
|
||||
if (hIconFile) LocalFree(hIconFile);
|
||||
if (hWorkDir) LocalFree(hWorkDir);
|
||||
return(0);
|
||||
MAIN_MessageBoxIDS(IDS_OUT_OF_MEMORY, IDS_ERROR, MB_OK);
|
||||
if (hProgram) Free(hProgram);
|
||||
if (hName) Free(hName);
|
||||
if (hCmdLine) Free(hCmdLine);
|
||||
if (hIconFile) Free(hIconFile);
|
||||
if (hWorkDir) Free(hWorkDir);
|
||||
return NULL;
|
||||
}
|
||||
memcpy(LocalLock(hName), lpszName, 1 + strlen(lpszName));
|
||||
memcpy(LocalLock(hCmdLine), lpszCmdLine, 1 + strlen(lpszCmdLine));
|
||||
memcpy(LocalLock(hIconFile), lpszIconFile, 1 + strlen(lpszIconFile));
|
||||
memcpy(LocalLock(hWorkDir), lpszWorkDir, 1 + strlen(lpszWorkDir));
|
||||
memcpy(hName , lpszName , (wcslen(lpszName) + 1) * sizeof(WCHAR));
|
||||
memcpy(hCmdLine , lpszCmdLine , (wcslen(lpszCmdLine) + 1) * sizeof(WCHAR));
|
||||
memcpy(hIconFile, lpszIconFile, (wcslen(lpszIconFile) + 1) * sizeof(WCHAR));
|
||||
memcpy(hWorkDir , lpszWorkDir , (wcslen(lpszWorkDir) + 1) * sizeof(WCHAR));
|
||||
|
||||
group->hActiveProgram = hProgram;
|
||||
hGroup->hActiveProgram = hProgram;
|
||||
|
||||
hPrior = 0;
|
||||
p = &group->hPrograms;
|
||||
while (*p)
|
||||
{
|
||||
hPrior = *p;
|
||||
p = &((PROGRAM*)LocalLock(hPrior))->hNext;
|
||||
}
|
||||
*p = hProgram;
|
||||
hPrior = NULL;
|
||||
for (p = &hGroup->hPrograms; *p; p = &hPrior->hNext)
|
||||
hPrior = *p;
|
||||
*p = hProgram;
|
||||
|
||||
program = LocalLock(hProgram);
|
||||
program->hGroup = hGroup;
|
||||
program->hPrior = hPrior;
|
||||
program->hNext = 0;
|
||||
program->hName = hName;
|
||||
program->hCmdLine = hCmdLine;
|
||||
program->hIconFile = hIconFile;
|
||||
program->nIconIndex = nIconIndex;
|
||||
program->hWorkDir = hWorkDir;
|
||||
program->hIcon = hIcon;
|
||||
program->nCmdShow = nCmdShow;
|
||||
program->nHotKey = nHotKey;
|
||||
hProgram->hGroup = hGroup;
|
||||
hProgram->hPrior = hPrior;
|
||||
hProgram->hNext = NULL;
|
||||
hProgram->hName = hName;
|
||||
hProgram->hCmdLine = hCmdLine;
|
||||
hProgram->hIconFile = hIconFile;
|
||||
hProgram->nIconIndex = nIconIndex;
|
||||
hProgram->hWorkDir = hWorkDir;
|
||||
hProgram->hIcon = hIcon;
|
||||
hProgram->nCmdShow = nCmdShow;
|
||||
hProgram->nHotKey = nHotKey;
|
||||
hProgram->bNewVDM = bNewVDM;
|
||||
hProgram->TagsSize = 0;
|
||||
hProgram->Tags = NULL;
|
||||
|
||||
program->hWnd =
|
||||
CreateWindowW(STRING_PROGRAM_WIN_CLASS_NAME, NULL,
|
||||
WS_CHILD | WS_CAPTION,
|
||||
x, y, CW_USEDEFAULT, CW_USEDEFAULT,
|
||||
group->hWnd, 0, Globals.hInstance, 0);
|
||||
ZeroMemory(&lvItem, sizeof(lvItem));
|
||||
lvItem.mask = LVIF_PARAM | LVIF_IMAGE | LVIF_TEXT;
|
||||
lvItem.pszText = (LPWSTR)lpszName;
|
||||
lvItem.lParam = (LPARAM)hProgram;
|
||||
lvItem.iImage = ImageList_ReplaceIcon(hGroup->hListLarge, -1, hIcon);
|
||||
DestroyIcon(hIcon);
|
||||
|
||||
SetWindowTextA(program->hWnd, lpszName);
|
||||
SetWindowLongPtrW(program->hWnd, 0, (LONG_PTR) hProgram);
|
||||
lvItem.iItem = SendMessageA(hGroup->hListView, LVM_GETITEMCOUNT, 0, 0);
|
||||
iItem = SendMessageW(hGroup->hListView, LVM_INSERTITEMW, 0, (LPARAM)&lvItem);
|
||||
hProgram->iItem = iItem;
|
||||
if (x != -1 && y != -1)
|
||||
SendMessageA(hGroup->hListView, LVM_SETITEMPOSITION, lvItem.iItem, MAKELPARAM(x, y));
|
||||
|
||||
ShowWindow (program->hWnd, SW_SHOWMINIMIZED);
|
||||
SetWindowPos (program->hWnd, 0, x, y, 0, 0, SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOSIZE);
|
||||
UpdateWindow (program->hWnd);
|
||||
|
||||
return hProgram;
|
||||
return hProgram;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* PROGRAM_CopyMoveProgram
|
||||
*/
|
||||
|
||||
VOID PROGRAM_CopyMoveProgram(HLOCAL hProgram, BOOL bMove)
|
||||
VOID PROGRAM_CopyMoveProgram(PROGRAM* hProgram, BOOL bMove)
|
||||
{
|
||||
PROGRAM *program = LocalLock(hProgram);
|
||||
PROGGROUP *fromgroup = LocalLock(program->hGroup);
|
||||
HLOCAL hGroup = DIALOG_CopyMove(LocalLock(program->hName),
|
||||
LocalLock(fromgroup->hName), bMove);
|
||||
if (!hGroup) return;
|
||||
PROGGROUP* hGroup;
|
||||
|
||||
/* FIXME shouldn't be necessary */
|
||||
OpenIcon(((PROGGROUP*)LocalLock(hGroup))->hWnd);
|
||||
hGroup = DIALOG_CopyMove(hProgram, bMove);
|
||||
if (!hGroup)
|
||||
return;
|
||||
|
||||
if (!PROGRAM_AddProgram(hGroup,
|
||||
#if 0
|
||||
CopyIcon(program->hIcon),
|
||||
#else
|
||||
program->hIcon,
|
||||
#endif
|
||||
LocalLock(program->hName),
|
||||
program->x, program->y,
|
||||
LocalLock(program->hCmdLine),
|
||||
LocalLock(program->hIconFile),
|
||||
program->nIconIndex,
|
||||
LocalLock(program->hWorkDir),
|
||||
program->nHotKey, program->nCmdShow)) return;
|
||||
GRPFILE_WriteGroupFile(hGroup);
|
||||
/* FIXME: shouldn't be necessary */
|
||||
OpenIcon(hGroup->hWnd);
|
||||
|
||||
if (bMove) PROGRAM_DeleteProgram(hProgram, TRUE);
|
||||
if (!PROGRAM_AddProgram(hGroup,
|
||||
hProgram->hIcon,
|
||||
hProgram->hName,
|
||||
hProgram->x,
|
||||
hProgram->y,
|
||||
hProgram->hCmdLine,
|
||||
hProgram->hIconFile,
|
||||
hProgram->nIconIndex,
|
||||
hProgram->hWorkDir,
|
||||
hProgram->nHotKey,
|
||||
hProgram->nCmdShow,
|
||||
hProgram->bNewVDM))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
GRPFILE_WriteGroupFile(hGroup);
|
||||
|
||||
if (bMove)
|
||||
PROGRAM_DeleteProgram(hProgram, TRUE);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
@ -265,15 +271,14 @@ VOID PROGRAM_CopyMoveProgram(HLOCAL hProgram, BOOL bMove)
|
|||
* PROGRAM_ExecuteProgram
|
||||
*/
|
||||
|
||||
VOID PROGRAM_ExecuteProgram(HLOCAL hProgram)
|
||||
VOID PROGRAM_ExecuteProgram(PROGRAM* hProgram)
|
||||
{
|
||||
PROGRAM *program = LocalLock(hProgram);
|
||||
LPSTR lpszCmdLine = LocalLock(program->hCmdLine);
|
||||
// TODO: Use a (private?) shell API with which one can use hProgram->bNewVDM
|
||||
|
||||
/* FIXME set working directory from program->hWorkDir */
|
||||
ShellExecuteW(NULL, NULL, hProgram->hCmdLine, NULL, hProgram->hWorkDir, hProgram->nCmdShow);
|
||||
|
||||
WinExec(lpszCmdLine, program->nCmdShow);
|
||||
if (Globals.bMinOnRun) CloseWindow(Globals.hMainWnd);
|
||||
if (Globals.bMinOnRun)
|
||||
CloseWindow(Globals.hMainWnd);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
@ -281,86 +286,51 @@ VOID PROGRAM_ExecuteProgram(HLOCAL hProgram)
|
|||
* PROGRAM_DeleteProgram
|
||||
*/
|
||||
|
||||
VOID PROGRAM_DeleteProgram(HLOCAL hProgram, BOOL bUpdateGrpFile)
|
||||
VOID PROGRAM_DeleteProgram(PROGRAM* hProgram, BOOL bUpdateGrpFile)
|
||||
{
|
||||
PROGRAM *program = LocalLock(hProgram);
|
||||
PROGGROUP *group = LocalLock(program->hGroup);
|
||||
PROGGROUP* group;
|
||||
|
||||
group->hActiveProgram = 0;
|
||||
group = hProgram->hGroup;
|
||||
if (hProgram->hGroup->hActiveProgram == hProgram)
|
||||
group->hActiveProgram = NULL;
|
||||
|
||||
if (program->hPrior)
|
||||
((PROGRAM*)LocalLock(program->hPrior))->hNext = program->hNext;
|
||||
else
|
||||
((PROGGROUP*)LocalLock(program->hGroup))->hPrograms = program->hNext;
|
||||
SendMessageA(group->hListView, LVM_DELETEITEM, hProgram->iItem, 0);
|
||||
|
||||
if (program->hNext)
|
||||
((PROGRAM*)LocalLock(program->hNext))->hPrior = program->hPrior;
|
||||
if (hProgram->hPrior)
|
||||
hProgram->hPrior->hNext = hProgram->hNext;
|
||||
else
|
||||
hProgram->hGroup->hPrograms = hProgram->hNext;
|
||||
|
||||
if (bUpdateGrpFile)
|
||||
GRPFILE_WriteGroupFile(program->hGroup);
|
||||
if (hProgram->hNext)
|
||||
hProgram->hNext->hPrior = hProgram->hPrior;
|
||||
|
||||
if (bUpdateGrpFile)
|
||||
GRPFILE_WriteGroupFile(hProgram->hGroup);
|
||||
|
||||
DestroyWindow(program->hWnd);
|
||||
#if 0
|
||||
if (program->hIcon)
|
||||
DestroyIcon(program->hIcon);
|
||||
DestroyWindow(program->hWnd);
|
||||
if (program->hIcon)
|
||||
DestroyIcon(program->hIcon);
|
||||
#endif
|
||||
LocalFree(program->hName);
|
||||
LocalFree(program->hCmdLine);
|
||||
LocalFree(program->hIconFile);
|
||||
LocalFree(program->hWorkDir);
|
||||
LocalFree(hProgram);
|
||||
|
||||
if (hProgram->Tags)
|
||||
Free(hProgram->Tags);
|
||||
Free(hProgram->hName);
|
||||
Free(hProgram->hCmdLine);
|
||||
Free(hProgram->hIconFile);
|
||||
Free(hProgram->hWorkDir);
|
||||
Free(hProgram);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* PROGRAM_FirstProgram
|
||||
*/
|
||||
|
||||
HLOCAL PROGRAM_FirstProgram(HLOCAL hGroup)
|
||||
{
|
||||
PROGGROUP *group;
|
||||
if (!hGroup) return(0);
|
||||
group = LocalLock(hGroup);
|
||||
return(group->hPrograms);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* PROGRAM_NextProgram
|
||||
*/
|
||||
|
||||
HLOCAL PROGRAM_NextProgram(HLOCAL hProgram)
|
||||
{
|
||||
PROGRAM *program;
|
||||
if (!hProgram) return(0);
|
||||
program = LocalLock(hProgram);
|
||||
return(program->hNext);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* PROGRAM_ActiveProgram
|
||||
*/
|
||||
|
||||
HLOCAL PROGRAM_ActiveProgram(HLOCAL hGroup)
|
||||
PROGRAM* PROGRAM_ActiveProgram(PROGGROUP* hGroup)
|
||||
{
|
||||
PROGGROUP *group;
|
||||
if (!hGroup) return(0);
|
||||
group = LocalLock(hGroup);
|
||||
if (IsIconic(group->hWnd)) return(0);
|
||||
|
||||
return(group->hActiveProgram);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* PROGRAM_ProgramName
|
||||
*/
|
||||
|
||||
LPCSTR PROGRAM_ProgramName(HLOCAL hProgram)
|
||||
{
|
||||
PROGRAM *program;
|
||||
if (!hProgram) return(0);
|
||||
program = LocalLock(hProgram);
|
||||
return(LocalLock(program->hName));
|
||||
if (!hGroup) return NULL;
|
||||
if (IsIconic(hGroup->hWnd)) return NULL;
|
||||
return hGroup->hActiveProgram;
|
||||
}
|
||||
|
|
|
@ -19,26 +19,34 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
/*
|
||||
* PROJECT: ReactOS Program Manager
|
||||
* COPYRIGHT: GPL - See COPYING in the top level directory
|
||||
* FILE: base/shell/progman/resource.h
|
||||
* PURPOSE: ProgMan resource header
|
||||
* PROGRAMMERS: Ulrich Schmid
|
||||
* Sylvain Petreolle
|
||||
* Hermes Belusca-Maito (hermes.belusca@sfr.fr)
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
/* Icon */
|
||||
#define IDI_APPICON 1
|
||||
#ifndef IDC_STATIC
|
||||
#define IDC_STATIC -1
|
||||
#endif
|
||||
|
||||
/* Resource names */
|
||||
#define IDD_MAIN 1
|
||||
#define IDD_NEW 2
|
||||
#define IDD_OPEN 3
|
||||
#define IDD_MOVE 4
|
||||
#define IDD_COPY 5
|
||||
#define IDD_DELETE 6
|
||||
#define IDD_GROUP 7
|
||||
#define IDD_PROGRAM 8
|
||||
#define IDD_SYMBOL 9
|
||||
#define IDD_EXECUTE 10
|
||||
/* Icons */
|
||||
#define IDI_APPICON 1
|
||||
#define IDI_GROUP_PERSONAL_ICON 8
|
||||
#define IDI_GROUP_COMMON_ICON 9
|
||||
#define IDI_ROSLOGO 10
|
||||
#define IDI_GROUP_ICON 48
|
||||
#define IDI_TERMINAL 49
|
||||
|
||||
/* Accelerators */
|
||||
#define IDA_ACCEL 1
|
||||
|
||||
/* Stringtable index */
|
||||
/* String table index */
|
||||
#define IDS_PROGRAM_MANAGER 0x02
|
||||
#define IDS_ERROR 0x03
|
||||
#define IDS_WARNING 0x04
|
||||
|
@ -46,21 +54,22 @@
|
|||
#define IDS_DELETE 0x06
|
||||
#define IDS_DELETE_GROUP_s 0x07
|
||||
#define IDS_DELETE_PROGRAM_s 0x08
|
||||
#define IDS_NOT_IMPLEMENTED 0x09
|
||||
#define IDS_FILE_READ_ERROR_s 0x0a
|
||||
#define IDS_FILE_WRITE_ERROR_s 0x0b
|
||||
#define IDS_GRPFILE_READ_ERROR_s 0x0c
|
||||
#define IDS_OUT_OF_MEMORY 0x0d
|
||||
#define IDS_WINHELP_ERROR 0x0e
|
||||
#define IDS_UNKNOWN_FEATURE_s 0x0f
|
||||
#define IDS_FILE_NOT_OVERWRITTEN_s 0x10
|
||||
#define IDS_SAVE_GROUP_AS_s 0x11
|
||||
#define IDS_NO_HOT_KEY 0x12
|
||||
#define IDS_ALL_FILES 0x13
|
||||
#define IDS_PROGRAMS 0x14
|
||||
#define IDS_LIBRARIES_DLL 0x15
|
||||
#define IDS_SYMBOL_FILES 0x16
|
||||
#define IDS_SYMBOLS_ICO 0x17
|
||||
#define IDS_MOVE_PROGRAM_1 0x09 // FIXME: rename me!
|
||||
#define IDS_MOVE_PROGRAM_2 0x0a // FIXME: rename me!
|
||||
#define IDS_NOT_IMPLEMENTED 0x0b
|
||||
#define IDS_FILE_READ_ERROR_s 0x0c
|
||||
#define IDS_FILE_WRITE_ERROR_s 0x0d
|
||||
#define IDS_GRPFILE_READ_ERROR_s 0x0e
|
||||
#define IDS_OUT_OF_MEMORY 0x0f
|
||||
#define IDS_WINHELP_ERROR 0x10
|
||||
#define IDS_UNKNOWN_FEATURE_s 0x11
|
||||
#define IDS_FILE_NOT_OVERWRITTEN_s 0x12
|
||||
#define IDS_SAVE_GROUP_AS_s 0x13
|
||||
#define IDS_ALL_FILES 0x14
|
||||
#define IDS_PROGRAMS 0x15
|
||||
#define IDS_LIBRARIES_DLL 0x16
|
||||
#define IDS_SYMBOL_FILES 0x17
|
||||
#define IDS_SYMBOLS_ICO 0x18
|
||||
|
||||
/* Menu */
|
||||
|
||||
|
@ -76,7 +85,8 @@
|
|||
|
||||
#define PM_AUTO_ARRANGE 0x110
|
||||
#define PM_MIN_ON_RUN 0x111
|
||||
#define PM_SAVE_SETTINGS 0x113
|
||||
#define PM_SAVE_SETTINGS 0x112
|
||||
#define PM_SAVE_SETTINGS_NOW 0x113
|
||||
|
||||
#define PM_OVERLAP 0x120
|
||||
#define PM_SIDE_BY_SIDE 0x121
|
||||
|
@ -89,51 +99,51 @@
|
|||
*/
|
||||
|
||||
#define PM_CONTENTS 0x131
|
||||
#define PM_ABOUT 0x142
|
||||
|
||||
#define PM_ABOUT_WINE 0x142
|
||||
|
||||
/* Dialogs */
|
||||
#define IDD_MAIN 1
|
||||
#define IDD_NEW 2
|
||||
#define IDD_COPY_MOVE 4
|
||||
#define IDD_GROUP 6
|
||||
#define IDD_PROGRAM 7
|
||||
#define IDD_SYMBOL 8
|
||||
#define IDD_EXECUTE 9
|
||||
|
||||
/* Dialog `New' */
|
||||
|
||||
/* RADIOBUTTON: The next two must be in sequence */
|
||||
#define PM_NEW_GROUP 0x150
|
||||
#define PM_NEW_PROGRAM 0x151
|
||||
#define PM_NEW_GROUP_TXT 0x152
|
||||
#define PM_NEW_PROGRAM_TXT 0x153
|
||||
#define PM_PERSONAL_GROUP 1001
|
||||
#define PM_COMMON_GROUP 1002
|
||||
#define PM_FORMAT_TXT 1003
|
||||
#define PM_FORMAT 1004
|
||||
|
||||
/* Dialogs `Copy', `Move' */
|
||||
|
||||
#define PM_PROGRAM 0x160
|
||||
#define PM_FROM_GROUP 0x161
|
||||
#define PM_TO_GROUP 0x162
|
||||
#define PM_TO_GROUP_TXT 0x163
|
||||
#define PM_COPY_MOVE_TXT 0x160
|
||||
#define PM_PROGRAM 0x161
|
||||
#define PM_FROM_GROUP 0x162
|
||||
#define PM_TO_GROUP 0x163
|
||||
|
||||
/* Dialogs `Group attributes' */
|
||||
|
||||
#define PM_DESCRIPTION 0x170
|
||||
#define PM_DESCRIPTION_TXT 0x171
|
||||
#define PM_FILE 0x172
|
||||
#define PM_FILE_TXT 0x173
|
||||
|
||||
/* Dialogs `Program attributes' */
|
||||
#define PM_COMMAND_LINE 0x180
|
||||
#define PM_COMMAND_LINE_TXT 0x181
|
||||
#define PM_DIRECTORY 0x182
|
||||
#define PM_DIRECTORY_TXT 0x183
|
||||
#define PM_HOT_KEY 0x184
|
||||
#define PM_HOT_KEY_TXT 0x185
|
||||
#define PM_ICON 0x186
|
||||
#define PM_OTHER_SYMBOL 0x187
|
||||
|
||||
/* Dialog `Symbol' */
|
||||
|
||||
#define PM_ICON_FILE 0x190
|
||||
#define PM_ICON_FILE_TXT 0x191
|
||||
#define PM_SYMBOL_LIST 0x192
|
||||
#define PM_SYMBOL_LIST_TXT 0x193
|
||||
|
||||
/* Dialog `Execute' */
|
||||
|
||||
#define PM_COMMAND 0x1a0
|
||||
#define PM_SYMBOL 0x1a1
|
||||
#define PM_BROWSE 0x1a2
|
||||
#define PM_HELP 0x1a3
|
||||
#define PM_COMMAND 0x1a0 // FIXME: May be merged with PM_COMMAND_LINE ?
|
||||
#define PM_SYMBOL 0x1a1 // FIXME: Rename: PM_RUN_MINIMIZED
|
||||
#define PM_NEW_VDM 0x1a2
|
||||
#define PM_BROWSE 0x1a3
|
||||
|
|
138
reactos/base/shell/progman/resource_2.h
Normal file
138
reactos/base/shell/progman/resource_2.h
Normal file
|
@ -0,0 +1,138 @@
|
|||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ generated include file.
|
||||
// Used by new_resources.rc
|
||||
//
|
||||
|
||||
#include <winuser.h>
|
||||
|
||||
#define IDHELP 9
|
||||
|
||||
|
||||
#ifndef IDC_STATIC
|
||||
#define IDC_STATIC -1
|
||||
#endif
|
||||
|
||||
/* Icons */
|
||||
#define IDI_APPICON 1
|
||||
#define IDI_GROUP_PERSONAL_ICON 8
|
||||
#define IDI_GROUP_COMMON_ICON 9
|
||||
#define IDI_ROSLOGO 10
|
||||
#define IDI_GROUP_ICON 48
|
||||
#define IDI_TERMINAL 49
|
||||
|
||||
/* Accelerators */
|
||||
#define IDA_ACCEL 1
|
||||
|
||||
/* String table index */
|
||||
#define IDS_PROGRAM_MANAGER 0x02
|
||||
#define IDS_ERROR 0x03
|
||||
#define IDS_WARNING 0x04
|
||||
#define IDS_INFO 0x05
|
||||
#define IDS_DELETE 0x06
|
||||
#define IDS_DELETE_GROUP_s 0x07
|
||||
#define IDS_DELETE_PROGRAM_s 0x08
|
||||
#define IDS_MOVE_PROGRAM_1 0x09 // FIXME: rename me!
|
||||
#define IDS_MOVE_PROGRAM_2 0x0a // FIXME: rename me!
|
||||
#define IDS_NOT_IMPLEMENTED 0x0b
|
||||
#define IDS_FILE_READ_ERROR_s 0x0c
|
||||
#define IDS_FILE_WRITE_ERROR_s 0x0d
|
||||
#define IDS_GRPFILE_READ_ERROR_s 0x0e
|
||||
#define IDS_OUT_OF_MEMORY 0x0f
|
||||
#define IDS_WINHELP_ERROR 0x10
|
||||
#define IDS_UNKNOWN_FEATURE_s 0x11
|
||||
#define IDS_FILE_NOT_OVERWRITTEN_s 0x12
|
||||
#define IDS_SAVE_GROUP_AS_s 0x13
|
||||
#define IDS_ALL_FILES 0x14
|
||||
#define IDS_PROGRAMS 0x15
|
||||
#define IDS_LIBRARIES_DLL 0x16
|
||||
#define IDS_SYMBOL_FILES 0x17
|
||||
#define IDS_SYMBOLS_ICO 0x18
|
||||
|
||||
/* Menu */
|
||||
|
||||
#define MAIN_MENU 0x109
|
||||
#define PM_NEW 0x100
|
||||
#define PM_OPEN 0x101
|
||||
#define PM_MOVE 0x102
|
||||
#define PM_COPY 0x103
|
||||
#define PM_DELETE 0x104
|
||||
#define PM_ATTRIBUTES 0x105
|
||||
#define PM_EXECUTE 0x107
|
||||
#define PM_EXIT 0x108
|
||||
|
||||
#define PM_AUTO_ARRANGE 0x110
|
||||
#define PM_MIN_ON_RUN 0x111
|
||||
#define PM_SAVE_SETTINGS 0x112
|
||||
#define PM_SAVE_SETTINGS_NOW 0x113
|
||||
|
||||
#define PM_OVERLAP 0x120
|
||||
#define PM_SIDE_BY_SIDE 0x121
|
||||
#define PM_ARRANGE 0x122
|
||||
#define PM_FIRST_CHILD 0x3030
|
||||
|
||||
/*
|
||||
*#define PM_FIRST_LANGUAGE 0x400
|
||||
*#define PM_LAST_LANGUAGE 0x499
|
||||
*/
|
||||
|
||||
#define PM_CONTENTS 0x131
|
||||
#define PM_ABOUT 0x142
|
||||
|
||||
|
||||
/* Dialogs */
|
||||
#define IDD_MAIN 1
|
||||
#define IDD_NEW 2
|
||||
#define IDD_COPY_MOVE 4
|
||||
#define IDD_GROUP 6
|
||||
#define IDD_PROGRAM 7
|
||||
#define IDD_SYMBOL 8
|
||||
#define IDD_EXECUTE 9
|
||||
|
||||
/* Dialog `New' */
|
||||
|
||||
/* RADIOBUTTON: The next two must be in sequence */
|
||||
#define PM_NEW_GROUP 0x150
|
||||
#define PM_NEW_PROGRAM 0x151
|
||||
#define PM_PERSONAL_GROUP 1001
|
||||
#define PM_COMMON_GROUP 1002
|
||||
#define PM_FORMAT_TXT 1003
|
||||
#define PM_FORMAT 1004
|
||||
|
||||
/* Dialogs `Copy', `Move' */
|
||||
#define PM_COPY_MOVE_TXT 0x160
|
||||
#define PM_PROGRAM 0x161
|
||||
#define PM_FROM_GROUP 0x162
|
||||
#define PM_TO_GROUP 0x163
|
||||
|
||||
/* Dialogs `Group attributes' */
|
||||
#define PM_DESCRIPTION 0x170
|
||||
#define PM_FILE 0x172
|
||||
|
||||
/* Dialogs `Program attributes' */
|
||||
#define PM_COMMAND_LINE 0x180
|
||||
#define PM_DIRECTORY 0x182
|
||||
#define PM_HOT_KEY 0x184
|
||||
#define PM_ICON 0x186
|
||||
#define PM_OTHER_SYMBOL 0x187
|
||||
|
||||
/* Dialog `Symbol' */
|
||||
#define PM_ICON_FILE 0x190
|
||||
#define PM_SYMBOL_LIST 0x192
|
||||
|
||||
/* Dialog `Execute' */
|
||||
#define PM_COMMAND 0x1a0 // FIXME: May be merged with PM_COMMAND_LINE ?
|
||||
#define PM_SYMBOL 0x1a1 // FIXME: Rename: PM_RUN_MINIMIZED
|
||||
#define PM_NEW_VDM 0x1a2
|
||||
#define PM_BROWSE 0x1a3
|
||||
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 106
|
||||
#define _APS_NEXT_COMMAND_VALUE 40002
|
||||
#define _APS_NEXT_CONTROL_VALUE 1001
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
|
@ -19,47 +19,43 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
/*
|
||||
* PROJECT: ReactOS Program Manager
|
||||
* COPYRIGHT: GPL - See COPYING in the top level directory
|
||||
* FILE: base/shell/progman/string.c
|
||||
* PURPOSE: String utility functions
|
||||
* PROGRAMMERS: Ulrich Schmid
|
||||
* Sylvain Petreolle
|
||||
* Hermes Belusca-Maito (hermes.belusca@sfr.fr)
|
||||
*/
|
||||
|
||||
#include "progman.h"
|
||||
|
||||
/* Class names */
|
||||
WCHAR szTitle[256]; // MAX_STRING_LEN ?
|
||||
|
||||
WCHAR STRING_MAIN_WIN_CLASS_NAME[] = {'P','M','M','a','i','n',0};
|
||||
WCHAR STRING_MDI_WIN_CLASS_NAME[] = {'M','D','I','C','L','I','E','N','T',0};
|
||||
WCHAR STRING_GROUP_WIN_CLASS_NAME[] = {'P','M','G','r','o','u','p',0};
|
||||
WCHAR STRING_PROGRAM_WIN_CLASS_NAME[] = {'P','M','P','r','o','g','r','a','m',0};
|
||||
VOID STRING_LoadStrings(VOID)
|
||||
{
|
||||
LoadStringW(Globals.hInstance, IDS_PROGRAM_MANAGER, szTitle, ARRAYSIZE(szTitle));
|
||||
}
|
||||
|
||||
VOID STRING_LoadMenus(VOID)
|
||||
{
|
||||
#ifdef __REACTOS__
|
||||
WCHAR caption[MAX_STRING_LEN];
|
||||
#else
|
||||
CHAR caption[MAX_STRING_LEN];
|
||||
#endif
|
||||
HMENU hMainMenu;
|
||||
HMENU hMainMenu;
|
||||
|
||||
/* Set frame caption */
|
||||
#ifdef __REACTOS__
|
||||
LoadStringW(Globals.hInstance, IDS_PROGRAM_MANAGER, caption, sizeof(caption));
|
||||
SetWindowTextW(Globals.hMainWnd, caption);
|
||||
#else
|
||||
LoadStringA(Globals.hInstance, IDS_PROGRAM_MANAGER, caption, sizeof(caption));
|
||||
SetWindowTextA(Globals.hMainWnd, caption);
|
||||
#endif
|
||||
/* Create the menu */
|
||||
hMainMenu = LoadMenuW(Globals.hInstance, MAKEINTRESOURCEW(MAIN_MENU));
|
||||
Globals.hFileMenu = GetSubMenu(hMainMenu, 0);
|
||||
Globals.hOptionMenu = GetSubMenu(hMainMenu, 1);
|
||||
Globals.hWindowsMenu = GetSubMenu(hMainMenu, 2);
|
||||
Globals.hLanguageMenu = GetSubMenu(hMainMenu, 3);
|
||||
|
||||
/* Create menu */
|
||||
hMainMenu = LoadMenuW(Globals.hInstance, MAKEINTRESOURCEW(MAIN_MENU));
|
||||
Globals.hFileMenu = GetSubMenu(hMainMenu, 0);
|
||||
Globals.hOptionMenu = GetSubMenu(hMainMenu, 1);
|
||||
Globals.hWindowsMenu = GetSubMenu(hMainMenu, 2);
|
||||
Globals.hLanguageMenu = GetSubMenu(hMainMenu, 3);
|
||||
if (Globals.hMDIWnd)
|
||||
SendMessageW(Globals.hMDIWnd, WM_MDISETMENU, (WPARAM)hMainMenu, (LPARAM)Globals.hWindowsMenu);
|
||||
else
|
||||
SetMenu(Globals.hMainWnd, hMainMenu);
|
||||
|
||||
if (Globals.hMDIWnd)
|
||||
SendMessageW(Globals.hMDIWnd, WM_MDISETMENU,
|
||||
(WPARAM) hMainMenu,
|
||||
(LPARAM) Globals.hWindowsMenu);
|
||||
else SetMenu(Globals.hMainWnd, hMainMenu);
|
||||
|
||||
/* Destroy old menu */
|
||||
if (Globals.hMainMenu) DestroyMenu(Globals.hMainMenu);
|
||||
Globals.hMainMenu = hMainMenu;
|
||||
/* Destroy the old menu */
|
||||
if (Globals.hMainMenu)
|
||||
DestroyMenu(Globals.hMainMenu);
|
||||
Globals.hMainMenu = hMainMenu;
|
||||
}
|
||||
|
|
|
@ -242,7 +242,7 @@ reactos/base/applications/regedit # Out of sync
|
|||
reactos/base/applications/winhlp32 # Synced to WineStaging-1.9.4
|
||||
reactos/base/applications/wordpad # Synced to WineStaging-1.9.4
|
||||
reactos/base/services/rpcss # Synced to WineStaging-1.9.4
|
||||
reactos/base/shell/progman # Synced to WineStaging-1.9.4
|
||||
reactos/base/shell/progman # Forked at WineStaging-1.9.4
|
||||
reactos/base/system/expand # Synced to WineStaging-1.9.4
|
||||
reactos/base/system/msiexec # Synced to WineStaging-1.9.4
|
||||
reactos/modules/rosapps/winfile # Autosync
|
||||
|
|
Loading…
Reference in a new issue