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

  • #41
    Thanks everybody!

    Comment


    • #42
      Ditto, gold mention to José.

      Still, maybe there is more to come.
      I updated the list.

      Comment


      • #43
        Likely we should mention the BITS?? use in WinUser.inc
        Code:
        '#define GET_APPCOMMAND_LPARAM(lParam) ((short)(HIWORD(lParam) & ~FAPPCOMMAND_MASK))
        '#define GET_DEVICE_LPARAM(lParam) ((WORD)(HIWORD(lParam) & FAPPCOMMAND_MASK))
        '#define GET_MOUSEORKEY_LPARAM GET_DEVICE_LPARAM
        '#define GET_FLAGS_LPARAM(lParam) (LOWORD(lParam))
        '#define GET_KEYSTATE_LPARAM(lParam) GET_FLAGS_LPARAM(lParam)
        
        'old MACRO GET_APPCOMMAND_LPARAM(lParam) = BITS%(HI(WORD, lParam) AND (NOT %FAPPCOMMAND_MASK))
        'old MACRO GET_DEVICE_LPARAM(lParam) = BITS??(HI(WORD, lParam) AND %FAPPCOMMAND_MASK)
        'old MACRO GET_APPCOMMAND_LPARAM(lParam) = BITS(INTEGER, HI(WORD, lParam) AND (NOT %FAPPCOMMAND_MASK))
        'old MACRO GET_DEVICE_LPARAM(lParam) = BITS(WORD, HI(WORD, lParam) AND %FAPPCOMMAND_MASK)
        MACRO GET_APPCOMMAND_LPARAM(lParam) = HI(WORD, lParam) AND &h0FFF
        MACRO GET_DEVICE_LPARAM(lParam) = HI(WORD, lParam) AND &hF000
        MACRO GET_MOUSEORKEY_LPARAM = GET_DEVICE_LPARAM(lParam)
        MACRO GET_FLAGS_LPARAM(lParam) = LO(WORD, lParam)
        MACRO GET_KEYSTATE_LPARAM(lParam) = GET_FLAGS_LPARAM(lParam)

        Comment


        • #44
          If we go this way, I'd do like the following code, which is more like the original SDK in my opinion.
          Note that your GET_MOUSEORKEY_LPARAM have a trouble maker as (lParam)
          Of course, since it is José's baby, I'll go with his decision...

          Code:
           
          MACRO GET_APPCOMMAND_LPARAM(lParam) = HI(INTEGER, lParam) AND (NOT %FAPPCOMMAND_MASK)
          MACRO GET_DEVICE_LPARAM(lParam)     = HI(WORD, lParam) AND %FAPPCOMMAND_MASK
          MACRO GET_MOUSEORKEY_LPARAM         = GET_DEVICE_LPARAM
          MACRO GET_FLAGS_LPARAM(lParam)      = LO(WORD, lParam)
          MACRO GET_KEYSTATE_LPARAM(lParam)   = GET_FLAGS_LPARAM(lParam)

          Comment


          • #45
            Originally posted by Pierre Bellisle View Post
            If we go this way, I'd do like the following code, which is more like the original SDK in my opinion.
            Note that your GET_MOUSEORKEY_LPARAM have a trouble maker as (lParam)
            Of course, since it is José's baby, I'll go with his decision...

            Code:
             
            MACRO GET_APPCOMMAND_LPARAM(lParam) = HI(INTEGER, lParam) AND (NOT %FAPPCOMMAND_MASK)
            MACRO GET_DEVICE_LPARAM(lParam) = HI(WORD, lParam) AND %FAPPCOMMAND_MASK
            MACRO GET_MOUSEORKEY_LPARAM = GET_DEVICE_LPARAM
            MACRO GET_FLAGS_LPARAM(lParam) = LO(WORD, lParam)
            MACRO GET_KEYSTATE_LPARAM(lParam) = GET_FLAGS_LPARAM(lParam)

            To avoid a subtle bug, those AND statements above should be wrapped in parentheses - just in case the macro is used inline.

            eg...

            Code:
            MACRO GET_APPCOMMAND_LPARAM(lParam) = (HI(INTEGER, lParam) AND (NOT %FAPPCOMMAND_MASK))
            MACRO GET_DEVICE_LPARAM(lParam) = (HI(WORD, lParam) AND %FAPPCOMMAND_MASK)
            By the way, many thanks for your contributions over the years Pierre and Jose. Amazing.

            Comment


            • #46
              Bits is used for casting, since PB has not a casting operator. PB will do an implicit casting if it was a function instead of a macro.

              Code:
              FUNCTION GET_APPCOMMAND_LPARAM (BYVAL lParam AS LONG) AS INTEGER
                 FUNCTION = HI(WORD, lParam) AND (NOT %FAPPCOMMAND_MASK)
              END FNCTION
              In #define GET_APPCOMMAND_LPARAM(lParam) ((short)(HIWORD(lParam) & ~FAPPCOMMAND_MASK)), (short) forces the result of the macro to be a short integer (INTEGER in PB) and BITS%(HI(WORD, lParam) AND (NOT %FAPPCOMMAND_MASK)) does the same. Of course, there are other ways to do it.
              Forum: http://www.jose.it-berater.org/smfforum/index.php

              Comment


              • #47
                My DPI Awareness translations untested. Perhaps you could look them over and see if there is anything salvageable out of them. Thanks

                HTML Code:
                [code]
                '----------------------------------------
                'These compile but they are untested.
                '----------------------------------------
                
                'When you want to opt a dialog or an HWND in a dialog out of
                'automatic DPI scaling you can use SetDialogDpiChangeBehavior
                '/SetDialogControlDpiChangeBehavior, respectively.
                
                %DPI_AWARENESS_CONTEXT = 1 'assumed to be 1
                '///////////////////////////////////////////////
                'BOOL AdjustWindowRectExForDpi(
                '  LPRECT lpRect,
                '  DWORD  dwStyle,
                '  BOOL   bMenu,
                '  DWORD  dwExStyle,
                '  UINT   dpi
                ');
                DECLARE FUNCTION AdjustWindowRectExForDpi IMPORT "USER32.DLL" ALIAS "AdjustWindowRectExForDpi" ( _
                  BYREF lpRect AS RECT     _  ' __inout CONST RECT * lpRect
                , BYVAL dwStyle AS DWORD   _  ' __in DWORD dwStyle
                , BYVAL bMenu AS LONG      _  ' __in BOOL bMenu
                , BYVAL dwExStyle AS DWORD _  ' __in DWORD dwExStyle
                , BYVAL dpi AS DWORD       _  ' __in UINT dpi
                ) AS LONG                     ' BOOL
                
                
                '///////////////////////////////////////////////
                'BOOL EnableNonClientDpiScaling(
                '  HWND hwnd
                ');
                DECLARE FUNCTION EnableNonClientDpiScaling IMPORT "USER32.DLL" ALIAS "EnableNonClientDpiScaling" ( _
                   BYVAL hwnd AS DWORD _                                ' __in HWND hwnd
                 ) AS LONG                                              ' BOOL
                
                '///////////////////////////////////////////////
                'DIALOG_CONTROL_DPI_CHANGE_BEHAVIORS GetDialogControlDpiChangeBehavior(
                '  HWND hWnd
                ');
                DECLARE FUNCTION GetDialogControlDpiChangeBehavior IMPORT "USER32.DLL" ALIAS "GetDialogControlDpiChangeBehavior" ( _
                   BYVAL hwnd AS DWORD _                                ' __in HWND hwnd
                ) AS LONG                                               ' DIALOG_CONTROL_DPI_CHANGE_BEHAVIORS
                
                
                '///////////////////////////////////////////////
                'DIALOG_DPI_CHANGE_BEHAVIORS GetDialogDpiChangeBehavior(
                '  HWND hDlg
                ');
                DECLARE FUNCTION GetDialogDpiChangeBehavior IMPORT "USER32.DLL" ALIAS "GetDialogDpiChangeBehavior" ( _
                  BYVAL hDlg AS DWORD _                                 ' __in HWND hDlg
                ) AS LONG                                               ' DIALOG_DPI_CHANGE_BEHAVIORS
                
                
                '///////////////////////////////////////////////
                'UINT GetDpiForSystem();
                DECLARE FUNCTION GetDpiForSystem IMPORT "USER32.DLL" ALIAS "GetDpiForSystem" ( _
                ) AS DWORD
                
                '/////////////////////////////////////////////// "user32.dll"
                'UINT GetDpiForWindow(
                '  HWND hwnd
                ');
                DECLARE FUNCTION GetDpiForWindow IMPORT "USER32.DLL" ALIAS "GetDpiForWindow" ( _
                  BYVAL hwnd AS DWORD _                                 ' __in HWND hwnd
                  ) AS DWORD                                            ' UINT
                
                
                '///////////////////////////////////////////////
                'UINT GetDpiFromDpiAwarenessContext(
                '  DPI_AWARENESS_CONTEXT value
                ');
                DECLARE FUNCTION GetDpiFromDpiAwarenessContext IMPORT "USER32.DLL" ALIAS "GetDpiFromDpiAwarenessContext" ( _
                  BYVAL value AS DWORD _                                ' __in DPI_AWARENESS_CONTEXT value
                ) AS DWORD                                              ' UINT
                
                
                '///////////////////////////////////////////////
                'DPI_AWARENESS_CONTEXT GetThreadDpiAwarenessContext();
                DECLARE FUNCTION GetThreadDpiAwarenessContext IMPORT "USER32.DLL" ALIAS "GetThreadDpiAwarenessContext" ( _
                ) AS DWORD                                              ' DPI_AWARENESS_CONTEXT
                
                
                '///////////////////////////////////////////////
                'DPI_HOSTING_BEHAVIOR GetThreadDpiHostingBehavior();
                DECLARE FUNCTION GetThreadDpiHostingBehavior IMPORT "USER32.DLL" ALIAS "GetThreadDpiHostingBehavior" ( _
                ) AS DWORD                                              ' DPI_HOSTING_BEHAVIOR
                
                
                '///////////////////////////////////////////////  "user32.dll"
                'DPI_AWARENESS_CONTEXT GetWindowDpiAwarenessContext(
                '  HWND hwnd
                ');
                DECLARE FUNCTION GetWindowDpiAwarenessContext IMPORT "USER32.DLL" ALIAS "GetWindowDpiAwarenessContext" ( _
                  BYVAL hwnd AS DWORD _                                 ' __in HWND hwnd
                  ) AS DWORD                                            ' DPI_AWARENESS_CONTEXT
                
                
                '///////////////////////////////////////////////
                'DPI_HOSTING_BEHAVIOR GetWindowDpiHostingBehavior(
                '  HWND hwnd
                ');
                DECLARE FUNCTION GetWindowDpiHostingBehavior IMPORT "USER32.DLL" ALIAS "GetWindowDpiHostingBehavior" ( _
                  BYVAL hwnd AS DWORD _                                 ' __in HWND hwnd
                  ) AS DWORD                                            ' DPI_HOSTING_BEHAVIOR
                
                
                '///////////////////////////////////////////////
                'BOOL IsValidDpiAwarenessContext(
                '  DPI_AWARENESS_CONTEXT value
                ');
                DECLARE FUNCTION IsValidDpiAwarenessContext IMPORT "USER32.DLL" ALIAS "IsValidDpiAwarenessContext" ( _
                  BYVAL value AS DWORD _                                ' __in DPI_AWARENESS_CONTEXT value
                 ) AS LONG                                              ' BOOL
                
                '///////////////////////////////////////////////
                'BOOL LogicalToPhysicalPointForPerMonitorDPI(
                '  HWND    hWnd,
                '  LPPOINT lpPoint
                ');
                DECLARE FUNCTION LogicalToPhysicalPointForPerMonitorDPI IMPORT "USER32.DLL" ALIAS "LogicalToPhysicalPointForPerMonitorDPI" ( _
                   BYVAL hwnd AS DWORD _                                ' __in HWND hwnd
                 , BYREF lpPoint AS POINT _                             ' __out LPPOINT lpPoint
                 ) AS LONG                                              'BOOL
                
                '///////////////////////////////////////////////
                'BOOL PhysicalToLogicalPointForPerMonitorDPI(
                '  HWND    hWnd,
                '  LPPOINT lpPoint
                ');
                DECLARE FUNCTION PhysicalToLogicalPointForPerMonitorDPI IMPORT "USER32.DLL" ALIAS "PhysicalToLogicalPointForPerMonitorDPI" ( _
                   BYVAL hwnd AS DWORD _                                ' __in HWND hwnd
                 , BYREF lpPoint AS POINT _                             ' __out LPPOINT lpPoint
                 ) AS LONG                                              'BOOL
                
                '///////////////////////////////////////////////
                'BOOL SetDialogControlDpiChangeBehavior(
                '  HWND                                hWnd,
                '  DIALOG_CONTROL_DPI_CHANGE_BEHAVIORS mask,
                '  DIALOG_CONTROL_DPI_CHANGE_BEHAVIORS values
                ');
                DECLARE FUNCTION SetDialogControlDpiChangeBehavior IMPORT "USER32.DLL" ALIAS "SetDialogControlDpiChangeBehavior" ( _
                   BYVAL hwnd AS DWORD _                                ' __in HWND hwnd
                 , BYVAL mask AS DWORD _                                ' __in DIALOG_CONTROL_DPI_CHANGE_BEHAVIORS
                 , BYVAL values AS DWORD _                              ' __inout? DIALOG_CONTROL_DPI_CHANGE_BEHAVIORS
                 ) AS LONG                                               'BOOL
                
                
                '///////////////////////////////////////////////
                'typedef enum  {
                '  DCDC_DEFAULT = 0,
                '  DCDC_DISABLE_FONT_UPDATE = 1,
                '  DCDC_DISABLE_RELAYOUT = 2
                '} DIALOG_CONTROL_DPI_CHANGE_BEHAVIORS;
                ' enum DIALOG_CONTROL_DPI_CHANGE_BEHAVIORS
                MACRO DIALOG_CONTROL_DPI_CHANGE_BEHAVIORS_ENUM = DWORD
                %DCDC_DEFAULT             = &H0???
                %DCDC_DISABLE_FONT_UPDATE = &H1???
                %DCDC_DISABLE_RELAYOUT    = &H2???
                
                
                '///////////////////////////////////////////////
                'BOOL SetDialogDpiChangeBehavior(
                '  HWND                        hDlg,
                '  DIALOG_DPI_CHANGE_BEHAVIORS mask,
                '  DIALOG_DPI_CHANGE_BEHAVIORS values
                ');
                DECLARE FUNCTION SetDialogDpiChangeBehavior IMPORT "USER32.DLL" ALIAS "SetDialogDpiChangeBehavior" ( _
                   BYVAL hDlg AS DWORD _                                ' __in HWND hDlg
                 , BYVAL mask AS DWORD _                                ' __in DIALOG_DPI_CHANGE_BEHAVIORS mask
                 , BYVAL values AS DWORD _                              ' __in DIALOG_DPI_CHANGE_BEHAVIORS values
                ) AS LONG                                               ' BOOL
                
                'example use return value is %DDC_DISABLE_CONTROL_RELAYOUT
                ' SetDialogDpiChangeBehavior(
                '    hwnd _
                '  , %DDC_DISABLE_RESIZE OR %DDC_DISABLE_CONTROL_RELAYOUT _
                '  , %DDC_DISABLE_CONTROL_RELAYOUT
                ' );
                
                
                '///////////////////////////////////////////////
                'typedef enum  {
                '  DDC_DEFAULT                     = 0x0000,
                '  DDC_DISABLE_ALL                 = 0x0001,
                '  DDC_DISABLE_RESIZE              = 0x0002,
                '  DDC_DISABLE_CONTROL_RELAYOUT    = 0x0004,
                '} DIALOG_DPI_CHANGE_BEHAVIORS;
                ' enum DIALOG_DPI_CHANGE_BEHAVIORS
                MACRO DIALOG_DPI_CHANGE_BEHAVIORS_ENUM = DWORD
                %DDC_DEFAULT                   = &H0???
                %DDC_DISABLE_ALL               = &H1???
                %DDC_DISABLE_RESIZE            = &H2???
                %DDC_DISABLE_CONTROL_RELAYOUT  = &H4???
                
                
                
                '///////////////////////////////////////////////
                'DPI_AWARENESS_CONTEXT SetThreadDpiAwarenessContext(
                '  DPI_AWARENESS_CONTEXT dpiContext
                ');
                DECLARE FUNCTION SetThreadDpiAwarenessContext IMPORT "USER32.DLL" ALIAS "SetThreadDpiAwarenessContext" ( _
                  BYVAL dpiContext AS DWORD _                      ' __in DPI_AWARENESS_CONTEXT dpiContext
                ) AS DWORD                                         '  DPI_AWARENESS_CONTEXT
                
                
                '///////////////////////////////////////////////
                'DPI_HOSTING_BEHAVIOR SetThreadDpiHostingBehavior(
                '  DPI_HOSTING_BEHAVIOR value
                ');
                DECLARE FUNCTION SetThreadDpiHostingBehavior IMPORT "USER32.DLL" ALIAS "SetThreadDpiHostingBehavior" ( _
                  BYVAL value AS DWORD _                           ' __in DPI_HOSTING_BEHAVIOR value
                ) AS DWORD                                         ' DPI_HOSTING_BEHAVIOR
                
                
                '///////////////////////////////////////////////
                'BOOL SystemParametersInfoForDpi(
                '  UINT  uiAction,
                '  UINT  uiParam,
                '  PVOID pvParam,
                '  UINT  fWinIni,
                '  UINT  dpi
                ');
                DECLARE FUNCTION SystemParametersInfoForDpi IMPORT "USER32.DLL" ALIAS "SystemParametersInfoForDpi" ( _
                   BYVAL uiAction AS DWORD _                       ' __in UINT  uiAction
                 , BYVAL uiParam AS DWORD _                        ' __in UINT  uiParam
                 , BYVAL pvParam AS DWORD _                        ' __reserved?? PVOID pvParam
                 , BYVAL fWinIni AS DWORD _                        ' __in UINT  fWinIni
                 , BYVAL dpi AS DWORD _                            ' __inout?? UINT  dpi
                ) AS LONG                                          ' BOOL
                
                
                '///////////////////////////////////////////////
                'typedef enum  {                      'from windef.h
                '  DPI_HOSTING_BEHAVIOR_INVALID = -1,
                '  DPI_HOSTING_BEHAVIOR_DEFAULT = 0,
                '  DPI_HOSTING_BEHAVIOR_MIXED   = 1
                '} DPI_HOSTING_BEHAVIOR;
                ' enum _DPI_HOSTING_BEHAVIOR {
                MACRO DPI_HOSTING_BEHAVIOR_ENUM = DWORD
                %DPI_HOSTING_BEHAVIOR_INVALID = &H0??? -1
                %DPI_HOSTING_BEHAVIOR_DEFAULT = &H0???
                %DPI_HOSTING_BEHAVIOR_MIXED   = &H1???
                
                
                '///////////////////////////////////////////////
                'typedef enum  {
                '  DPI_AWARENESS_INVALID = -1,
                '  DPI_AWARENESS_UNAWARE = 0,
                '  DPI_AWARENESS_SYSTEM_AWARE = 1,
                '  DPI_AWARENESS_PER_MONITOR_AWARE = 2
                '} DPI_AWARENESS;
                ' enum  _DPI_AWARENESS{
                MACRO DPI_AWARENESS_ENUM = DWORD
                %DPI_AWARENESS_INVALID           = &H0??? -1
                %DPI_AWARENESS_UNAWARE           = &H0???
                %DPI_AWARENESS_SYSTEM_AWARE      = &H1???
                %DPI_AWARENESS_PER_MONITOR_AWARE = &H2???
                
                
                '/////////////////////////////////////////////// windef.h
                '#define DPI_AWARENESS_CONTEXT_UNAWARE              ((DPI_AWARENESS_CONTEXT)-1)
                '#define DPI_AWARENESS_CONTEXT_SYSTEM_AWARE         ((DPI_AWARENESS_CONTEXT)-2)
                '#define DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE    ((DPI_AWARENESS_CONTEXT)-3)
                '#define DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 ((DPI_AWARENESS_CONTEXT)-4)
                '#define DPI_AWARENESS_CONTEXT_UNAWARE_GDISCALED    ((DPI_AWARENESS_CONTEXT)-5)
                %DPI_AWARENESS_CONTEXT_UNAWARE              = %DPI_AWARENESS_CONTEXT -1
                %DPI_AWARENESS_CONTEXT_SYSTEM_AWARE         = %DPI_AWARENESS_CONTEXT -2
                %DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE    = %DPI_AWARENESS_CONTEXT -3
                %DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 = %DPI_AWARENESS_CONTEXT -4
                %DPI_AWARENESS_CONTEXT_UNAWARE_GDISCALED    = %DPI_AWARENESS_CONTEXT -5
                
                
                '///////////////////////////////////////////////
                'HRESULT GetProcessDpiAwareness(          'from shellscalingapi.h  "SHcore.dll"
                '  HANDLE                hprocess,
                '  PROCESS_DPI_AWARENESS *value
                ');  CAPTURED FROM J.ROCA shellscalingapi.inc
                DECLARE FUNCTION GetProcessDpiAwareness IMPORT "SHCORE.DLL" ALIAS "GetProcessDpiAwareness" ( _
                   BYVAL hprocess AS DWORD, _                           ' __in HANDLE hprocess
                   BYREF value AS LONG _                                ' __out PROCESS_DPI_AWARENESS value
                 ) AS LONG                                              ' HRESULT
                
                '///////////////////////////////////////////////
                'internal enum  {
                '  PROCESS_DPI_UNAWARE = 0,
                '  PROCESS_SYSTEM_DPI_AWARE = 1,
                '  PROCESS_PER_MONITOR_DPI_AWARE = 2
                '} PROCESS_DPI_AWARENESS
                'internal enum  {
                MACRO PROCESS_DPI_AWARENESS_ENUM = DWORD
                %PROCESS_DPI_UNAWARE           = &H0???
                %PROCESS_SYSTEM_DPI_AWARE      = &H1???
                %PROCESS_PER_MONITOR_DPI_AWARE = &H2???
                
                
                '///////////////////////////////////////////////
                'DPI_AWARENESS GetAwarenessFromDpiAwarenessContext(    winuser.h  "user32.dll"
                '  DPI_AWARENESS_CONTEXT value
                ');
                DECLARE FUNCTION GetAwarenessFromDpiAwarenessContext IMPORT "USER32.DLL" ALIAS "GetAwarenessFromDpiAwarenessContext" ( _
                  BYVAL value AS DWORD _                                ' __in DPI_AWARENESS_CONTEXT value
                ) AS DWORD                                              ' DPI_AWARENESS
                
                
                '///////////////////////////////////////////////
                'BOOL AreDpiAwarenessContextsEqual(               winuser.h  "user32.dll"
                '  DPI_AWARENESS_CONTEXT dpiContextA,
                '  DPI_AWARENESS_CONTEXT dpiContextB
                ');
                DECLARE FUNCTION AreDpiAwarenessContextsEqual IMPORT "USER32.DLL" ALIAS "AreDpiAwarenessContextsEqual" ( _
                   BYVAL dpiContextA AS DWORD _                         ' __in DPI_AWARENESS_CONTEXT dpiContextA
                 , BYVAL dpiContextB AS DWORD _                         ' __in DPI_AWARENESS_CONTEXT dpiContextB
                 ) AS LONG                                              ' BOOL
                'Returns TRUE if the values are equal, otherwise FALSE.
                
                '-------------------------
                [/code]

                Comment


                • #48
                  A couple more...
                  HTML Code:
                  [code]'///////////////////////////////////////////////  Winuser.h   NEW: 23 JAN 2020
                  'It is recommended that you set the process-default DPI
                  'awareness via application manifest. See Setting the
                  'default DPI awareness for a process for more information.
                  'Setting the process-default DPI awareness via API call
                  'can lead to unexpected application behavior.
                  'BOOL SetProcessDpiAwarenessContext(
                  '  DPI_AWARENESS_CONTEXT value
                  ');
                  DECLARE FUNCTION SetProcessDpiAwarenessContext IMPORT "USER32.DLL" ALIAS "SetProcessDpiAwarenessContext" ( _
                    BYVAL value AS DWORD _                                ' __in DPI_AWARENESS_CONTEXT value
                  ) AS LONG                                               ' BOOL
                  'This function returns TRUE if the operation was successful, and
                  'FALSE otherwise. To get extended error information, call GetLastError.
                  
                  [/code]
                  
                  [code]'/////////////////////////////////////////////// uxtheme.h   NEW: 23 JAN 2020
                  'A variant of OpenThemeData that opens a theme handle associated with a specific DPI.
                  'void OpenThemeDataForDpi(
                  '  HWND    hwnd,
                  '  LPCWSTR pszClassList,
                  '  UINT    dpi
                  ');
                  DECLARE SUB OpenThemeDataForDpi IMPORT "USER32.DLL" ALIAS "OpenThemeDataForDpi" ( _
                     BYVAL hwnd AS DWORD _                                ' __in HWND hwnd
                   , BYREF pszClassList AS WSTRINGZ _                     ' __in LPCWSTR pszClassList
                   , BYVAL dpi AS DWORD _                                 ' __in UINT dpi
                  )                                                       'VOID
                  'Return See OpenThemeData.
                  'dpi
                  'The specified DPI value with which to associate the theme handle.
                  'The function will return an error if this value is outside of those
                  'that correspond to the set of connected monitors.
                  
                  [/code]

                  Comment


                  • #49
                    This is what has me pulling my hair out. José could please set me straight on this?

                    HTML Code:
                    [code]
                    '///////////////////////////////////////////////  
                    'DECLARE_HANDLE(DPI_AWARENESS_CONTEXT);
                    
                    '/////////////////////////////////////////////// windef.h
                    '#define DPI_AWARENESS_CONTEXT_UNAWARE              ((DPI_AWARENESS_CONTEXT)-1)
                    '#define DPI_AWARENESS_CONTEXT_SYSTEM_AWARE         ((DPI_AWARENESS_CONTEXT)-2)
                    '#define DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE    ((DPI_AWARENESS_CONTEXT)-3)
                    '#define DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 ((DPI_AWARENESS_CONTEXT)-4)
                    '#define DPI_AWARENESS_CONTEXT_UNAWARE_GDISCALED    ((DPI_AWARENESS_CONTEXT)-5)
                    [/code]

                    Comment


                    • #50
                      NOTE:
                      Your WinTab.inc found here did not make it into my version of 3.1.07.

                      Comment


                      • #51
                        Originally posted by Jim Fritts View Post
                        NOTE:
                        Your WinTab.inc found here did not make it into my version of 3.1.07.
                        It is not a SDK header, but an header for the Wacom Tablet PC API.
                        Forum: http://www.jose.it-berater.org/smfforum/index.php

                        Comment


                        • #52
                          Originally posted by Jim Fritts View Post
                          This is what has me pulling my hair out. José could please set me straight on this?

                          HTML Code:
                          [code]
                          '///////////////////////////////////////////////
                          'DECLARE_HANDLE(DPI_AWARENESS_CONTEXT);
                          
                          '/////////////////////////////////////////////// windef.h
                          '#define DPI_AWARENESS_CONTEXT_UNAWARE ((DPI_AWARENESS_CONTEXT)-1)
                          '#define DPI_AWARENESS_CONTEXT_SYSTEM_AWARE ((DPI_AWARENESS_CONTEXT)-2)
                          '#define DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE ((DPI_AWARENESS_CONTEXT)-3)
                          '#define DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 ((DPI_AWARENESS_CONTEXT)-4)
                          '#define DPI_AWARENESS_CONTEXT_UNAWARE_GDISCALED ((DPI_AWARENESS_CONTEXT)-5)
                          [/code]
                          I think that it must be:

                          Code:
                          %DPI_AWARENESS_CONTEXT = 0
                          %DPI_AWARENESS_CONTEXT_UNAWARE = %DPI_AWARENESS_CONTEXT - 1
                          %DPI_AWARENESS_CONTEXT_SYSTEM_AWARE = %DPI_AWARENESS_CONTEXT - 2
                          %DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE = %DPI_AWARENESS_CONTEXT - 3
                          %DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 = %DPI_AWARENESS_CONTEXT - 4
                          %DPI_AWARENESS_CONTEXT_UNAWARE_GDISCALED = %DPI_AWARENESS_CONTEXT - 5
                          Forum: http://www.jose.it-berater.org/smfforum/index.php

                          Comment


                          • #53
                            I think that it must be:

                            That was what I was thinking but needed your verification. Thank you.

                            Interesting thing is that some sites suggest the values are this:
                            HTML Code:
                            [code]
                            '  %DPI_AWARENESS_CONTEXT_UNAWARE              = 16
                            '  %DPI_AWARENESS_CONTEXT_SYSTEM_AWARE         = 17
                            '  %DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE    = 18
                            '  %DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 = 34
                            '  %DPI_AWARENESS_CONTEXT_UNAWARE_GDISCALED    = ???????
                            [/code]
                            I do not know how to reconcile that.

                            Comment


                            • #54
                              I'm sure this is just a typo, but I ran into it by accident. LietView_GetTooltipsFont should be ListView_GetTooltipsFont
                              Code:
                              ' ========================================================================================
                              ' Retrieves the font used by the ToolTip control that the list-view control uses to display ToolTips.
                              ' ========================================================================================
                              FUNCTION LietView_GetTooltipsFont (BYVAL hwndLV AS DWORD) AS DWORD
                                 LOCAL hwndTooltips AS DWORD
                                 hwndTooltips = SendMessage(hwndLV, %LVM_GETTOOLTIPS, 0, 0)
                                 FUNCTION = SendMessage(hwndTooltips, %WM_GETFONT, 0, 0)
                              END FUNCTION

                              Comment


                              • #55
                                Thanks Frank

                                Comment


                                • #56
                                  I can't seem to download the file in the first post, Chrome says "Network Error".
                                  "Not my circus, not my monkeys."

                                  Comment


                                  • #57
                                    Originally posted by Eric Pearson View Post
                                    I can't seem to download the file in the first post, Chrome says "Network Error".

                                    Working for me with FireFox (Which I know in no way helps you.)

                                    Comment


                                    • #58
                                      Yeah, it looks like I have a local network issue. Never mind, Adam please ignore the Flag.
                                      "Not my circus, not my monkeys."

                                      Comment


                                      • #59
                                        If you need the file, I can email it to you?

                                        Comment


                                        • #60
                                          Thanks, Opera and Firefox also failed... but Edge gave me an error message but then it let me "resume" and the download worked fine.
                                          "Not my circus, not my monkeys."

                                          Comment

                                          Working...
                                          X