ppsspp/Windows/W32Util/DialogManager.h
Unknown W. Brackets 5f9dfeea86 Windows: Reduce focus juggling on game start.
Previously, we would activate the debugger (if enabled), and then
reactivate the main window.  This meant if you switched to something,
PPSSPP would demand focus once the game loaded.
2021-04-24 23:53:16 -07:00

45 lines
882 B
C++

#pragma once
#include "Common/CommonWindows.h"
class Dialog
{
public:
Dialog(LPCSTR res, HINSTANCE _hInstance, HWND _hParent);
virtual ~Dialog();
virtual void Show(bool _bShow, bool includeToTop = true);
virtual void Update() {}
HWND GetDlgHandle() {
return m_hDlg;
}
protected:
virtual void Create();
void Destroy();
HWND m_hParent;
HWND m_hDlg;
LPCSTR m_hResource;
bool m_bValid;
UINT m_bShowState = SW_HIDE;
virtual BOOL DlgProc(UINT message, WPARAM wParam, LPARAM lParam) = 0;
static INT_PTR CALLBACK DlgProcStatic(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
private:
HINSTANCE m_hInstance;
};
class DialogManager
{
public:
static void AddDlg(Dialog *dialog);
static void RemoveDlg(Dialog *dialog);
static bool IsDialogMessage(LPMSG message);
static void EnableAll(BOOL enable);
static void DestroyAll();
static void UpdateAll();
};