2011-05-09 12:06 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)

* contrib/hbwin/wapi_winbase.c
  * contrib/hbwin/hbwin.hbx
  + contrib/hbwin/tests/testdir.prg
    + WAPI_GETWINDOWSDIRECTORY() -> <cDir>
    + WAPI_GETSYSTEMDIRECTORY() -> <cDir>
This commit is contained in:
Viktor Szakats
2011-05-09 10:07:42 +00:00
parent cc9bf188dc
commit ee193bd4a1
4 changed files with 81 additions and 0 deletions

View File

@@ -16,6 +16,13 @@
The license applies to all entries newer than 2009-04-28.
*/
2011-05-09 12:06 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* contrib/hbwin/wapi_winbase.c
* contrib/hbwin/hbwin.hbx
+ contrib/hbwin/tests/testdir.prg
+ WAPI_GETWINDOWSDIRECTORY() -> <cDir>
+ WAPI_GETSYSTEMDIRECTORY() -> <cDir>
2011-05-09 09:49 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* contrib/hbide/ideedit.prg
* contrib/hbide/idemisc.prg

View File

@@ -114,11 +114,13 @@ DYNAMIC WAPI_GETSCROLLPOS
DYNAMIC WAPI_GETSCROLLRANGE
DYNAMIC WAPI_GETSHORTPATHNAME
DYNAMIC WAPI_GETSUBMENU
DYNAMIC WAPI_GETSYSTEMDIRECTORY
DYNAMIC WAPI_GETSYSTEMMENU
DYNAMIC WAPI_GETSYSTEMMETRICS
DYNAMIC WAPI_GETTEXTALIGN
DYNAMIC WAPI_GETTEXTCOLOR
DYNAMIC WAPI_GETTEXTFACE
DYNAMIC WAPI_GETWINDOWSDIRECTORY
DYNAMIC WAPI_IMAGELIST_ADD
DYNAMIC WAPI_IMAGELIST_ADDMASKED
DYNAMIC WAPI_IMAGELIST_BEGINDRAG

View File

@@ -0,0 +1,20 @@
/*
* $Id$
*/
/*
* Harbour Project source code:
*
* Copyright 2011 Viktor Szakats (harbour.01 syenar.hu)
* www - http://harbour-project.org
*
*/
#include "simpleio.ch"
PROCEDURE Main()
? ">" + wapi_GetWindowsDirectory() + "<"
? ">" + wapi_GetSystemDirectory() + "<"
RETURN

View File

@@ -400,3 +400,55 @@ HB_FUNC( WAPI_GETLONGPATHNAME )
}
#endif
}
HB_FUNC( WAPI_GETSYSTEMDIRECTORY )
{
#if defined( HB_OS_WIN_CE )
hb_retc_const( "\\Windows" );
#else
UINT nLen = GetSystemDirectory( NULL, 0 );
if( nLen )
{
LPTSTR buffer = ( LPTSTR ) hb_xgrab( ( nLen + 1 ) * sizeof( TCHAR ) );
nLen = GetSystemDirectory( buffer, nLen );
hbwapi_SetLastError( GetLastError() );
HB_RETSTRLEN( buffer, nLen );
hb_xfree( buffer );
}
else
{
hbwapi_SetLastError( GetLastError() );
hb_retc_null();
}
#endif
}
HB_FUNC( WAPI_GETWINDOWSDIRECTORY )
{
#if defined( HB_OS_WIN_CE )
hb_retc_const( "\\Windows" );
#else
UINT nLen = GetWindowsDirectory( NULL, 0 );
if( nLen )
{
LPTSTR buffer = ( LPTSTR ) hb_xgrab( ( nLen + 1 ) * sizeof( TCHAR ) );
nLen = GetWindowsDirectory( buffer, nLen );
hbwapi_SetLastError( GetLastError() );
HB_RETSTRLEN( buffer, nLen );
hb_xfree( buffer );
}
else
{
hbwapi_SetLastError( GetLastError() );
hb_retc_null();
}
#endif
}