does Fivewin have a MessageBox with Timeout
how to "translate" this HMG CODE
- Code: Select all Expand view
- #define ID_TIMEDOUT 32000
int WINAPI MessageBoxTimeout (HWND hWnd, LPCTSTR lpText, LPCTSTR lpCaption, UINT uType, WORD wLanguageId, DWORD dwMilliseconds)
{
typedef BOOL (WINAPI *PMessageBoxTimeout)(HWND,LPCTSTR,LPCTSTR,UINT,WORD,DWORD);
_THREAD_LOCK();
static PMessageBoxTimeout pMessageBoxTimeout = NULL;
if (pMessageBoxTimeout == NULL)
{
HMODULE hLib = LoadLibrary (_TEXT("User32.dll"));
#ifdef UNICODE
pMessageBoxTimeout = (PMessageBoxTimeout)GetProcAddress(hLib, "MessageBoxTimeoutW");
#else
pMessageBoxTimeout = (PMessageBoxTimeout)GetProcAddress(hLib, "MessageBoxTimeoutA");
#endif
}
_THREAD_UNLOCK();
if(pMessageBoxTimeout == NULL)
return FALSE;
return pMessageBoxTimeout(hWnd, lpText, lpCaption, uType, wLanguageId, dwMilliseconds);
}
// HMG_MessageBoxTimeout (cText, cCaption, nTypeIconButton, nMilliseconds) ---> Return nRetValue
HB_FUNC (HMG_MESSAGEBOXTIMEOUT)
{
HWND hWnd = GetActiveWindow();
TCHAR *lpText = (TCHAR *) HMG_parc (1);
TCHAR *lpCaption = (TCHAR *) HMG_parc (2);
UINT uType = HB_ISNIL(3) ? MB_OK : (UINT) hb_parnl (3);
WORD wLanguageId = MAKELANGID (LANG_NEUTRAL, SUBLANG_NEUTRAL);
DWORD dwMilliseconds = HB_ISNIL(4) ? (DWORD)0xFFFFFFFF : (DWORD) hb_parnl (4);
int iRet = MessageBoxTimeout (hWnd, lpText, lpCaption, uType, wLanguageId, dwMilliseconds);
hb_retni ((int) iRet);
}