2002-07-03 19:32:52 +00:00
|
|
|
/*
|
|
|
|
* ReactOS winfile
|
|
|
|
*
|
2002-07-06 02:44:16 +00:00
|
|
|
* dialogs.c
|
2002-07-03 19:32:52 +00:00
|
|
|
*
|
|
|
|
* Copyright (C) 2002 Robert Dickenson <robd@reactos.org>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef _MSC_VER
|
|
|
|
#include "stdafx.h"
|
|
|
|
#else
|
|
|
|
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
|
|
|
|
#include <windows.h>
|
|
|
|
#include <commctrl.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <malloc.h>
|
|
|
|
#include <memory.h>
|
|
|
|
#include <tchar.h>
|
|
|
|
#include <process.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#endif
|
|
|
|
|
2002-07-06 02:44:16 +00:00
|
|
|
#include <shellapi.h>
|
|
|
|
//#include <winspool.h>
|
|
|
|
#include <windowsx.h>
|
|
|
|
#include <shellapi.h>
|
|
|
|
#include <ctype.h>
|
|
|
|
#include <assert.h>
|
|
|
|
#define ASSERT assert
|
|
|
|
|
2002-07-09 19:46:14 +00:00
|
|
|
#include "main.h"
|
2002-07-06 02:44:16 +00:00
|
|
|
#include "about.h"
|
|
|
|
#include "dialogs.h"
|
2002-07-09 21:40:02 +00:00
|
|
|
#include "settings.h"
|
2002-07-06 02:44:16 +00:00
|
|
|
#include "utils.h"
|
|
|
|
#include "debug.h"
|
2002-07-03 19:32:52 +00:00
|
|
|
|
|
|
|
|
2002-07-09 21:46:46 +00:00
|
|
|
BOOL CALLBACK ExecuteDialogWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
2002-07-06 02:44:16 +00:00
|
|
|
{
|
|
|
|
static struct ExecuteDialog* dlg;
|
|
|
|
|
2002-07-09 19:46:14 +00:00
|
|
|
switch(message) {
|
2002-07-06 02:44:16 +00:00
|
|
|
case WM_INITDIALOG:
|
2002-07-09 19:46:14 +00:00
|
|
|
dlg = (struct ExecuteDialog*) lParam;
|
2002-07-06 02:44:16 +00:00
|
|
|
return 1;
|
|
|
|
|
|
|
|
case WM_COMMAND: {
|
2002-07-09 19:46:14 +00:00
|
|
|
int id = (int)wParam;
|
2002-07-06 02:44:16 +00:00
|
|
|
|
|
|
|
if (id == IDOK) {
|
2002-07-09 19:46:14 +00:00
|
|
|
GetWindowText(GetDlgItem(hDlg, 201), dlg->cmd, MAX_PATH);
|
|
|
|
dlg->cmdshow = Button_GetState(GetDlgItem(hDlg,214))&BST_CHECKED?
|
2002-07-06 02:44:16 +00:00
|
|
|
SW_SHOWMINIMIZED: SW_SHOWNORMAL;
|
2002-07-09 19:46:14 +00:00
|
|
|
EndDialog(hDlg, id);
|
2002-07-06 02:44:16 +00:00
|
|
|
} else if (id == IDCANCEL)
|
2002-07-09 19:46:14 +00:00
|
|
|
EndDialog(hDlg, id);
|
2002-07-06 02:44:16 +00:00
|
|
|
|
|
|
|
return 1;}
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
2002-07-03 19:32:52 +00:00
|
|
|
|
|
|
|
|
2002-07-09 21:46:46 +00:00
|
|
|
BOOL CALLBACK OptionsConfirmationWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
2002-07-09 21:40:02 +00:00
|
|
|
{
|
|
|
|
static struct ExecuteDialog* dlg;
|
|
|
|
int id;
|
|
|
|
|
|
|
|
switch (message) {
|
|
|
|
case WM_INITDIALOG:
|
|
|
|
dlg = (struct ExecuteDialog*) lParam;
|
|
|
|
Button_SetCheck(GetDlgItem(hDlg,IDC_CONFIRMATION_FILE_DELETE), Confirmation & CONFIRM_FILE_DELETE ? BST_CHECKED : BST_UNCHECKED);
|
|
|
|
Button_SetCheck(GetDlgItem(hDlg,IDC_CONFIRMATION_DIR_DELETE), Confirmation & CONFIRM_DIR_DELETE ? BST_CHECKED : BST_UNCHECKED);
|
|
|
|
Button_SetCheck(GetDlgItem(hDlg,IDC_CONFIRMATION_FILE_REPLACE), Confirmation & CONFIRM_FILE_REPLACE ? BST_CHECKED : BST_UNCHECKED);
|
|
|
|
Button_SetCheck(GetDlgItem(hDlg,IDC_CONFIRMATION_MOUSE_ACTIONS), Confirmation & CONFIRM_MOUSE_ACTIONS ? BST_CHECKED : BST_UNCHECKED);
|
|
|
|
Button_SetCheck(GetDlgItem(hDlg,IDC_CONFIRMATION_DISK_COMMANDS), Confirmation & CONFIRM_DISK_COMMANDS ? BST_CHECKED : BST_UNCHECKED);
|
|
|
|
Button_SetCheck(GetDlgItem(hDlg,IDC_CONFIRMATION_MODIFY_SYSTEM), Confirmation & CONFIRM_MODIFY_SYSTEM ? BST_CHECKED : BST_UNCHECKED);
|
|
|
|
return 1;
|
|
|
|
case WM_COMMAND:
|
|
|
|
id = (int)wParam;
|
|
|
|
if (id == IDOK) {
|
|
|
|
GetWindowText(GetDlgItem(hDlg, 201), dlg->cmd, MAX_PATH);
|
|
|
|
dlg->cmdshow = Button_GetState(GetDlgItem(hDlg,214))&BST_CHECKED?SW_SHOWMINIMIZED: SW_SHOWNORMAL;
|
|
|
|
|
|
|
|
if (Button_GetState(GetDlgItem(hDlg,IDC_CONFIRMATION_FILE_DELETE)) & BST_CHECKED)
|
|
|
|
Confirmation |= CONFIRM_FILE_DELETE;
|
|
|
|
else Confirmation &= ~CONFIRM_FILE_DELETE;
|
|
|
|
if (Button_GetState(GetDlgItem(hDlg,IDC_CONFIRMATION_DIR_DELETE)) & BST_CHECKED)
|
|
|
|
Confirmation |= CONFIRM_DIR_DELETE;
|
|
|
|
else Confirmation &= ~CONFIRM_DIR_DELETE;
|
|
|
|
if (Button_GetState(GetDlgItem(hDlg,IDC_CONFIRMATION_FILE_REPLACE)) & BST_CHECKED)
|
|
|
|
Confirmation |= CONFIRM_FILE_REPLACE;
|
|
|
|
else Confirmation &= ~CONFIRM_FILE_REPLACE;
|
|
|
|
if (Button_GetState(GetDlgItem(hDlg,IDC_CONFIRMATION_MOUSE_ACTIONS)) & BST_CHECKED)
|
|
|
|
Confirmation |= CONFIRM_MOUSE_ACTIONS;
|
|
|
|
else Confirmation &= ~CONFIRM_MOUSE_ACTIONS;
|
|
|
|
if (Button_GetState(GetDlgItem(hDlg,IDC_CONFIRMATION_DISK_COMMANDS)) & BST_CHECKED)
|
|
|
|
Confirmation |= CONFIRM_DISK_COMMANDS;
|
|
|
|
else Confirmation &= ~CONFIRM_DISK_COMMANDS;
|
|
|
|
if (Button_GetState(GetDlgItem(hDlg,IDC_CONFIRMATION_MODIFY_SYSTEM)) & BST_CHECKED)
|
|
|
|
Confirmation |= CONFIRM_MODIFY_SYSTEM;
|
|
|
|
else Confirmation &= ~CONFIRM_MODIFY_SYSTEM;
|
|
|
|
|
|
|
|
EndDialog(hDlg, id);
|
|
|
|
} else if (id == IDCANCEL)
|
|
|
|
EndDialog(hDlg, id);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-07-09 21:46:46 +00:00
|
|
|
BOOL CALLBACK ViewFileTypeWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
2002-07-09 21:40:02 +00:00
|
|
|
{
|
|
|
|
static struct ExecuteDialog* dlg;
|
|
|
|
int id;
|
|
|
|
|
|
|
|
switch (message) {
|
|
|
|
case WM_INITDIALOG:
|
|
|
|
dlg = (struct ExecuteDialog*)lParam;
|
|
|
|
Button_SetCheck(GetDlgItem(hDlg,IDC_VIEW_TYPE_DIRECTORIES), ViewType & VIEW_DIRECTORIES ? BST_CHECKED : BST_UNCHECKED);
|
|
|
|
Button_SetCheck(GetDlgItem(hDlg,IDC_VIEW_TYPE_PROGRAMS), ViewType & VIEW_PROGRAMS ? BST_CHECKED : BST_UNCHECKED);
|
|
|
|
Button_SetCheck(GetDlgItem(hDlg,IDC_VIEW_TYPE_DOCUMENTS), ViewType & VIEW_DOCUMENTS ? BST_CHECKED : BST_UNCHECKED);
|
|
|
|
Button_SetCheck(GetDlgItem(hDlg,IDC_VIEW_TYPE_OTHERS), ViewType & VIEW_OTHER ? BST_CHECKED : BST_UNCHECKED);
|
|
|
|
Button_SetCheck(GetDlgItem(hDlg,IDC_VIEW_TYPE_SYSFILES), ViewType & VIEW_SYSTEM ? BST_CHECKED : BST_UNCHECKED);
|
|
|
|
return 1;
|
|
|
|
case WM_COMMAND:
|
|
|
|
id = (int)wParam;
|
|
|
|
if (id == IDOK) {
|
|
|
|
GetWindowText(GetDlgItem(hDlg, 201), dlg->cmd, MAX_PATH);
|
|
|
|
dlg->cmdshow = Button_GetState(GetDlgItem(hDlg,214))&BST_CHECKED?SW_SHOWMINIMIZED: SW_SHOWNORMAL;
|
|
|
|
|
|
|
|
if (Button_GetState(GetDlgItem(hDlg,IDC_VIEW_TYPE_DIRECTORIES)) & BST_CHECKED)
|
|
|
|
ViewType |= VIEW_DIRECTORIES;
|
|
|
|
else ViewType &= ~VIEW_DIRECTORIES;
|
|
|
|
if (Button_GetState(GetDlgItem(hDlg,IDC_VIEW_TYPE_PROGRAMS)) & BST_CHECKED)
|
|
|
|
ViewType |= VIEW_PROGRAMS;
|
|
|
|
else ViewType &= ~VIEW_PROGRAMS;
|
|
|
|
if (Button_GetState(GetDlgItem(hDlg,IDC_VIEW_TYPE_DOCUMENTS)) & BST_CHECKED)
|
|
|
|
ViewType |= VIEW_DOCUMENTS;
|
|
|
|
else ViewType &= ~VIEW_DOCUMENTS;
|
|
|
|
if (Button_GetState(GetDlgItem(hDlg,IDC_VIEW_TYPE_OTHERS)) & BST_CHECKED)
|
|
|
|
ViewType |= VIEW_OTHER;
|
|
|
|
else ViewType &= ~VIEW_OTHER;
|
|
|
|
if (Button_GetState(GetDlgItem(hDlg,IDC_VIEW_TYPE_SYSFILES)) & BST_CHECKED)
|
|
|
|
ViewType |= VIEW_SYSTEM;
|
|
|
|
else ViewType &= ~VIEW_SYSTEM;
|
|
|
|
EndDialog(hDlg, id);
|
|
|
|
} else if (id == IDCANCEL)
|
|
|
|
EndDialog(hDlg, id);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
extern TCHAR ViewTypeMaskStr[MAX_TYPE_MASK_LEN];
|
|
|
|
*/
|
2002-07-03 19:32:52 +00:00
|
|
|
|