ReactOS  0.4.14-dev-831-gef8c9239
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 
28  /* Our CString does not support FormatMessage yet */
31 
32  DWORD_PTR args[2] =
33  {
35  NULL
36  };
37 
39  message, 0, 0, (LPSTR)&formatted, 0, (va_list*)args);
40 
42  return 0;
43  }
44 
45  LRESULT OnButton(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
46  {
47  EndDialog(wID);
48  return 0;
49  }
50 
51 public:
53 
60  END_MSG_MAP()
61 };
62 
63 
65 {
66  PCSTR Filename = PathFindFileNameA(FullPath);
68  INT_PTR Result = confirm.DoModal(hDlg);
69  switch (Result)
70  {
71  case IDYES: return eYes;
72  case IDYESALL: return eYesToAll;
73  default:
74  case IDNO: return eNo;
75  case IDCANCEL: return eCancel;
76  }
77 }
#define STM_SETICON
Definition: winuser.h:2074
#define MAKEINTRESOURCE
Definition: winuser.h:591
Definition: tftpd.h:59
static HICON
Definition: imagelist.c:84
BOOL EndDialog(_In_ int nRetCode)
Definition: atlwin.h:1450
#define DWORD_PTR
Definition: treelist.c:76
#define IDYES
Definition: winuser.h:829
Definition: precomp.h:71
BOOL WINAPI SetDlgItemTextA(_In_ HWND, _In_ int, _In_ LPCSTR)
#define FORMAT_MESSAGE_ARGUMENT_ARRAY
Definition: winbase.h:405
#define FORMAT_MESSAGE_FROM_STRING
Definition: winbase.h:402
DWORD WINAPI FormatMessageA(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPSTR lpBuffer, DWORD nSize, __ms_va_list *args)
Definition: format_msg.c:483
GLenum GLuint GLenum GLsizei const GLchar * message
Definition: glext.h:5579
#define IDC_MESSAGE
Definition: resource.h:22
UINT_PTR WPARAM
Definition: windef.h:207
#define IDYESALL
Definition: resource.h:20
int32_t INT_PTR
Definition: typedefs.h:62
char * LPSTR
Definition: xmlstorage.h:182
const char * filename
Definition: ioapi.h:135
Definition: match.c:390
WPARAM wParam
Definition: combotst.c:138
IN PVCB IN PBCB OUT PDIRENT IN USHORT IN POEM_STRING Filename
Definition: fatprocs.h:925
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)
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
Definition: winbase.h:400
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
char * va_list
Definition: acmsvcex.h:78
Definition: precomp.h:73
#define COMMAND_ID_HANDLER(id, func)
Definition: atlwin.h:1825
#define END_MSG_MAP()
Definition: atlwin.h:1789
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:54
HWND m_hWnd
Definition: atlwin.h:268
uint32_t DWORD_PTR
Definition: typedefs.h:63
int confirm(const char *cmd, const char *file)
Definition: cmds.c:1636
#define IDD_CONFIRM_FILE_REPLACE
Definition: resource.h:19
CConfirmReplace(const char *filename)
HICON hIcon
Definition: msconfig.c:44
#define IDC_EXCLAMATION_ICON
Definition: resource.h:21
unsigned int UINT
Definition: ndis.h:50
#define BEGIN_MSG_MAP(theClass)
Definition: atlwin.h:1770
LRESULT SendDlgItemMessage(int nID, UINT message, WPARAM wParam=0, LPARAM lParam=0)
Definition: atlwin.h:1042
#define MESSAGE_HANDLER(msg, func)
Definition: atlwin.h:1798
const char * PCSTR
Definition: typedefs.h:51
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