-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainFrame.h
56 lines (42 loc) · 1.84 KB
/
MainFrame.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// MainFrame.h:
// Copyright (C) 2008-2011 Asesh Shrestha. All rights reserved
#ifndef MAINFRAME_H
#define MAINFRAME_H
// Function prototypes
INT_PTR CALLBACK dlgProc(HWND hDlg, UINT uiMsg, WPARAM wpParam, LPARAM lpParam); // Main dialog box procedure
INT_PTR CALLBACK aboutDlgProc(HWND hDlg, UINT uiMsg, WPARAM wpParam, LPARAM lpParam); // About dialog box procedure
INT_PTR CALLBACK progressDlgProc(HWND hDlg, UINT uiMsg, WPARAM wpParam, LPARAM lpParam); // Checksum verification progress dialog box procedure
// CMainFrame class
class CMainFrame
{
public:
CMainFrame(); // Default constructor
~CMainFrame(); // Destructor
BOOL create(); // Create the main window
HWND getWindowHandle() const; // Get the window handle
BOOL show() const; // Show the main window
void runMainMessageLoop();
void onInit(HWND hDlg, WPARAM wpParam, LPARAM lpParam); // Handle WM_INITDIALOG message
void onCommand(WPARAM wpParam, LPARAM lpParam); // Handle WM_COMMAND message
void onKeyDown(WPARAM wpParam, LPARAM lpParam); // Handle WM_KEYDOWN message
void onNotify(WPARAM wpParam, LPARAM lpParam); // Handle WM_NOTIFY message
void onShowWindow(WPARAM wpParam, LPARAM lpParam); // Handle WM_SHOWWINDOW message
void onClose(); // Handle WM_CLOSE message
void onDestroy(); // Handle WM_DESTROY message
bool openBrowseForDirDialog(); // Display browser for folder dialog
BOOL openOpenFileDialog(); // Display open file dialog
BOOL openSaveFileDialog(); // Display save file dialog
private:
// Window handles
//
HWND m_hDlg; // Main window handle
HWND m_hSourcePathEditWnd, m_hSaveHashPathEditWnd; // Edit controls
HWND m_hChecksumTypeComboWnd; // Combo boxes
//
// Window handles
WCHAR m_szFolderPath[MAX_PATH * 2], m_szFileName[MAX_PATH * 2];
OPENFILENAME m_oOpenFileName;
MSG m_oMSG; // Holds message data
};
extern CMainFrame *g_pMainFrame;
#endif // MAINFRAME_H