Anpassung Makro 32 +64-bit
02.09.2024 12:41:53
mb12
ich habe von Josef vor viiielen Jahren ein Makro erhalten, das ich jetzt auf 64-bit angepasst habe. Oben die alte Version, unten die neue.
Funktioniert, aber wie kann ich das Makro kürzen?
Lieben Dank, Margarete
Option Explicit
'Public Declare Function ChooseColor Lib "comdlg32.dll" Alias "ChooseColorA" (pChoosecolor As _
' ChooseColor) As Long
'Public Declare Function GetWindowDC Lib "user32" (ByVal hwnd As Long) As Long
'Public Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
'Public Declare Function GetPixel Lib "gdi32.dll" (ByVal hdc As Long, ByVal nXPos As Long, ByVal _
' nYPos As Long) As Long
'Public Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
'Public Declare Function WindowFromPoint Lib "user32" (ByVal xPoint As Long, ByVal yPoint As Long) _
' As Long
#If Win64 Then
Public Declare PtrSafe Function ChooseColor Lib "comdlg32.dll" Alias "ChooseColorA" (pChoosecolor As _
ChooseColor) As Long
#Else
Public Declare Function ChooseColor Lib "comdlg32.dll" Alias "ChooseColorA" (pChoosecolor As _
ChooseColor) As Long
#End If
#If Win64 Then
Public Declare PtrSafe Function GetWindowDC Lib "user32" (ByVal hwnd As Long) As Long
#Else
Public Declare Function GetWindowDC Lib "user32" (ByVal hwnd As Long) As Long
#End If
#If Win64 Then
Public Declare PtrSafe Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
#Else
Public Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
#End If
#If Win64 Then
Public Declare PtrSafe Function GetPixel Lib "gdi32.dll" (ByVal hdc As Long, ByVal nXPos As Long, ByVal _
nYPos As Long) As Long
#Else
Public Declare Function GetPixel Lib "gdi32.dll" (ByVal hdc As Long, ByVal nXPos As Long, ByVal _
nYPos As Long) As Long
#End If
#If Win64 Then
Public Declare PtrSafe Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
#Else
Public Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
#End If
#If Win64 Then
Public Declare PtrSafe Function WindowFromPoint Lib "user32" (ByVal xPoint As Long, ByVal yPoint As Long) _
As Long
#Else
Public Declare Function WindowFromPoint Lib "user32" (ByVal xPoint As Long, ByVal yPoint As Long) _
As Long
#End If
Anzeige