You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.3 KiB
46 lines
1.3 KiB
#include <windows.h>
|
|
#include "helpers.h"
|
|
#include "res.h"
|
|
|
|
extern HINSTANCE ghInstance;
|
|
#define TITLESIZE 50
|
|
WCHAR szTitle[TITLESIZE] = {0};
|
|
WCHAR *pszMessage = NULL;
|
|
#define MSGBUFFERSIZE 500
|
|
|
|
BOOL PresentMessageBox(UINT uiMessageID,UINT uiType)
|
|
{
|
|
if (NULL == ghInstance) return FALSE;
|
|
|
|
if (szTitle[0] == 0)
|
|
{
|
|
LoadString(ghInstance, IDS_ITGTITLE,szTitle,TITLESIZE);
|
|
}
|
|
|
|
pszMessage = (WCHAR *) CspAllocH(MSGBUFFERSIZE * sizeof(WCHAR));
|
|
if (NULL == pszMessage) return FALSE;
|
|
INT iRet = LoadString(ghInstance,uiMessageID,pszMessage,MSGBUFFERSIZE);
|
|
if (iRet == 0) return FALSE;
|
|
MessageBox(NULL,pszMessage,szTitle,uiType);
|
|
CspFreeH((void *) pszMessage);
|
|
return TRUE;
|
|
}
|
|
|
|
BOOL PresentModalMessageBox(HWND hw, UINT uiMessageID,UINT uiType)
|
|
{
|
|
if (NULL == ghInstance) return FALSE;
|
|
|
|
if (szTitle[0] == 0)
|
|
{
|
|
LoadString(ghInstance, IDS_ITGTITLE,szTitle,TITLESIZE);
|
|
}
|
|
|
|
pszMessage = (WCHAR *) CspAllocH(MSGBUFFERSIZE * sizeof(WCHAR));
|
|
if (NULL == pszMessage) return FALSE;
|
|
INT iRet = LoadString(ghInstance,uiMessageID,pszMessage,MSGBUFFERSIZE);
|
|
if (iRet == 0) return FALSE;
|
|
MessageBox(hw,pszMessage,szTitle,uiType);
|
|
CspFreeH((void *) pszMessage);
|
|
return TRUE;
|
|
}
|
|
|