ReactOS  0.4.15-dev-1018-g0695ecb
CConfirmReplace.cpp
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS Zip Shell Extension
3  * LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
4  * PURPOSE: Ask the user to replace a file
5  * COPYRIGHT: Copyright 2017-2019 Mark Jansen (mark.jansen@reactos.org)
6  */
7 
8 #include "precomp.h"
9 
10 class CConfirmReplace : public CDialogImpl<CConfirmReplace>
11 {
12 private:
14 public:
15 
18  {
19  }
20 
22  {
24 
27 
31 
32  return TRUE;
33  }
34 
35  LRESULT OnButton(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
36  {
37  EndDialog(wID);
38  return 0;
39  }
40 
41 public:
43 
50  END_MSG_MAP()
51 };
52 
53 
55 {
56  PCSTR Filename = PathFindFileNameA(FullPath);
58  INT_PTR Result = confirm.DoModal(hDlg);
59  switch (Result)
60  {
61  case IDYES: return eYes;
62  case IDYESALL: return eYesToAll;
63  default:
64  case IDNO: return eNo;
65  case IDCANCEL: return eCancel;
66  }
67 }
#define STM_SETICON
Definition: winuser.h:2074
Definition: tftpd.h:59
static HICON
Definition: imagelist.c:84
BOOL EndDialog(_In_ int nRetCode)
Definition: atlwin.h:1450
#define IDYES
Definition: winuser.h:829
#define TRUE
Definition: types.h:120
Definition: precomp.h:71
BOOL WINAPI SetDlgItemTextA(_In_ HWND, _In_ int, _In_ LPCSTR)
GLenum GLuint GLenum GLsizei const GLchar * message
Definition: glext.h:5579
#define IDC_MESSAGE
Definition: resource.h:28
UINT_PTR WPARAM
Definition: windef.h:207
#define IDYESALL
Definition: resource.h:26
int32_t INT_PTR
Definition: typedefs.h:64
const char * filename
Definition: ioapi.h:135
WPARAM wParam
Definition: combotst.c:138
IN PVCB IN PBCB OUT PDIRENT IN USHORT IN POEM_STRING Filename
Definition: fatprocs.h:934
LRESULT OnInitDialog(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
#define IDI_EXCLAMATION
Definition: winuser.h:702
unsigned int BOOL
Definition: ntddk_ex.h:94
eZipConfirmResponse _CZipAskReplace(HWND hDlg, PCSTR FullPath)
eZipConfirmResponse
Definition: precomp.h:69
smooth NULL
Definition: ftsmooth.c:416
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:426
LONG_PTR LPARAM
Definition: windef.h:208
Definition: precomp.h:73
#define COMMAND_ID_HANDLER(id, func)
Definition: atlwin.h:1835
#define END_MSG_MAP()
Definition: atlwin.h:1799
PCXSTR GetString() const
Definition: atlsimpstr.h:361
BOOL CenterWindow(HWND hWndCenter=NULL)
Definition: atlwin.h:309
unsigned short WORD
Definition: ntddk_ex.h:93
LRESULT OnButton(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled)
#define IDS_OVERWRITEFILE_TEXT
Definition: resource.h:61
HWND m_hWnd
Definition: atlwin.h:268
int confirm(const char *cmd, const char *file)
Definition: cmds.c:1636
#define IDD_CONFIRM_FILE_REPLACE
Definition: resource.h:25
CConfirmReplace(const char *filename)
HICON hIcon
Definition: msconfig.c:44
#define IDC_EXCLAMATION_ICON
Definition: resource.h:27
unsigned int UINT
Definition: ndis.h:50
#define BEGIN_MSG_MAP(theClass)
Definition: atlwin.h:1780
LRESULT SendDlgItemMessage(int nID, UINT message, WPARAM wParam=0, LPARAM lParam=0)
Definition: atlwin.h:1042
#define MESSAGE_HANDLER(msg, func)
Definition: atlwin.h:1808
const char * PCSTR
Definition: typedefs.h:52
CWindow GetParent() const
Definition: atlwin.h:654
#define LoadIcon
Definition: winuser.h:5788
#define IDNO
Definition: winuser.h:830
LPSTR WINAPI PathFindFileNameA(LPCSTR lpszPath)
Definition: path.c:368
#define IDCANCEL
Definition: winuser.h:825
LONG_PTR LRESULT
Definition: windef.h:209
#define WM_INITDIALOG
Definition: winuser.h:1721
LPARAM lParam
Definition: combotst.c:139