2001-08-24 16:40 GMT+2 Maurilio Longo <maurilio.longo@libero.it>

* contrib/os2pm/os2pm.c
     * moved here functions from mainpm.c
   * * contrib/os2pm/tform.prg
     + added new methods
   * source/vm/mainpm.c
     - removed a couple of helper functions which belong to os2pm.c
This commit is contained in:
Maurilio Longo
2001-08-24 14:41:55 +00:00
parent 0b9bbf2d34
commit 37e8299b9d
4 changed files with 58 additions and 27 deletions

View File

@@ -1,3 +1,11 @@
2001-08-24 16:40 GMT+2 Maurilio Longo <maurilio.longo@libero.it>
* contrib/os2pm/os2pm.c
* moved here functions from mainpm.c
* * contrib/os2pm/tform.prg
+ added new methods
* source/vm/mainpm.c
- removed a couple of helper functions which belong to os2pm.c
2001-08-24 16:03 GMT+2 Maurilio Longo <maurilio.longo@libero.it>
+ contrib/os2pm
+ contrib/os2pm/os2pm.c

View File

@@ -66,3 +66,45 @@ HB_FUNC( NOR )
hb_retnl( lRet );
}
HB_FUNC( WINSETWINDOWTEXT )
{
hb_retl( WinSetWindowText( ( HWND ) hb_parnl( 1 ), hb_parc( 2 ) ) );
}
HB_FUNC( WINGETTEXT )
{
BYTE bBuffer[ 255 ];
WinQueryWindowText( ( HWND ) hb_parnl( 1 ), 254, bBuffer );
hb_retc( bBuffer );
}
HB_FUNC( MSGINFO )
{
HWND hWnd = WinQueryActiveWindow( HWND_DESKTOP);
PSZ szCaption = ( hb_pcount() > 1 && ISCHAR( 2 ) ? hb_parc( 2 ) : "Information");
hb_retnl( WinMessageBox( HWND_DESKTOP, hWnd, hb_parc( 1 ), szCaption,
0, MB_INFORMATION | MB_OK | MB_MOVEABLE | MB_APPLMODAL ) );
}
HAB hb_pm_GetHab() {
HWND hWnd = WinQueryActiveWindow( HWND_DESKTOP);
return WinQueryAnchorBlock(hWnd);
}
HB_FUNC( GETHAB )
{
hb_retnl( ( LONG ) hb_pm_GetHab() );
}

View File

@@ -13,9 +13,12 @@ CLASS TForm
CLASSDATA lRegistered
METHOD New()
METHOD New()
METHOD ShowModal()
METHOD cCaption() INLINE WinGetText( ::hWnd )
METHOD ShowModal()
METHOD _cCaption( cNewCaption ) INLINE ;
WinSetWindowText( ::hWnd, cNewCaption )
ENDCLASS

View File

@@ -58,11 +58,12 @@
#include "hbapi.h"
#include "hbvm.h"
static HAB hab; /* Anchor Block handle */
static HMQ hmq; /* Message Queue handle */
int main( int argc, char * argv[] )
{
HAB hab; /* Anchor Block handle */
HMQ hmq; /* Message Queue handle */
hab = WinInitialize( 0 );
hmq = WinCreateMsgQueue( hab, 0 );
@@ -78,27 +79,4 @@ int main( int argc, char * argv[] )
}
/* NOTE: We don't need to have global HAB and HMQ */
HAB hb_pm_GetHab( void ) {
return hab;
}
HB_FUNC( GETHAB )
{
hb_retnl( ( LONG ) hb_pm_GetHab() );
}
/* NOTE: Just a test, to remove */
HB_FUNC( MSGINFO )
{
HWND hWnd = WinQueryActiveWindow( HWND_DESKTOP);
PSZ szCaption = ( hb_pcount() > 1 && ISCHAR( 2 ) ? hb_parc( 2 ) : "Information");
hb_retnl( WinMessageBox( HWND_DESKTOP, hWnd, hb_parc( 1 ), szCaption,
0, MB_INFORMATION | MB_OK | MB_MOVEABLE | MB_APPLMODAL ) );
}