2011-02-14 14:39 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)

* contrib/hbwin/hbwin.hbx
  * contrib/hbwin/win_regc.c
  * contrib/hbwin/win_reg.prg
  * contrib/hbwin/tests/testreg.prg
    + Added WIN_REGDELETE() high-level function.
    + Added WIN_REGDELETEKEY() Windows API (non-1-to-1) wrapper.
    + Added WIN_REGDELETEVALUE() Windows API (non-1-to-1) wrapper.

  * contrib/hbqt/hbmk2_qt.hbs
  * contrib/hbqt/qtgui/hbqtgui.h
  * contrib/hbqt/qtcore/hbqtcore.h
    + Cast HBQT_TYPE_ constants to unsigned int.
This commit is contained in:
Viktor Szakats
2011-02-14 13:40:18 +00:00
parent 3132ce4ed2
commit 0ad77a1373
8 changed files with 89 additions and 29 deletions

View File

@@ -16,6 +16,20 @@
The license applies to all entries newer than 2009-04-28.
*/
2011-02-14 14:39 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
* contrib/hbwin/hbwin.hbx
* contrib/hbwin/win_regc.c
* contrib/hbwin/win_reg.prg
* contrib/hbwin/tests/testreg.prg
+ Added WIN_REGDELETE() high-level function.
+ Added WIN_REGDELETEKEY() Windows API (non-1-to-1) wrapper.
+ Added WIN_REGDELETEVALUE() Windows API (non-1-to-1) wrapper.
* contrib/hbqt/hbmk2_qt.hbs
* contrib/hbqt/qtgui/hbqtgui.h
* contrib/hbqt/qtcore/hbqtcore.h
+ Cast HBQT_TYPE_ constants to unsigned int.
2011-02-14 12:58 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
* contrib/hbide/idemain.prg
* contrib/hbide/hbide.hbp

View File

@@ -1361,7 +1361,7 @@ METHOD HbQtSource:build()
NEXT
aadd( aLine, "" )
FOR EACH s IN ::hRef
aadd( aLine, PadR( "#define HBQT_TYPE_" + s:__enumKey(), 64 ) + "0x" + hb_NumToHex( hb_crc32( "HBQT_TYPE_" + hb_asciiUpper( ::cQtModule ) + s:__enumKey() ), 8 ) )
aadd( aLine, PadR( "#define HBQT_TYPE_" + s:__enumKey(), 64 ) + "( ( unsigned int ) 0x" + hb_NumToHex( hb_crc32( "HBQT_TYPE_" + hb_asciiUpper( ::cQtModule ) + s:__enumKey() ), 8 ) + " )" )
NEXT
aadd( aLine, "" )
/*----------------------------------------------------------------------*/

View File

@@ -23,6 +23,6 @@ HB_EXTERN_END
#define hbqt_par_HBQSlots( n ) ( ( HBQSlots * ) hbqt_gcpointer( n ) )
#define hbqt_par_HBQString( n ) ( ( HBQString * ) hbqt_gcpointer( n ) )
#define HBQT_TYPE_QSize 0x5E28750F
#define HBQT_TYPE_QSize ( ( unsigned int ) 0x5E28750F )
#endif /* __HBQTCORE_H */

View File

@@ -29,16 +29,16 @@ HB_EXTERN_END
#define hbqt_par_QPrinter( n ) ( ( QPrinter * ) hbqt_gcpointer( n ) )
#define hbqt_par_QWidget( n ) ( ( QWidget * ) hbqt_gcpointer( n ) )
#define HBQT_TYPE_QBitmap 0x210679C1
#define HBQT_TYPE_QBoxLayout 0x8E2E0CAF
#define HBQT_TYPE_QBrush 0x96A039B0
#define HBQT_TYPE_QColor 0x0151A39A
#define HBQT_TYPE_QFont 0x0A35B749
#define HBQT_TYPE_QBitmap ( ( unsigned int ) 0x210679C1 )
#define HBQT_TYPE_QBoxLayout ( ( unsigned int ) 0x8E2E0CAF )
#define HBQT_TYPE_QBrush ( ( unsigned int ) 0x96A039B0 )
#define HBQT_TYPE_QColor ( ( unsigned int ) 0x0151A39A )
#define HBQT_TYPE_QFont ( ( unsigned int ) 0x0A35B749 )
#ifndef HBQT_TYPE_QIcon
#define HBQT_TYPE_QIcon 0xBF359640
#define HBQT_TYPE_QIcon ( ( unsigned int ) 0xBF359640 )
#endif
#ifndef HBQT_TYPE_QPixmap
#define HBQT_TYPE_QPixmap 0x25CE65E9
#define HBQT_TYPE_QPixmap ( ( unsigned int ) 0x25CE65E9 )
#endif
#endif /* __HBQTGUI_H */

View File

@@ -380,6 +380,9 @@ DYNAMIC WIN_PRN
DYNAMIC WIN_RECTANGLE
DYNAMIC WIN_REGCLOSEKEY
DYNAMIC WIN_REGCREATEKEYEX
DYNAMIC WIN_REGDELETE
DYNAMIC WIN_REGDELETEKEY
DYNAMIC WIN_REGDELETEVALUE
DYNAMIC WIN_REGGET
DYNAMIC WIN_REGOPENKEYEX
DYNAMIC WIN_REGPATHSPLIT

