public Collection < String > getSubKeys ( ) { WINBASE . FILETIME lpftLastWriteTime ; TreeSet < String > subKeys = new TreeSet <> ( ) ; char [ ] lpName = new char [ 256 ] ; IntByReference lpcName = new IntByReference ( 256 ) ; lpftLastWriteTime = new WINBASE . FILETIME ( ) ; int dwIndex = 0 ; while ( Advapi32 . INSTANCE . RegEnumKeyEx ( handle , dwIndex , lpName , lpcName , null , null , null , lpftLastWriteTime ) == WINERROR . ERROR_SUCCESS ) { subKeys . add ( new String ( lpName , 0 , lpcName . getValue ( ) ) ) ; lpcName . setValue ( 256 ) ; dwIndex ++ ; } return subKeys ; }
Get all sub keys of a key .