2017-10-18 10:07 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* contrib/hbwin/hbwin.ch
* contrib/hbwin/hbwin.hbx
* contrib/hbwin/wapi_winuser_2.c
+ added PRG wrapper
wapi_MessageBoxTimeout( <phWnd>, <cText>, <cCaption>, ;
<nType>, <nLangId>, <nTimeout> )
-> <messageBox_results> | WIN_MB_TIMEDOUT
to undocumented MS-Windows function MessageBoxTimeout().
This function exists in all MS-Windows versions and is used internally
by MessageBox() and MessageBoxEx() with 0xFFFFFFFF timeout.
* contrib/hbwin/win_svc_2.c
* src/common/hbfopen.c
! fixed POCC and XCC builds
This commit is contained in:
@@ -7,6 +7,22 @@
|
||||
Entries may not always be in chronological/commit order.
|
||||
See license at the end of file. */
|
||||
|
||||
2017-10-18 10:07 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
|
||||
* contrib/hbwin/hbwin.ch
|
||||
* contrib/hbwin/hbwin.hbx
|
||||
* contrib/hbwin/wapi_winuser_2.c
|
||||
+ added PRG wrapper
|
||||
wapi_MessageBoxTimeout( <phWnd>, <cText>, <cCaption>, ;
|
||||
<nType>, <nLangId>, <nTimeout> )
|
||||
-> <messageBox_results> | WIN_MB_TIMEDOUT
|
||||
to undocumented MS-Windows function MessageBoxTimeout().
|
||||
This function exists in all MS-Windows versions and is used internally
|
||||
by MessageBox() and MessageBoxEx() with 0xFFFFFFFF timeout.
|
||||
|
||||
* contrib/hbwin/win_svc_2.c
|
||||
* src/common/hbfopen.c
|
||||
! fixed POCC and XCC builds
|
||||
|
||||
2017-09-28 15:11 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
|
||||
* src/pp/ppcore.c
|
||||
! fixed memory leak in unclosed extended block
|
||||
|
||||
@@ -720,6 +720,7 @@
|
||||
#define WIN_MB_DEFMASK 0x00000F00
|
||||
#define WIN_MB_MODEMASK 0x00003000
|
||||
#define WIN_MB_MISCMASK 0x0000C000
|
||||
#define WIN_MB_TIMEDOUT 0x00007D00
|
||||
|
||||
/* win_SHFileOperation() functions */
|
||||
#define WIN_FO_MOVE 0x0001
|
||||
|
||||
@@ -137,6 +137,7 @@ DYNAMIC wapi_LoadLibrary
|
||||
DYNAMIC wapi_LoadMenu
|
||||
DYNAMIC wapi_MessageBeep
|
||||
DYNAMIC wapi_MessageBox
|
||||
DYNAMIC wapi_MessageBoxTimeout
|
||||
DYNAMIC wapi_MoveToEx
|
||||
DYNAMIC wapi_MulDiv
|
||||
DYNAMIC wapi_OpenMutex
|
||||
|
||||
@@ -61,3 +61,46 @@ HB_FUNC( WAPI_MESSAGEBOX )
|
||||
hb_strfree( hStr1 );
|
||||
hb_strfree( hStr2 );
|
||||
}
|
||||
|
||||
static int s_MessageBoxTimeout( IN HWND hWnd,
|
||||
IN LPCTSTR lpText, IN LPCTSTR lpCaption,
|
||||
IN UINT uType, IN WORD wLanguageId,
|
||||
IN DWORD dwMilliseconds )
|
||||
{
|
||||
/* undocumented Windows API */
|
||||
typedef int ( __stdcall * _HB_MSGBOXTOUT )( IN HWND hWnd,
|
||||
IN LPCTSTR lpText, IN LPCTSTR lpCaption,
|
||||
IN UINT uType, IN WORD wLanguageId,
|
||||
IN DWORD dwMilliseconds );
|
||||
static _HB_MSGBOXTOUT s_pMessageBoxTimeout = ( _HB_MSGBOXTOUT ) -1;
|
||||
|
||||
if( s_pMessageBoxTimeout == ( _HB_MSGBOXTOUT ) -1 )
|
||||
{
|
||||
HMODULE hModule = GetModuleHandle( TEXT( "user32.dll" ) );
|
||||
s_pMessageBoxTimeout = hModule == NULL ? NULL : ( _HB_MSGBOXTOUT )
|
||||
HB_WINAPI_GETPROCADDRESST( hModule, "MessageBoxTimeout" );
|
||||
}
|
||||
|
||||
return s_pMessageBoxTimeout ?
|
||||
s_pMessageBoxTimeout( hWnd, lpText, lpCaption, uType,
|
||||
wLanguageId, dwMilliseconds ) :
|
||||
MessageBoxEx( hWnd, lpText, lpCaption, uType, wLanguageId );
|
||||
}
|
||||
|
||||
HB_FUNC( WAPI_MESSAGEBOXTIMEOUT )
|
||||
{
|
||||
void * hStr1;
|
||||
void * hStr2;
|
||||
|
||||
int iResult = s_MessageBoxTimeout( hbwapi_par_raw_HWND( 1 ),
|
||||
HB_PARSTR( 2, &hStr1, NULL ),
|
||||
HB_PARSTR( 3, &hStr2, NULL ),
|
||||
hbwapi_par_UINT( 4 ),
|
||||
hbwapi_par_WORD( 5 ),
|
||||
hbwapi_par_DWORD( 6 ) );
|
||||
|
||||
hbwapi_SetLastError( GetLastError() );
|
||||
hbwapi_ret_NI( iResult );
|
||||
hb_strfree( hStr1 );
|
||||
hb_strfree( hStr2 );
|
||||
}
|
||||
|
||||
@@ -46,6 +46,10 @@
|
||||
|
||||
#include "hbwapi.h"
|
||||
|
||||
#if defined( __POCC__ ) || defined( __XCC__ )
|
||||
#include <winsvc.h> /* it's disabled by WIN32_LEAN_AND_MEAN */
|
||||
#endif
|
||||
|
||||
HB_FUNC( WIN_SERVICEINSTALL )
|
||||
{
|
||||
HB_BOOL bRetVal = HB_FALSE;
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
( defined( __WATCOMC__ ) || defined( _MSC_VER ) || \
|
||||
defined( __MINGW32__ ) || defined( __BORLANDC__ ) || \
|
||||
defined( __DMC__ ) ) && \
|
||||
! defined( __MINGW32CE__ )
|
||||
! defined( __MINGW32CE__ ) && ! defined( __POCC__ ) && ! defined( __XCC__ )
|
||||
#define HB_USE_FSOPEN
|
||||
#include <share.h>
|
||||
#if ! defined( SH_DENYNO ) && defined( _SH_DENYNO )
|
||||
|
||||
Reference in New Issue
Block a user