View File

@@ -7,6 +7,9 @@
PROCEDURE Main()
LOCAL tmp
? win_regDelete( "HKCU\_TEST\teszt" )
? win_regDelete( "HKCU\_TEST\" )
? ">" + win_GetCommandLineParam() + "<"
? ">" + wapi_GetCommandLine() + "<"

View File

@@ -56,6 +56,29 @@
/* ------------------------------------------------------------------- */
/* Predefined Value Types. from winnt.h */
#define KEY_QUERY_VALUE 1
#define KEY_SET_VALUE 2
#define KEY_CREATE_SUB_KEY 4
#define KEY_ENUMERATE_SUB_KEYS 8
#define KEY_NOTIFY 16
#define KEY_CREATE_LINK 32
#define REG_NONE 0 // No value type
#define REG_SZ 1 // Unicode nul terminated string
#define REG_EXPAND_SZ 2 // Unicode nul terminated string (with environment variable references)
#define REG_BINARY 3 // Free form binary
#define REG_DWORD 4 // 32-bit number
#define REG_DWORD_LITTLE_ENDIAN 4 // 32-bit number (same as REG_DWORD)
#define REG_DWORD_BIG_ENDIAN 5 // 32-bit number
#define REG_LINK 6 // Symbolic Link (unicode)
#define REG_MULTI_SZ 7 // Multiple Unicode strings
#define REG_RESOURCE_LIST 8 // Resource list in the resource map
#define REG_FULL_RESOURCE_DESCRIPTOR 9 // Resource list in the hardware description
#define REG_RESOURCE_REQUIREMENTS_LIST 10
/* ------------------------------------------------------------------- */
PROCEDURE win_regPathSplit( cRegPath, /* @ */ nHKEY, /* @ */ cKey, /* @ */ cEntry )
LOCAL cHKEY
LOCAL tmp
@@ -112,28 +135,25 @@ FUNCTION win_regWrite( cRegPath, xValue )
RETURN win_regSet( nHKEY, cKey, cEntry, xValue )
/* ------------------------------------------------------------------- */
FUNCTION win_regDelete( cRegPath )
LOCAL nHKEY, cKey, cEntry
LOCAL lRetVal
LOCAL pKeyHandle
/* Predefined Value Types. from winnt.h */
#define KEY_QUERY_VALUE 1
#define KEY_SET_VALUE 2
#define KEY_CREATE_SUB_KEY 4
#define KEY_ENUMERATE_SUB_KEYS 8
#define KEY_NOTIFY 16
#define KEY_CREATE_LINK 32
win_regPathSplit( cRegPath, @nHKEY, @cKey, @cEntry )
#define REG_NONE 0 // No value type
#define REG_SZ 1 // Unicode nul terminated string
#define REG_EXPAND_SZ 2 // Unicode nul terminated string (with environment variable references)
#define REG_BINARY 3 // Free form binary
#define REG_DWORD 4 // 32-bit number
#define REG_DWORD_LITTLE_ENDIAN 4 // 32-bit number (same as REG_DWORD)
#define REG_DWORD_BIG_ENDIAN 5 // 32-bit number
#define REG_LINK 6 // Symbolic Link (unicode)
#define REG_MULTI_SZ 7 // Multiple Unicode strings
#define REG_RESOURCE_LIST 8 // Resource list in the resource map
#define REG_FULL_RESOURCE_DESCRIPTOR 9 // Resource list in the hardware description
#define REG_RESOURCE_REQUIREMENTS_LIST 10
IF Empty( cEntry )
lRetVal := win_regDeleteKey( nHKEY, cKey )
ELSE
IF win_regOpenKeyEx( nHKEY, cKey, 0, KEY_SET_VALUE, @pKeyHandle )
lRetVal := win_regDeleteValue( pKeyHandle, cEntry )
win_regCloseKey( pKeyHandle )
ELSE
lRetVal := .F.
ENDIF
ENDIF
RETURN lRetVal
FUNCTION win_regQuery( nHKEY, cKeyName, cEntryName, xValue, lSetIt )
LOCAL xKey := win_regGet( nHKEY, cKeyName, cEntryName )

View File

@@ -237,6 +237,26 @@ HB_FUNC( WIN_REGSETVALUEEX )
hb_strfree( hKey );
}
HB_FUNC( WIN_REGDELETEKEY )
{
void * hKey;
hb_retl( RegDeleteKey( hb_regkeyconv( ( HB_PTRUINT ) hb_parnint( 1 ) ),
( LPCTSTR ) HB_PARSTRDEF( 2, &hKey, NULL ) ) == ERROR_SUCCESS );
hb_strfree( hKey );
}
HB_FUNC( WIN_REGDELETEVALUE )
{
void * hValue;
hb_retl( RegDeleteValue( ( HKEY ) hb_parptr( 1 ),
( LPCTSTR ) HB_PARSTR( 2, &hValue, NULL ) ) == ERROR_SUCCESS );
hb_strfree( hValue );
}
HB_FUNC( WIN_REGCLOSEKEY )
{
hb_retl( RegCloseKey( ( HKEY ) hb_parptr( 1 ) ) == ERROR_SUCCESS );