Announcement

Collapse
No announcement yet.

Windows API Headers III v. 1.07

Collapse
This is a sticky topic.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Windows API Headers III v. 1.07

    This project is an effort to translate the C headers of the Microsoft Platform SDK for Windows to PowerBASIC™. This version has been updated using the SDK for Windows 7.1.

    These headers are freeware, not public domain. This means that you can use them for your own purposes, even in commercial applications, without paying a fee, but not to make derivative works from, sell or redistribute without permission. Also you must assume the entire risk of using them. Downloading the software indicates that you accept these terms.

    Because of the use of new data types only available in PNWIN 10.0+ and PBCC 6.0+ and other features, they can only be used with the new compilers.

    You must also be aware that these headers are not extensions to the ones provided with the compiler, but a full replacement. Therefore, you must not mix them with the PowerBASIC include files in any way, neither directly (via #INCLUDE), nor indirectly (via the include path in the IDE).

    Unzip the attached file to a folder of your choice and replace the PB Include path in the PB Ide or the editor that you are using to that folder instead of C:\PBWin10\WinApi.

    The wrapper functions for the Common Controls have been removed from CommCtrl.inc and placed in the following individual files. Therefore, the use of constants such %NOTOOLBAR, %NOUPDOWN, etc., is no longer needed. Just #INCLUDE the wanted files in your application.

    AnimateCtrl.inc (Animation control)
    ButtonCtrl.inc (Button control)
    ComboBoxCtrl.inc (ComboBox control)
    ComboBoxExCtrl.inc (ComboBoxEx control)
    DateTimeCtrl.inc (Date Time control)
    EditCtrl.inc (Edit control)
    HeaderCtrl.inc (Header control)
    HotKeyCtrl.inc (Hot Key control)
    IPAddressCtrl.inc (IP Address control)
    ListBoxCtrl.inc (ListBox control)
    ListViewCtrl.inc (ListView control)
    MonthCalCtrl.inc (Month Calendar control)
    PagerCtrl.inc (Pager control)
    ProgressBarCtrl.inc (Progress Bar control)
    RebarCtrl.inc (Rebar control)
    RichEditCtrl.inc (Rich Edit control)
    ScrollBarCtrl.inc (Scroll Bar control)
    StaticCtrl.inc (Static control)
    StatusbarCtrl.inc (Status Bar control)
    SysLinkCtrl.inc (SysLink control)
    TabCtrl.inc (Tab control)
    TaskDialogCtrl.inc (Task Dialog control)
    ToolbarCtrl.inc (Toolbar control)
    TrackbarCtrl.inc (Track Bar control)
    TreeViewCtrl.inc (TreeView control)
    UpDownCtrl.inc (UpDown control)

    There are 1,201 files using 78,555,444 bytes.
    Attached Files
    Last edited by José Roca; 25 May 2016, 04:21 PM. Reason: Typo correction
    Forum: http://www.jose.it-berater.org/smfforum/index.php

    #2
    What is new in this version?

    OleCreatePropertyFrame
    Changed the lplpUnk parameter to BYREF and the lpPageClsID parameter to BYVAL GUID PTR.

    Typo in the RightGUI member of the HIDP_KEYBOARD_MOFIDIER_UNION_STRUCT structure.

    xlcall.inc
    Changed alignment of the FP structure from DWORD to QWORD FILL.
    Added the WORD specifier to some equates.
    Thanks to Holger Taschenberger for reporting it.

    stdlib.inc
    Function ltow_s_ Changed parameter sizeofStr from BYREF to BYVAL.

    CWindow.inc
    Added checking to no perform zooming if the browser is IE6 or below.

    D2D1Helper.inc
    Added some new matrix methods provided by Larry Charlton.

    RichEditCtrl.inc
    Spelling error in RichEdit_LineFromChar. Thanks to Gary Beene for reporting it.
    RichEdit_SetFontW: Changed CHARFORMATA to CHARFORMATW.

    CommCtrl.inc
    Added support for the unexported ImageList_SetColorTable function.

    Updated FreeImage.inc to version 3.17.

    Updated Scintilla to version 3.54
    Last edited by José Roca; 23 Aug 2015, 04:02 PM.
    Forum: http://www.jose.it-berater.org/smfforum/index.php

    Comment


      #3
      Forgot to say: also replaced the GetRValue, GetGValue and GetBValue macros with functions because of a compiler issue.

      See: http://www.powerbasic.com/support/pb...ad.php?t=59664
      Forum: http://www.jose.it-berater.org/smfforum/index.php

      Comment


        #4
        Jose!
        Thanks for the update! I have it already installed and ready to go.

        I wondered, is there a link to the Help file for your includes on this site? Someone asked me about it but I'm not finding the link.

        Comment


          #5
          The one for version 1.06 is still valid, since this new version has no new stuff.

          Anyway.

          Help file for the main classes and wrapper functions available in the version 3.1.07 of the Windows API Headers for PBWin 10+ and PBCC 6+.
          Attached Files
          Forum: http://www.jose.it-berater.org/smfforum/index.php

          Comment


            #6
            Dear Jose,

            after some time wondering why a software I am writing is not working, I found that there is an error in your VfW.INC file:

            This is what is declared:

            FUNCTION capDriverConnect (BYVAL hwnd AS DWORD, BYVAL i AS LONG) AS LONG
            FUNCTION = SendMessage(hwnd, %WM_CAP_SET_USER_DATA, i, 0)

            END FUNCTION

            And this is what it should be:

            FUNCTION capDriverConnect (BYVAL hwnd AS DWORD, BYVAL i AS LONG) AS LONG
            FUNCTION = SendMessage(hwnd, %WM_CAP_DRIVER_CONNECT, i, 0)

            END FUNCTION

            I modified your include file with that change and now all is working fine.

            Best regards.
            Fran

            Comment


              #7
              Your'e right. I modified it in January 10, 2017, but I no longer can upload files in this forum.
              Forum: http://www.jose.it-berater.org/smfforum/index.php

              Comment


                #8
                Hi Jose,
                thanks for answering.

                Originally posted by José Roca View Post
                Your'e right. I modified it in January 10, 2017, but I no longer can upload files in this forum.
                Any other change in that modification on Jan 10th?

                What is the URL to download the lastest version of your includes?

                Best regards.
                Fran

                Comment


                  #9
                  There is not new package yet.

                  Changes

                  winuser.inc
                  Added
                  %HSHELL_MONITORCHANGED = 16&

                  AfxDlg.inc
                  Changed

                  hBitmap = LoadImageW(%NULL, wszFileName, %IMAGE_BITMAP, 0, 0, %LR_LOADFROMFILE OR %LR_LOADFROMFILE OR %LR_CREATEDIBSECTION OR %LR_DEFAULTSIZE)
                  to

                  hBitmap = LoadImageW(%NULL, wszFileName, %IMAGE_BITMAP, 0, 0, %LR_LOADFROMFILE OR %LR_CREATEDIBSECTION OR %LR_DEFAULTSIZE)

                  WinBer.inc
                  Changed

                  TYPE berval DWORD
                  bv_len AS DWORD ' ULONG
                  bv_val AS ASCIIZ PTR ' PUCHAR
                  END TYPE

                  to

                  TYPE berval DWORD
                  bv_len AS DWORD ' ULONG
                  bv_val AS BYTE PTR ' PUCHAR
                  END TYPE

                  WinUser.inc
                  Changed

                  MACRO GET_RAWINPUT_CODE_WPARAM(wParam) = wParam AND %Hff

                  to

                  MACRO GET_RAWINPUT_CODE_WPARAM(wParam) = wParam AND &Hff

                  WinSvc.inc

                  Changed
                  #IF %DEF(%UNICODE)
                  MACRO SERVICES_ACTIVE_DATABASE = SERVICES_ACTIVE_DATABASEW
                  MACRO SERVICES_FAILED_DATABASE = SERVICES_FAILED_DATABASEW
                  %SC_GROUP_IDENTIFIER = %SC_GROUP_IDENTIFIERW
                  #ELSE ' NOT %DEF UNICODE
                  MACRO SERVICES_ACTIVE_DATABASE = SERVICES_ACTIVE_DATABASEA
                  MACRO SERVICES_FAILED_DATABASE = SERVICES_FAILED_DATABASEA
                  %SC_GROUP_IDENTIFIER = %SC_GROUP_IDENTIFIERA
                  #ENDIF ' NOT %DEF UNICODE

                  to

                  #IF %DEF(%UNICODE)
                  MACRO SERVICES_ACTIVE_DATABASE = $$SERVICES_ACTIVE_DATABASEW
                  MACRO SERVICES_FAILED_DATABASE = $$SERVICES_FAILED_DATABASEW
                  %SC_GROUP_IDENTIFIER = %SC_GROUP_IDENTIFIERW
                  #ELSE ' NOT %DEF UNICODE
                  MACRO SERVICES_ACTIVE_DATABASE = $SERVICES_ACTIVE_DATABASEA
                  MACRO SERVICES_FAILED_DATABASE = $SERVICES_FAILED_DATABASEA
                  %SC_GROUP_IDENTIFIER = %SC_GROUP_IDENTIFIERA
                  #ENDIF ' NOT %DEF UNICODE

                  Oaidl.inc
                  Changed
                  $IID_ITypeChangeEvents = GUID$("{00020411-0000-0000-C000-000000000046}")
                  to
                  $IID_ITypeChangeEvents = GUID$("{00020410-0000-0000-C000-000000000046}")

                  Forum: http://www.jose.it-berater.org/smfforum/index.php

                  Comment


                    #10
                    Thanks a lot Jose.

                    I'll update my files asap.

                    Fran

                    Comment


                      #11
                      José,
                      Anything new?

                      Comment


                        #12
                        Everything has stopped since the death of Z.
                        Forum: http://www.jose.it-berater.org/smfforum/index.php

                        Comment


                          #13
                          Understood. Is there anything we can do? Can we help?

                          Comment


                            #14
                            Hola José,

                            Is there much minor corrections beside the few little one I posted in your forum ?
                            Also, are these corrections included in the current downloadable WINAPI_III_107.rar ?

                            One more thanks for such a beautiful work...

                            Comment


                              #15
                              There are no more corrections. I stopped using PB several years ago. Is there anything that needs to be updated? The new APIs for Windows 10 are related to WinRT and the Universal Windows Platform and are unusable with PB.

                              > Also, are these corrections included in the current downloadable WINAPI_III_107.rar ?

                              No. I no longer I'm allowed to upload such big files. Anyway, there aren't many changes to do.
                              Forum: http://www.jose.it-berater.org/smfforum/index.php

                              Comment


                                #16
                                Note:
                                The maximum now is 30 MB a month. Since the 3_107 was ~76 MB it could be broken down in manageable chunks. Lately I have been translating DPI awareness functions, enums, and structures. Are you certain they are not applicable for use with PB? The only disclaimers I've come across so far would be windows 8.1 and up or Windows 10 for the most recent ones.

                                The WIN API is expanding from what I have seen.

                                Comment


                                  #17
                                  Here is a translation of ShellScalingApi.h.

                                  If somebody needs help with a translation, I can help, but I'm not going to revise a couple of thousand include files just to see if there is a new equate or function, especially considering that I no longer use PB.

                                  Some years ago, I was ready to write new include files for the promised 64-bit compiler, but this is history.
                                  Attached Files
                                  Forum: http://www.jose.it-berater.org/smfforum/index.php

                                  Comment


                                    #18
                                    Thank you José!

                                    Comment


                                      #19
                                      Thank you José.

                                      For those interested here is an update list... (Including the above ones)
                                      If you have more, please post it.

                                      Code:
                                       [noparse]
                                      José Roca "Windows API Headers 3.1.07" minor update 2020-01-21
                                      --
                                      WinBase.inc: After ['#define HasOverlappedIoCompleted] add...
                                      [MACRO HasOverlappedIoCompleted(lpOverlapped) = lpOverlapped.Internal??? <> %STATUS_PENDING]
                                      -
                                      WinNT.inc: After ['typedef WORD   SECURITY_DESCRIPTOR_CONTROL] add...
                                      [MACRO SECURITY_DESCRIPTOR_CONTROL=WORD]
                                      -
                                      ObjBase.inc: In [FUNCTION IIDFromString] replace ["IIDFromtString"] with ["IIDFromString"]
                                      [DECLARE FUNCTION IIDFromString IMPORT "OLE32.DLL" ALIAS "IIDFromString" ( _]
                                      [   BYREF lpsz AS WSTRINGZ _                             ' __in LPCOLESTR lpsz]
                                      [ , BYREF lpiid AS GUID _                                ' __out LPIID lpiid]
                                      [ ) AS LONG                                              ' HRESULT]
                                      -
                                      ShObjIdl.inc: (Also v1.19) Add one missing line in [INTERFACE ITaskbarList3 $IID_ITaskbarList3]
                                      [   METHOD AddTab ( _       ' VTable offset = 16]
                                      [     BYVAL hwnd AS DWORD _ ' __in HWND hwnd] This line is missing
                                      [   ) AS LONG               ' HRESULT]
                                      -
                                      WinUser.inc: After [%HSHELL_WINDOWREPLACING     = 14&] add [%HSHELL_MONITORCHANGED = 16&]
                                      [%HSHELL_MONITORCHANGED = 16&]
                                      -
                                      WinUser.inc: In [MACRO GET_RAWINPUT_CODE_WPARAM] change [%Hff] to [&Hff]
                                      [MACRO GET_RAWINPUT_CODE_WPARAM(wParam) = wParam AND &Hff]
                                      -
                                      Vfw.inc: In [capDriverConnect] change [%WM_CAP_SET_USER_DATA] with [%WM_CAP_DRIVER_CONNECT]
                                      [FUNCTION capDriverConnect (BYVAL hwnd AS DWORD, BYVAL i AS LONG) AS LONG]
                                      [   FUNCTION = SendMessage(hwnd, %WM_CAP_DRIVER_CONNECT, i, 0)]
                                      [END FUNCTION]
                                      -
                                      AfxDlg.inc: In [FUNCTION AfxPrintBitmapDlg] remove [OR %LR_LOADFROMFILE] duplicate
                                      [hBitmap = LoadImageW(%NULL, wszFileName, %IMAGE_BITMAP, 0, 0, %LR_LOADFROMFILE OR %LR_CREATEDIBSECTION OR %LR_DEFAULTSIZE)]
                                      -
                                      WinBer.inc: In [TYPE berval] change [ASCIIZ PTR] to [BYTE PTR] (As in Winldap.inc)
                                      [TYPE berval DWORD]
                                      [    bv_len AS DWORD     ' ULONG]
                                      [    bv_val AS BYTE PTR  ' PUCHAR]
                                      [END TYPE]
                                      -
                                      CommCtrl.inc: In RBBS_TOPALIGN, replace [' Keep band title hidden.] with [' Keep band in top row.]
                                      [%RBBS_TOPALIGN       = &H00000800???  ' keep band in top row.]
                                      -
                                      WinUser.inc: In [FUNCTION CopyCursor] change [ALIAS "CopyCursor"] to [ALIAS "CopyIcon"]
                                      [' // Note: CopyCursor is implemented as a call to the CopyIcon function.]
                                      [DECLARE FUNCTION CopyCursor IMPORT "USER32.DLL" ALIAS "CopyIcon" ( _]
                                      [   BYVAL hCursor AS DWORD _                             ' __in HCURSOR hCursor]
                                      [ ) AS DWORD                                             ' HCURSOR]
                                      -
                                      SdkDdkVer.inc: Below [%WIN32_WINNT_WIN7] you may add...
                                      [%WIN32_WINNT_WIN8     = &h0602??? 'Windows Eight]
                                      [%WIN32_WINNT_WINBLUE  = &h0603??? 'Windows Eight.1]
                                      [%WIN32_WINNT_WIN10    = &h0A00??? 'Windows Ten]
                                      -
                                      WinReg.inc: Below [c] you may add
                                      [%RRF_SUBKEY_WOW6464KEY   = &h00010000???]
                                      [%RRF_SUBKEY_WOW6432KEY   = &h00020000???]
                                      -
                                      ShellScalingApi.inc: Whole file may be added in your api folder from ShellScalingApi.zip at...
                                      https://forum.powerbasic.com/forum/jose-s-corner/downloads/61213-windows-api-headers-iii-v-1-07?p=788941#post788941
                                      https://forum.powerbasic.com/filedata/fetch?id=788942
                                      -
                                      WinSvc.inc: Replace [SERVICES_ACTIVE_DATABASEW with $$SERVICES_ACTIVE_DATABASEW]
                                                          [SERVICES_FAILED_DATABASEW with $$SERVICES_FAILED_DATABASEW]
                                                          [SERVICES_ACTIVE_DATABASEA with $SERVICES_ACTIVE_DATABASEA]
                                                          [SERVICES_FAILED_DATABASEA wuth $SERVICES_FAILED_DATABASEA]
                                      -
                                      OAIdl.inc: Replace [$IID_ITypeChangeEvents = GUID$("{00020411-0000-0000-C000-000000000046}")]
                                                    with [$IID_ITypeChangeEvents = GUID$("{00020410-0000-0000-C000-000000000046}")]
                                      -
                                      ListBoxCtrl.inc (Also api v1.19 for CC5/Win9): In [MACRO Listbox_GetItemRect] and[Listbox_GetItemRect]
                                      replace both [LB_GETITEMHEIGHT] with [LB_GETITEMRECT]
                                      -
                                      ListBoxCtrl.inc (Also api v1.19 for CC5/Win9: In [FUNCTION ListBox_SetCurSel]
                                      replace both...
                                      [SendMessage(hListBox, IIF&((GetWindowLong(hListBox, %GWL_STYLE) AND %LBS_MULTIPLESEL), %LB_SETSEL, %LB_SETCURSEL), Index, 0)]
                                      with
                                      [SendMessage(hListBox, %LB_SETCURSEL, Index, 0)]
                                      -
                                      Mfidl.inc: (Also v1.19) In [METHOD CreateObjectFromURL]
                                      Replace [BYVAL pObjectType AS LONG] with [BYREF pObjectType AS LONG]
                                      -
                                      Mfidl.inc: (v1.19 only) In [METHOD CreateObjectFromURL]
                                      Replace [BYVAL pwszURL AS DWORD] with [BYREF pwszURL AS DWORD]
                                      -
                                      WinSnmp.inc: In [TYPE smiCNTR64] change [hipart AS DWORD] to [hipart AS LONG]
                                      
                                      --
                                      [/noparse]
                                      Last edited by Pierre Bellisle; 21 Jan 2020, 07:42 PM.

                                      Comment


                                        #20
                                        'from Joe White, at:
                                        ' https://forum.powerbasic.com/forum/j...mp-inc-changes msg#1


                                        'I had to make two changes to WinSnmp.inc so 64-bit counters can be read correctly (using SNMPv2).
                                        ' This is because the smiCNTR64 structure contains a 64-bit unsigned integer, while PB only has signed 64-bit integers.
                                        ' So Joe made these changes:
                                        ' - Changed hipart from DWORD to LONG (1 line)
                                        ' - Changed hNumber from QUAD to smiCNTR64 (1 line)
                                        ' - Then I used MAK(QUAD) to get the value:
                                        ' For brevity, some SNMP initializing lines has been snipped, then I call SnmpGetVb to extract the returned value...
                                        ' LOCAL entryName AS smiOID
                                        ' LOCAL entryValue AS smiVALUE
                                        ' SnmpGetVb(hVbl, 1, entryName, entryValue)
                                        ' quadVal = MAK(QUAD, entryValue.value.hNumber.lopart, entryValue.value.hNumber.hipart)

                                        Comment

                                        Working...
                                        X
                                        😀
                                        🥰
                                        🤢
                                        😎
                                        😡
                                        👍
                                        👎