ReactOS 0.4.16-dev-197-g92996da
CZipPassword.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 for a password
5 * COPYRIGHT: Copyright 2019 Mark Jansen (mark.jansen@reactos.org)
6 * Copyright 2023 Katayama Hirofumi MZ (katayama.hirofumi.mz@gmail.com)
7 */
8
9#include "precomp.h"
10
11class CZipPassword : public CDialogImpl<CZipPassword>
12{
13private:
16public:
19 {
20 if (filename != NULL)
22 }
23
25 {
27
28 /* No filename, so this is the question before starting to extract */
29 if (m_Filename.IsEmpty())
30 {
34 }
35 else
36 {
40 }
41 return TRUE;
42 }
43
44 LRESULT OnButton(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
45 {
46 if (wID == IDOK)
47 {
52 }
53 EndDialog(wID);
54 return 0;
55 }
56
57public:
58 enum { IDD = IDD_PASSWORD };
59
66};
67
69{
70 if (filename)
73 INT_PTR Result = password.DoModal(hDlg);
74 switch (Result)
75 {
76 case IDOK: return eAccept;
77 case IDSKIP: return eSkip;
78 default:
79 case IDCANCEL: return eAbort;
80 }
81}
eZipPasswordResponse _CZipAskPassword(HWND hDlg, PCWSTR filename, CStringA &Password)
static VOID CenterWindow(HWND hWnd)
Definition: reactos.c:61
BOOL EndDialog(_In_ int nRetCode)
Definition: atlwin.h:1519
bool IsEmpty() const noexcept
Definition: atlsimpstr.h:394
void ReleaseBuffer(_In_ int nNewLength=-1)
Definition: atlsimpstr.h:387
PXSTR GetString() noexcept
Definition: atlsimpstr.h:367
CWindow GetParent() const
Definition: atlwin.h:700
HWND m_hWnd
Definition: atlwin.h:273
LRESULT OnInitDialog(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
CStringW m_Filename
LRESULT OnButton(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled)
CStringA * m_pPassword
CZipPassword(PCWSTR filename, CStringA *Password)
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
eZipPasswordResponse
Definition: precomp.h:61
@ eAccept
Definition: precomp.h:64
@ eSkip
Definition: precomp.h:63
@ eAbort
Definition: precomp.h:62
#define IDSKIP
Definition: resource.h:34
#define IDC_MESSAGE
Definition: resource.h:31
#define IDS_PASSWORD_ZIP_TEXT
Definition: resource.h:69
#define IDC_PASSWORD
Definition: resource.h:20
#define IDD_PASSWORD
Definition: resource.h:33
#define IDS_PASSWORD_FILE_TEXT
Definition: resource.h:68
LPWSTR WINAPI PathFindFileNameW(LPCWSTR lpszPath)
Definition: path.c:394
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned short WORD
Definition: ntddk_ex.h:93
GLenum GLsizei len
Definition: glext.h:6722
const char * filename
Definition: ioapi.h:137
#define MESSAGE_HANDLER(msg, func)
Definition: atlwin.h:1926
#define BEGIN_MSG_MAP(theClass)
Definition: atlwin.h:1898
#define COMMAND_ID_HANDLER(id, func)
Definition: atlwin.h:1953
#define END_MSG_MAP()
Definition: atlwin.h:1917
static ATOM item
Definition: dde.c:856
static WCHAR password[]
Definition: url.c:33
unsigned int UINT
Definition: ndis.h:50
Definition: tftpd.h:60
@ Password
Definition: telnetd.h:65
int32_t INT_PTR
Definition: typedefs.h:64
const uint16_t * PCWSTR
Definition: typedefs.h:57
UINT WINAPI GetDlgItemTextA(HWND hDlg, int nIDDlgItem, LPSTR lpString, int nMaxCount)
Definition: dialog.c:2245
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
UINT_PTR WPARAM
Definition: windef.h:207
#define SW_HIDE
Definition: winuser.h:771
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define IDCANCEL
Definition: winuser.h:834
int WINAPI GetWindowTextLengthA(_In_ HWND)
BOOL WINAPI SetDlgItemTextW(_In_ HWND, _In_ int, _In_ LPCWSTR)
#define WM_INITDIALOG
Definition: winuser.h:1742
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define IDOK
Definition: winuser.h:833
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
_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:409