Files
interactive/application/sp-console3/Common/TimedMsgBox.h
T
2026-08-07 17:38:18 +09:00

50 lines
864 B
C++

class CTimedMsgBox;
#ifndef _TIMEDMSGBOX_H_
#define _TIMEDMSGBOX_H_
#pragma once
#define MSGBOX_DELAY 4000
class CTimedMsgBox
{
protected:
class CMsgBoxThread : public CWizThread
{
public:
CMsgBoxThread(LPCTSTR pszCaption, LPCTSTR pszTitle, UINT nType) {
m_pszCaption = strdup(pszCaption);
m_pszTitle = strdup(pszTitle);
m_nType = nType;
};
virtual ~CMsgBoxThread()
{
if (m_pszCaption)
free(m_pszCaption);
if (m_pszTitle)
free(m_pszTitle);
};
virtual void Run(LPVOID)
{
// Create the desired dialog box
if (!m_pszCaption)
return;
MessageBox(NULL, m_pszCaption, m_pszTitle, MB_OK | m_nType);
};
LPSTR m_pszCaption;
LPSTR m_pszTitle;
UINT m_nType;
};
public:
static void Do(LPCTSTR pszCaption, LPCTSTR pszTitle, UINT nType);
};
#endif