fixed the ContextMenuStash.png screenshot
[TortoiseGit.git] / src / crashrpt / BaseDialog.h
blob0da3ecfb9563fa6ebbb53d4a827bff87d831cd12
1 #pragma once
2 #include <string>
5 /**
6 * A base window class.
7 * Provides separate window message handlers for every window object based on
8 * this class.
9 */
10 class CDialog
12 public:
13 INT_PTR DoModal(HINSTANCE hInstance, int resID, HWND hWndParent);
15 virtual LRESULT CALLBACK DlgFunc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) = 0;
17 operator HWND() {return m_hwnd;}
18 protected:
19 HINSTANCE hResource;
20 HWND m_hwnd;
22 void InitDialog(HWND hwndDlg, UINT iconID);
24 // the real message handler
25 static INT_PTR CALLBACK stDlgFunc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
27 // returns a pointer the dialog (stored as the WindowLong)
28 inline static CDialog * GetObjectFromWindow(HWND hWnd)
30 return (CDialog *)GetWindowLongPtr(hWnd, GWLP_USERDATA);