Commit d6cb3e8b authored by Mikołaj Zalewski's avatar Mikołaj Zalewski Committed by Alexandre Julliard

progman: Fix two simple bugs.

Use correctly the GetOpenFileName function. Use _lcreat instead of _lopen to create a new file.
parent 11e4b21a
......@@ -328,6 +328,7 @@ static BOOL CALLBACK DIALOG_PROGRAM_DlgProc(HWND hDlg, UINT msg, WPARAM wParam,
case PM_BROWSE:
{
CHAR filename[MAX_PATHNAME_LEN];
filename[0] = 0;
if (DIALOG_BrowsePrograms(hDlg, filename, sizeof(filename)))
SetDlgItemText(hDlg, PM_COMMAND_LINE, filename);
return TRUE;
......@@ -450,6 +451,7 @@ static BOOL CALLBACK DIALOG_SYMBOL_DlgProc(HWND hDlg, UINT msg, WPARAM wParam, L
case PM_BROWSE:
{
CHAR filename[MAX_PATHNAME_LEN];
filename[0] = 0;
if (DIALOG_BrowseSymbols(hDlg, filename, sizeof(filename)))
SetDlgItemText(hDlg, PM_ICON_FILE, filename);
return TRUE;
......@@ -518,6 +520,7 @@ static BOOL CALLBACK DIALOG_EXECUTE_DlgProc(HWND hDlg, UINT msg,
case PM_BROWSE:
{
CHAR filename[MAX_PATHNAME_LEN];
filename[0] = 0;
if (DIALOG_BrowsePrograms(hDlg, filename, sizeof(filename)))
SetDlgItemText(hDlg, PM_COMMAND, filename);
return TRUE;
......@@ -559,21 +562,19 @@ static BOOL DIALOG_Browse(HWND hDlg, LPCSTR lpszzFilter,
{
OPENFILENAME openfilename;
CHAR szPath[MAX_PATH];
CHAR szDir[MAX_PATH];
CHAR szDefaultExt[] = "exe";
ZeroMemory(&openfilename, sizeof(openfilename));
GetCurrentDirectory(sizeof(szDir), szDir);
lstrcpy(szPath,"*.exe");
/* FIXME is this correct ? */
openfilename.lStructSize = sizeof(openfilename);
openfilename.hwndOwner = Globals.hMainWnd;
openfilename.hInstance = Globals.hInstance;
openfilename.lpstrFile = szPath;
openfilename.nMaxFile = sizeof(szPath);
openfilename.lpstrFilter = lpszzFilter;
openfilename.lpstrFile = lpstrFile;
openfilename.nMaxFile = nMaxFile;
openfilename.lpstrInitialDir = szDir;
openfilename.Flags = 0;
openfilename.lpstrDefExt = szDefaultExt;
......@@ -591,7 +592,6 @@ static BOOL DIALOG_Browse(HWND hDlg, LPCSTR lpszzFilter,
openfilename.lpTemplateName = 0;
return GetOpenFileName(&openfilename);
/* FIXME */
}
/***********************************************************************
......
......@@ -399,16 +399,8 @@ BOOL GRPFILE_WriteGroupFile(HLOCAL hGroup)
MB_OKCANCEL | MB_DEFBUTTON2)) return FALSE;
}
/* FIXME */
if (OpenFile(szPath, &dummy, OF_EXIST) == HFILE_ERROR)
{
CHAR msg[MAX_PATHNAME_LEN + 200];
wsprintf(msg, "Cause of a bug you must now touch the file %s\n", szPath);
MessageBox(Globals.hMainWnd, msg, "", MB_OK);
}
/* Open file */
file = _lopen(szPath, OF_WRITE);
file = _lcreat(szPath, 0);
if (file != HFILE_ERROR)
{
ret = GRPFILE_DoWriteGroupFile(file, group);
......
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