Commit 6109f05e authored by Alexandre Julliard's avatar Alexandre Julliard

progman: Avoid Unicode macros.

parent e12d39dc
MODULE = progman.exe
APPMODE = -mwindows
EXTRADEFS = -DWINE_NO_UNICODE_MACROS
IMPORTS = shell32 comdlg32 user32 gdi32
C_SRCS = \
......
......@@ -44,12 +44,12 @@ static LRESULT CALLBACK GROUP_GroupWndProc(HWND hWnd, UINT msg,
case WM_CHILDACTIVATE:
case WM_NCLBUTTONDOWN:
Globals.hActiveGroup = (HLOCAL) GetWindowLongPtr(hWnd, 0);
Globals.hActiveGroup = (HLOCAL)GetWindowLongPtrW(hWnd, 0);
EnableMenuItem(Globals.hFileMenu, PM_MOVE , MF_GRAYED);
EnableMenuItem(Globals.hFileMenu, PM_COPY , MF_GRAYED);
break;
}
return(DefMDIChildProc(hWnd, msg, wParam, lParam));
return DefMDIChildProcW(hWnd, msg, wParam, lParam);
}
/***********************************************************************
......@@ -59,20 +59,20 @@ static LRESULT CALLBACK GROUP_GroupWndProc(HWND hWnd, UINT msg,
ATOM GROUP_RegisterGroupWinClass(void)
{
WNDCLASS class;
WNDCLASSW class;
class.style = CS_HREDRAW | CS_VREDRAW;
class.lpfnWndProc = GROUP_GroupWndProc;
class.cbClsExtra = 0;
class.cbWndExtra = sizeof(LONG_PTR);
class.hInstance = Globals.hInstance;
class.hIcon = LoadIcon (0, IDI_WINLOGO);
class.hCursor = LoadCursor (0, IDC_ARROW);
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;
return RegisterClass(&class);
return RegisterClassW(&class);
}
/***********************************************************************
......@@ -118,12 +118,12 @@ HLOCAL GROUP_AddGroup(LPCSTR lpszName, LPCSTR lpszGrpFile, INT nCmdShow,
BOOL bSuppressShowWindow)
{
PROGGROUP *group, *prior;
MDICREATESTRUCT cs;
MDICREATESTRUCTW cs;
INT seqnum;
HLOCAL hPrior, *p;
HLOCAL hGroup = LocalAlloc(LMEM_FIXED, sizeof(PROGGROUP));
HLOCAL hName = LocalAlloc(LMEM_FIXED, 1 + lstrlen(lpszName));
HLOCAL hGrpFile = LocalAlloc(LMEM_FIXED, 1 + lstrlen(lpszGrpFile));
HLOCAL hName = LocalAlloc(LMEM_FIXED, 1 + strlen(lpszName));
HLOCAL hGrpFile = LocalAlloc(LMEM_FIXED, 1 + strlen(lpszGrpFile));
if (!hGroup || !hName || !hGrpFile)
{
MAIN_MessageBoxIDS(IDS_OUT_OF_MEMORY, IDS_ERROR, MB_OK);
......@@ -132,8 +132,8 @@ HLOCAL GROUP_AddGroup(LPCSTR lpszName, LPCSTR lpszGrpFile, INT nCmdShow,
if (hGrpFile) LocalFree(hGrpFile);
return(0);
}
memcpy(LocalLock(hName), lpszName, 1 + lstrlen(lpszName));
memcpy(LocalLock(hGrpFile), lpszGrpFile, 1 + lstrlen(lpszGrpFile));
memcpy(LocalLock(hName), lpszName, 1 + strlen(lpszName));
memcpy(LocalLock(hGrpFile), lpszGrpFile, 1 + strlen(lpszGrpFile));
Globals.hActiveGroup = hGroup;
......@@ -169,7 +169,7 @@ HLOCAL GROUP_AddGroup(LPCSTR lpszName, LPCSTR lpszGrpFile, INT nCmdShow,
group->hActiveProgram = 0;
cs.szClass = STRING_GROUP_WIN_CLASS_NAME;
cs.szTitle = lpszName;
cs.szTitle = NULL;
cs.hOwner = 0;
cs.x = x;
cs.y = y;
......@@ -178,9 +178,9 @@ HLOCAL GROUP_AddGroup(LPCSTR lpszName, LPCSTR lpszGrpFile, INT nCmdShow,
cs.style = 0;
cs.lParam = 0;
group->hWnd = (HWND)SendMessage(Globals.hMDIWnd, WM_MDICREATE, 0, (LPARAM)&cs);
SetWindowLongPtr(group->hWnd, 0, (LONG_PTR) hGroup);
group->hWnd = (HWND)SendMessageA(Globals.hMDIWnd, WM_MDICREATE, 0, (LPARAM)&cs);
SetWindowTextA( group->hWnd, lpszName );
SetWindowLongPtrW(group->hWnd, 0, (LONG_PTR) hGroup);
#if 1
if (!bSuppressShowWindow) /* FIXME shouldn't be necessary */
......@@ -203,8 +203,8 @@ VOID GROUP_ModifyGroup(HLOCAL hGroup)
PROGGROUP *group = LocalLock(hGroup);
CHAR szName[MAX_PATHNAME_LEN];
CHAR szFile[MAX_PATHNAME_LEN];
lstrcpyn(szName, LocalLock(group->hName), MAX_PATHNAME_LEN);
lstrcpyn(szFile, LocalLock(group->hGrpFile), MAX_PATHNAME_LEN);
lstrcpynA(szName, LocalLock(group->hName), MAX_PATHNAME_LEN);
lstrcpynA(szFile, LocalLock(group->hGrpFile), MAX_PATHNAME_LEN);
if (!DIALOG_GroupAttributes(szName, szFile, MAX_PATHNAME_LEN)) return;
......@@ -220,7 +220,7 @@ VOID GROUP_ModifyGroup(HLOCAL hGroup)
/* FIXME Update progman.ini */
SetWindowText(group->hWnd, szName);
SetWindowTextA(group->hWnd, szName);
}
/***********************************************************************
......@@ -259,7 +259,7 @@ VOID GROUP_DeleteGroup(HLOCAL hGroup)
/* FIXME Update progman.ini */
SendMessage(Globals.hMDIWnd, WM_MDIDESTROY, (WPARAM)group->hWnd, 0);
SendMessageW(Globals.hMDIWnd, WM_MDIDESTROY, (WPARAM)group->hWnd, 0);
LocalFree(group->hName);
LocalFree(group->hGrpFile);
......@@ -324,7 +324,3 @@ LPCSTR GROUP_GroupName(HLOCAL hGroup)
group = LocalLock(hGroup);
return(LocalLock(group->hName));
}
/* Local Variables: */
/* c-file-style: "GNU" */
/* End: */
......@@ -50,10 +50,10 @@ static BOOL GRPFILE_DoWriteGroupFile(HFILE file, PROGGROUP *group);
static VOID GRPFILE_ModifyFileName(LPSTR lpszNewName, LPCSTR lpszOrigName,
INT nSize, BOOL bModify)
{
lstrcpyn(lpszNewName, lpszOrigName, nSize);
lstrcpynA(lpszNewName, lpszOrigName, nSize);
lpszNewName[nSize-1] = '\0';
if (!bModify) return;
if (!lstrcmpi(lpszNewName + strlen(lpszNewName) - 4, ".grp"))
if (!lstrcmpiA(lpszNewName + strlen(lpszNewName) - 4, ".grp"))
lpszNewName[strlen(lpszNewName) - 1] = '\0';
}
......@@ -382,12 +382,12 @@ BOOL GRPFILE_WriteGroupFile(HLOCAL hGroup)
{
/* Warn about the (possible) incompatibility */
CHAR msg[MAX_PATHNAME_LEN + 200];
wsprintf(msg,
wsprintfA(msg,
"Group files written by this DRAFT Program Manager "
"possibly cannot be read by the Microsoft Program Manager!!\n"
"Are you sure to write %s?", szPath);
if (IDOK != MessageBox(Globals.hMainWnd, msg, "WARNING",
MB_OKCANCEL | MB_DEFBUTTON2)) return FALSE;
if (IDOK != MessageBoxA(Globals.hMainWnd, msg, "WARNING",
MB_OKCANCEL | MB_DEFBUTTON2)) return FALSE;
}
/* Open file */
......@@ -425,9 +425,9 @@ static VOID GRPFILE_CalculateSizes(PROGRAM *program, INT *Progs, INT *Icons,
DeleteObject( info.hbmColor );
*Progs += 24;
*Progs += lstrlen(LocalLock(program->hName)) + 1;
*Progs += lstrlen(LocalLock(program->hCmdLine)) + 1;
*Progs += lstrlen(LocalLock(program->hIconFile)) + 1;
*Progs += strlen(LocalLock(program->hName)) + 1;
*Progs += strlen(LocalLock(program->hCmdLine)) + 1;
*Progs += strlen(LocalLock(program->hIconFile)) + 1;
*Icons += 12; /* IconInfo */
*Icons += *sizeAnd;
......@@ -540,7 +540,7 @@ static BOOL GRPFILE_DoWriteGroupFile(HFILE file, PROGGROUP *group)
hProgram = program->hNext;
}
Title = 34 + NumProg * 2;
Progs = Title + lstrlen(lpszTitle) + 1;
Progs = Title + strlen(lpszTitle) + 1;
Icons += Progs;
Extension += Icons;
......@@ -589,8 +589,7 @@ static BOOL GRPFILE_DoWriteGroupFile(HFILE file, PROGGROUP *group)
}
/* Title */
if ((UINT)HFILE_ERROR == GRPFILE_WriteWithChecksum(file, lpszTitle,
lstrlen(lpszTitle) + 1))
if ((UINT)HFILE_ERROR == GRPFILE_WriteWithChecksum(file, lpszTitle, strlen(lpszTitle) + 1))
return FALSE;
/* Program entries */
......@@ -618,15 +617,15 @@ static BOOL GRPFILE_DoWriteGroupFile(HFILE file, PROGGROUP *group)
PUT_SHORT(buffer, 16, CurrIcon + 12);
ptr = CurrProg + 24;
PUT_SHORT(buffer, 18, ptr);
ptr += lstrlen(Name) + 1;
ptr += strlen(Name) + 1;
PUT_SHORT(buffer, 20, ptr);
ptr += lstrlen(CmdLine) + 1;
ptr += strlen(CmdLine) + 1;
PUT_SHORT(buffer, 22, ptr);
if ((UINT)HFILE_ERROR == GRPFILE_WriteWithChecksum(file, buffer, 24) ||
(UINT)HFILE_ERROR == GRPFILE_WriteWithChecksum(file, Name, lstrlen(Name) + 1) ||
(UINT)HFILE_ERROR == GRPFILE_WriteWithChecksum(file, CmdLine, lstrlen(CmdLine) + 1) ||
(UINT)HFILE_ERROR == GRPFILE_WriteWithChecksum(file, IconFile, lstrlen(IconFile) + 1))
(UINT)HFILE_ERROR == GRPFILE_WriteWithChecksum(file, Name, strlen(Name) + 1) ||
(UINT)HFILE_ERROR == GRPFILE_WriteWithChecksum(file, CmdLine, strlen(CmdLine) + 1) ||
(UINT)HFILE_ERROR == GRPFILE_WriteWithChecksum(file, IconFile, strlen(IconFile) + 1))
return FALSE;
CurrProg = next_prog;
......@@ -685,9 +684,9 @@ static BOOL GRPFILE_DoWriteGroupFile(HFILE file, PROGGROUP *group)
{
PUT_SHORT(buffer, 0, 0x8101);
PUT_SHORT(buffer, 2, seqnum);
PUT_SHORT(buffer, 4, 7 + lstrlen(lpszWorkDir));
PUT_SHORT(buffer, 4, 7 + strlen(lpszWorkDir));
if ((UINT)HFILE_ERROR == GRPFILE_WriteWithChecksum(file, buffer, 6) ||
(UINT)HFILE_ERROR == GRPFILE_WriteWithChecksum(file, lpszWorkDir, lstrlen(lpszWorkDir) + 1))
(UINT)HFILE_ERROR == GRPFILE_WriteWithChecksum(file, lpszWorkDir, strlen(lpszWorkDir) + 1))
return FALSE;
}
......@@ -729,7 +728,3 @@ static BOOL GRPFILE_DoWriteGroupFile(HFILE file, PROGGROUP *group)
return TRUE;
}
/* Local Variables: */
/* c-file-style: "GNU" */
/* End: */
......@@ -190,23 +190,24 @@ VOID DIALOG_Execute(void);
VOID STRING_LoadMenus(VOID);
/* Class names */
extern CHAR STRING_MAIN_WIN_CLASS_NAME[];
extern CHAR STRING_MDI_WIN_CLASS_NAME[];
extern CHAR STRING_GROUP_WIN_CLASS_NAME[];
extern CHAR STRING_PROGRAM_WIN_CLASS_NAME[];
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[];
/* Resource names */
extern CHAR STRING_ACCEL[];
extern CHAR STRING_MAIN[];
extern CHAR STRING_NEW[];
extern CHAR STRING_OPEN[];
extern CHAR STRING_MOVE[];
extern CHAR STRING_COPY[];
extern CHAR STRING_DELETE[];
extern CHAR STRING_GROUP[];
extern CHAR STRING_PROGRAM[];
extern CHAR STRING_SYMBOL[];
extern CHAR STRING_EXECUTE[];
#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
#define IDA_ACCEL 1
/* Stringtable index */
#define IDS_PROGRAM_MANAGER 0x02
......
......@@ -83,7 +83,7 @@ IDS_SYMBOL_FILES, "Icon files"
IDS_SYMBOLS_ICO, "Icons (*.ico)"
}
ACCEL ACCELERATORS
IDA_ACCEL ACCELERATORS
{
VK_F1, PM_CONTENTS, VIRTKEY
VK_RETURN, PM_ATTRIBUTES, VIRTKEY, ALT
......@@ -91,7 +91,7 @@ VK_RETURN, PM_ATTRIBUTES, VIRTKEY, ALT
/* Dialog `New' */
DIALOG_NEW DIALOG 0, 0, 170, 65
IDD_NEW DIALOG 0, 0, 170, 65
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
FONT 8, "MS Shell Dlg"
CAPTION "New"
......@@ -107,7 +107,7 @@ PUSHBUTTON "&Help", PM_HELP, 105, 45, 60, 15, WS_TABSTOP
/* Dialog `Move' */
DIALOG_MOVE DIALOG 0, 0, 250, 65
IDD_MOVE DIALOG 0, 0, 250, 65
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
FONT 8, "MS Shell Dlg"
CAPTION "Move Program"
......@@ -125,7 +125,7 @@ PUSHBUTTON "&Help", PM_HELP, 185, 45, 60, 15, WS_TABSTO
/* Dialog `Copy' */
DIALOG_COPY DIALOG 0, 0, 250, 65
IDD_COPY DIALOG 0, 0, 250, 65
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
FONT 8, "MS Shell Dlg"
CAPTION "Copy Program"
......@@ -143,7 +143,7 @@ PUSHBUTTON "&Help", PM_HELP, 185, 45, 60, 15, WS_TABSTO
/* Dialog `Group attributes' */
DIALOG_GROUP DIALOG 0, 0, 250, 65
IDD_GROUP DIALOG 0, 0, 250, 65
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
FONT 8, "MS Shell Dlg"
CAPTION "Program Group Attributes"
......@@ -159,7 +159,7 @@ PUSHBUTTON "&Help", PM_HELP, 185, 45, 60, 15, WS_TABSTO
/* Dialog `Program attributes' */
DIALOG_PROGRAM DIALOG 0, 0, 275, 105
IDD_PROGRAM DIALOG 0, 0, 275, 105
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
FONT 8, "MS Shell Dlg"
CAPTION "Program Attributes"
......@@ -183,7 +183,7 @@ PUSHBUTTON "&Help", PM_HELP, 200, 85, 70, 15, WS
/* Dialog `Symbol' */
DIALOG_SYMBOL DIALOG 0, 0, 240, 85
IDD_SYMBOL DIALOG 0, 0, 240, 85
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
FONT 8, "MS Shell Dlg"
CAPTION "Change Icon"
......@@ -201,7 +201,7 @@ PUSHBUTTON "&Help", PM_HELP, 175, 65, 60, 15, WS_TABSTOP
/* Dialog `Execute' */
DIALOG_EXECUTE DIALOG 0, 0, 200, 85
IDD_EXECUTE DIALOG 0, 0, 200, 85
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
FONT 8, "MS Shell Dlg"
CAPTION "Execute Program"
......
......@@ -35,7 +35,7 @@ static LRESULT CALLBACK PROGRAM_ProgramWndProc(HWND hWnd, UINT msg, WPARAM wPara
{
case WM_NCLBUTTONDOWN:
{
HLOCAL hProgram = (HLOCAL) GetWindowLongPtr(hWnd, 0);
HLOCAL hProgram = (HLOCAL) GetWindowLongPtrW(hWnd, 0);
PROGRAM *program = LocalLock(hProgram);
PROGGROUP *group = LocalLock(program->hGroup);
group->hActiveProgram = hProgram;
......@@ -45,7 +45,7 @@ static LRESULT CALLBACK PROGRAM_ProgramWndProc(HWND hWnd, UINT msg, WPARAM wPara
}
case WM_NCLBUTTONDBLCLK:
{
PROGRAM_ExecuteProgram((HLOCAL) GetWindowLongPtr(hWnd, 0));
PROGRAM_ExecuteProgram((HLOCAL) GetWindowLongPtrW(hWnd, 0));
return(0);
}
......@@ -56,14 +56,14 @@ static LRESULT CALLBACK PROGRAM_ProgramWndProc(HWND hWnd, UINT msg, WPARAM wPara
PAINTSTRUCT ps;
HDC hdc;
hdc = BeginPaint(hWnd,&ps);
program = LocalLock((HLOCAL) GetWindowLongPtr(hWnd, 0));
program = LocalLock((HLOCAL) GetWindowLongPtrW(hWnd, 0));
if (program->hIcon)
DrawIcon(hdc, 0, 0, program->hIcon);
EndPaint(hWnd,&ps);
break;
}
}
return(DefWindowProc(hWnd, msg, wParam, lParam));
return DefWindowProcW(hWnd, msg, wParam, lParam);
}
/***********************************************************************
......@@ -73,7 +73,7 @@ static LRESULT CALLBACK PROGRAM_ProgramWndProc(HWND hWnd, UINT msg, WPARAM wPara
ATOM PROGRAM_RegisterProgramWinClass(void)
{
WNDCLASS class;
WNDCLASSW class;
class.style = CS_HREDRAW | CS_VREDRAW;
class.lpfnWndProc = PROGRAM_ProgramWndProc;
......@@ -81,12 +81,12 @@ ATOM PROGRAM_RegisterProgramWinClass(void)
class.cbWndExtra = sizeof(LONG_PTR);
class.hInstance = Globals.hInstance;
class.hIcon = 0;
class.hCursor = LoadCursor (0, IDC_ARROW);
class.hCursor = LoadCursorW (0, (LPWSTR)IDC_ARROW);
class.hbrBackground = GetStockObject (WHITE_BRUSH);
class.lpszMenuName = 0;
class.lpszClassName = STRING_PROGRAM_WIN_CLASS_NAME;
return RegisterClass(&class);
return RegisterClassW(&class);
}
/***********************************************************************
......@@ -110,7 +110,7 @@ VOID PROGRAM_NewProgram(HLOCAL hGroup)
&nCmdShow, MAX_PATHNAME_LEN))
return;
if (!hIcon) hIcon = LoadIcon(0, IDI_WINLOGO);
if (!hIcon) hIcon = LoadIconW(0, (LPWSTR)IDI_WINLOGO);
if (!PROGRAM_AddProgram(hGroup, hIcon, szName, 0, 0, szCmdLine, szIconFile,
......@@ -133,10 +133,10 @@ VOID PROGRAM_ModifyProgram(HLOCAL hProgram)
CHAR szIconFile[MAX_PATHNAME_LEN];
CHAR szWorkDir[MAX_PATHNAME_LEN];
lstrcpyn(szName, LocalLock(program->hName), MAX_PATHNAME_LEN);
lstrcpyn(szCmdLine, LocalLock(program->hCmdLine), MAX_PATHNAME_LEN);
lstrcpyn(szIconFile, LocalLock(program->hIconFile), MAX_PATHNAME_LEN);
lstrcpyn(szWorkDir, LocalLock(program->hWorkDir), 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);
if (!DIALOG_ProgramAttributes(szName, szCmdLine, szWorkDir, szIconFile,
&program->hIcon, &program->nIconIndex,
......@@ -149,7 +149,7 @@ VOID PROGRAM_ModifyProgram(HLOCAL hProgram)
MAIN_ReplaceString(&program->hIconFile, szIconFile);
MAIN_ReplaceString(&program->hWorkDir, szWorkDir);
SetWindowText(program->hWnd, szName);
SetWindowTextA(program->hWnd, szName);
UpdateWindow(program->hWnd);
GRPFILE_WriteGroupFile(program->hGroup);
......@@ -171,10 +171,10 @@ HLOCAL PROGRAM_AddProgram(HLOCAL hGroup, HICON hIcon, LPCSTR lpszName,
PROGRAM *program;
HLOCAL hPrior, *p;
HLOCAL hProgram = LocalAlloc(LMEM_FIXED, sizeof(PROGRAM));
HLOCAL hName = LocalAlloc(LMEM_FIXED, 1 + lstrlen(lpszName));
HLOCAL hCmdLine = LocalAlloc(LMEM_FIXED, 1 + lstrlen(lpszCmdLine));
HLOCAL hIconFile = LocalAlloc(LMEM_FIXED, 1 + lstrlen(lpszIconFile));
HLOCAL hWorkDir = LocalAlloc(LMEM_FIXED, 1 + lstrlen(lpszWorkDir));
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)
{
MAIN_MessageBoxIDS(IDS_OUT_OF_MEMORY, IDS_ERROR, MB_OK);
......@@ -185,10 +185,10 @@ HLOCAL PROGRAM_AddProgram(HLOCAL hGroup, HICON hIcon, LPCSTR lpszName,
if (hWorkDir) LocalFree(hWorkDir);
return(0);
}
memcpy(LocalLock(hName), lpszName, 1 + lstrlen(lpszName));
memcpy(LocalLock(hCmdLine), lpszCmdLine, 1 + lstrlen(lpszCmdLine));
memcpy(LocalLock(hIconFile), lpszIconFile, 1 + lstrlen(lpszIconFile));
memcpy(LocalLock(hWorkDir), lpszWorkDir, 1 + lstrlen(lpszWorkDir));
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));
group->hActiveProgram = hProgram;
......@@ -215,12 +215,13 @@ HLOCAL PROGRAM_AddProgram(HLOCAL hGroup, HICON hIcon, LPCSTR lpszName,
program->nHotKey = nHotKey;
program->hWnd =
CreateWindow (STRING_PROGRAM_WIN_CLASS_NAME, lpszName,
CreateWindowW(STRING_PROGRAM_WIN_CLASS_NAME, NULL,
WS_CHILD | WS_CAPTION,
x, y, CW_USEDEFAULT, CW_USEDEFAULT,
group->hWnd, 0, Globals.hInstance, 0);
SetWindowLongPtr(program->hWnd, 0, (LONG_PTR) hProgram);
SetWindowTextA(program->hWnd, lpszName);
SetWindowLongPtrW(program->hWnd, 0, (LONG_PTR) hProgram);
ShowWindow (program->hWnd, SW_SHOWMINIMIZED);
SetWindowPos (program->hWnd, 0, x, y, 0, 0, SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOSIZE);
......@@ -367,7 +368,3 @@ LPCSTR PROGRAM_ProgramName(HLOCAL hProgram)
program = LocalLock(hProgram);
return(LocalLock(program->hName));
}
/* Local Variables: */
/* c-file-style: "GNU" */
/* End: */
......@@ -26,24 +26,10 @@
/* Class names */
CHAR STRING_MAIN_WIN_CLASS_NAME[] = "PMMain";
CHAR STRING_MDI_WIN_CLASS_NAME[] = "MDICLIENT";
CHAR STRING_GROUP_WIN_CLASS_NAME[] = "PMGroup";
CHAR STRING_PROGRAM_WIN_CLASS_NAME[] = "PMProgram";
/* Resource names */
CHAR STRING_ACCEL[] = "ACCEL";
CHAR STRING_MENU[] = "MENU";
CHAR STRING_NEW[] = "DIALOG_NEW";
CHAR STRING_OPEN[] = "DIALOG_OPEN";
CHAR STRING_MOVE[] = "DIALOG_MOVE";
CHAR STRING_COPY[] = "DIALOG_COPY";
CHAR STRING_DELETE[] = "DIALOG_DELETE";
CHAR STRING_GROUP[] = "DIALOG_GROUP";
CHAR STRING_PROGRAM[] = "DIALOG_PROGRAM";
CHAR STRING_SYMBOL[] = "DIALOG_SYMBOL";
CHAR STRING_EXECUTE[] = "DIALOG_EXECUTE";
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_LoadMenus(VOID)
{
......@@ -51,18 +37,18 @@ VOID STRING_LoadMenus(VOID)
HMENU hMainMenu;
/* Set frame caption */
LoadString(Globals.hInstance, IDS_PROGRAM_MANAGER, caption, sizeof(caption));
SetWindowText(Globals.hMainWnd, caption);
LoadStringA(Globals.hInstance, IDS_PROGRAM_MANAGER, caption, sizeof(caption));
SetWindowTextA(Globals.hMainWnd, caption);
/* Create menu */
hMainMenu = LoadMenu(Globals.hInstance, MAKEINTRESOURCE(MAIN_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)
SendMessage(Globals.hMDIWnd, WM_MDISETMENU,
SendMessageW(Globals.hMDIWnd, WM_MDISETMENU,
(WPARAM) hMainMenu,
(LPARAM) Globals.hWindowsMenu);
else SetMenu(Globals.hMainWnd, hMainMenu);
......@@ -71,7 +57,3 @@ VOID STRING_LoadMenus(VOID)
if (Globals.hMainMenu) DestroyMenu(Globals.hMainMenu);
Globals.hMainMenu = hMainMenu;
}
/* Local Variables: */
/* c-file-style: "GNU" */
/* End: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment