Announcement

Collapse
No announcement yet.

Missing in Win32api.inc

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Missing in Win32api.inc

    Code:
    DECLARE FUNCTION GetAncestor LIB "USER32.DLL" ALIAS "GetAncestor" (BYVAL hwnd AS LONG,BYVAL gaFlags AS LONG) AS LONG
    %GA_PARENT      = 1
    %GA_ROOT        = 2
    %GA_ROOTOWNER   = 3
    ------------------
    Fred
    mailto:[email protected][email protected]</A>
    http://www.oxenby.se

    Fred
    mailto:[email protected][email protected]</A>
    http://www.oxenby.se

  • #2
    Code:
    =================================================================
    These constants are missing:
    
      %FS_FILE_COMPRESSION   = %FILE_FILE_COMPRESSION
      %FS_VOL_IS_COMPRESSED  = %FILE_VOLUME_IS_COMPRESSED
    
    These declares are incorrect:
    
      Declare Function GetLogicalDriveStrings Lib "KERNEL32.DLL" Alias "GetLogicalDriveStringsA" _
                      (ByVal nBufferLength As Long, _
                       lpBuffer As Asciiz) As Long
      Declare Function GetVolumeInformation Lib "KERNEL32.DLL" Alias "GetVolumeInformationA" _
                      (lpRootPathName As Asciiz, _
                       lpVolumeNameBuffer As Asciiz, _
                       ByVal nVolumeNameSize As Long, _
                       lpVolumeSerialNumber As Long, _
                       lpMaximumComponentLength As Long, _
                       lpFileSystemFlags As Long, _
                       lpFileSystemNameBuffer As Asciiz, _
                       ByVal nFileSystemNameSize As Long) As Long
    
    Should be:
    
      Declare Function GetLogicalDriveStrings Lib "KERNEL32.DLL" Alias "GetLogicalDriveStringsA" _
                      (ByVal nBufferLength As Long, _
                       lpBuffer As [b]Any[/b]) As Long       
      Declare Function GetVolumeInformation Lib "KERNEL32.DLL" Alias "GetVolumeInformationA" _
                      (lpRootPathName As Asciiz, _
                       lpVolumeNameBuffer As Asciiz, _
                       ByVal nVolumeNameSize As [b]Dword[/b], _
                       lpVolumeSerialNumber As [b]Dword[/b], _
                       lpMaximumComponentLength As [b]Dword[/b], _
                       lpFileSystemFlags As [b]Dword[/b], _
                       lpFileSystemNameBuffer As Asciiz, _
                       ByVal nFileSystemNameSize As Dword) As Long
    =================================================================
    lpBuffer receives multiple NULL separated strings, so Asciiz won't work...
    ------------------
    Peter.
    mailto[email protected][email protected]</A>

    [This message has been edited by Peter Lameijn (edited July 21, 2001).]
    Regards,
    Peter

    Comment


    • #3
      Originally posted by Peter Lameijn:
      lpBuffer receives multiple NULL separated strings, so Asciiz won't work...
      It actually will work, but you just do not get the results you may expect - you usually have to read/manipulate the buffer contents directly, say, with pointers rather than the usual string function.

      However, the more usual method is to use a preallocated dynamic string, and use BYVAL STRPTR(sBuffer$).

      Note that the use of ASCIIZ in the declarations is accurate to how these API's are defined by Microsoft.

      GetAncestor()
      JFYI:
      Requires Windows NT 4.0 SP4 or later.
      Requires Windows 98 or later.

      Anyway, I'll pass both of these along with a view to getting WIN32API.INC updated as R&D deem appropriate.

      Thanks!



      ------------------
      Lance
      PowerBASIC Support
      mailto:[email protected][email protected]</A>
      Lance
      mailto:[email protected]

      Comment

      Working...
      X