by イグトランス » 2005年12月26日(月) 11:40
どこに投稿すべきか迷いましたが,64bitネタということでここを選びました。
GetWindowLongなどをLONG_PTRにして64bitにも対応した
GetWindowLongPtrなどの宣言がまだなされていないので,私が作ってみました。
ぜひ次のABバージョンアップ時に収録してくださいという狙いです。
既に作られていたならお騒がせしました。
[ここをクリックすると内容が表示されます] [ここをクリックすると非表示にします]コード: 全て選択
Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (hwnd As HWND, nIndex As Long) As Long
Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (hwnd As HWND, nIndex As Long, NewValue As Long) As Long
Declare Function GetClassLong Lib "user32" Alias "GetClassLongA" (hwnd As HWND, nIndex As Long) As DWord
Declare Function SetClassLong Lib "user32" Alias "SetClassLongA" (hwnd As HWND, nIndex As Long, NewValue As Long) As DWord
#ifdef _WIN64
Declare Function GetWindowLongPtr Lib "user32" Alias "GetWindowLongPtrA" (hwnd As HWND, nIndex As Long) As LONG_PTR
Declare Function SetWindowLongPtr Lib "user32" Alias "SetWindowLongPtrA" (hwnd As HWND, nIndex As Long, NewValue As LONG_PTR) As LONG_PTR
Declare Function GetClassLongPtr Lib "user32" Alias "GetClassLongPtrA" (hwnd As HWND, nIndex As Long) As ULONG_PTR
Declare Function SetClassLongPtr Lib "user32" Alias "SetClassLongPtrA" (hwnd As HWND, nIndex As Long, NewValue As LONG_PTR) As ULONG_PTR
#else
Declare Function GetWindowLongPtr Lib "user32" Alias "GetWindowLongA" (hwnd As HWND, nIndex As Long) As LONG_PTR
Declare Function SetWindowLongPtr Lib "user32" Alias "SetWindowLongA" (hwnd As HWND, nIndex As Long, NewValue As LONG_PTR) As LONG_PTR
Declare Function GetClassLongPtr Lib "user32" Alias "GetClassLongA" (hwnd As HWND, nIndex As Long) As ULONG_PTR
Declare Function SetClassLongPtr Lib "user32" Alias "SetClassLongA" (hwnd As HWND, nIndex As Long, NewValue As LONG_PTR) As ULONG_PTR
Const GCL_MENUNAME = -8
Const GCL_HBRBACKGROUND = -10
Const GCL_HCURSOR = -12
Const GCL_HICON = -14
Const GCL_HMODULE = -16
Const GCL_WNDPROC = -24
Const GCL_HICONSM = -34
Const GWL_WNDPROC = -4
Const GWL_HINSTANCE = -6
Const GWL_HWNDPARENT = -8
Const GWL_USERDATA = -21
Const DWL_MSGRESULT = 0
Const DWL_DLGPROC = 4
Const DWL_USER = 8
#endif
Const GWL_STYLE = -16
Const GWL_EXSTYLE = -20
Const GWL_ID = -12
Const GWLP_WNDPROC = -4
Const GWLP_HINSTANCE = -6
Const GWLP_HWNDPARENT = -8
Const GWLP_USERDATA = -21
Const GCL_CBWNDEXTRA = -18
Const GCL_CBCLSEXTRA = -20
Const GCL_STYLE = -26
Const GCW_ATOM = -32
Const GCLP_MENUNAME = -8
Const GCLP_HBRBACKGROUND = -10
Const GCLP_HCURSOR = -12
Const GCLP_HICON = -14
Const GCLP_HMODULE = -16
Const GCLP_WNDPROC = -24
Const GCLP_HICONSM = -34
/*
Const DWLP_MSGRESULT = 0
Const DWLP_DLGPROC = DWLP_MSGRESULT + SizeOf (LRESULT)
Const DWLP_USER = DWLP_DLGPROC + SizeOf (DLGPROC)
*/
どこに投稿すべきか迷いましたが,64bitネタということでここを選びました。
GetWindowLongなどをLONG_PTRにして64bitにも対応した
GetWindowLongPtrなどの宣言がまだなされていないので,私が作ってみました。
ぜひ次のABバージョンアップ時に収録してくださいという狙いです。
既に作られていたならお騒がせしました。
[hide][code]Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (hwnd As HWND, nIndex As Long) As Long
Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (hwnd As HWND, nIndex As Long, NewValue As Long) As Long
Declare Function GetClassLong Lib "user32" Alias "GetClassLongA" (hwnd As HWND, nIndex As Long) As DWord
Declare Function SetClassLong Lib "user32" Alias "SetClassLongA" (hwnd As HWND, nIndex As Long, NewValue As Long) As DWord
#ifdef _WIN64
Declare Function GetWindowLongPtr Lib "user32" Alias "GetWindowLongPtrA" (hwnd As HWND, nIndex As Long) As LONG_PTR
Declare Function SetWindowLongPtr Lib "user32" Alias "SetWindowLongPtrA" (hwnd As HWND, nIndex As Long, NewValue As LONG_PTR) As LONG_PTR
Declare Function GetClassLongPtr Lib "user32" Alias "GetClassLongPtrA" (hwnd As HWND, nIndex As Long) As ULONG_PTR
Declare Function SetClassLongPtr Lib "user32" Alias "SetClassLongPtrA" (hwnd As HWND, nIndex As Long, NewValue As LONG_PTR) As ULONG_PTR
#else
Declare Function GetWindowLongPtr Lib "user32" Alias "GetWindowLongA" (hwnd As HWND, nIndex As Long) As LONG_PTR
Declare Function SetWindowLongPtr Lib "user32" Alias "SetWindowLongA" (hwnd As HWND, nIndex As Long, NewValue As LONG_PTR) As LONG_PTR
Declare Function GetClassLongPtr Lib "user32" Alias "GetClassLongA" (hwnd As HWND, nIndex As Long) As ULONG_PTR
Declare Function SetClassLongPtr Lib "user32" Alias "SetClassLongA" (hwnd As HWND, nIndex As Long, NewValue As LONG_PTR) As ULONG_PTR
Const GCL_MENUNAME = -8
Const GCL_HBRBACKGROUND = -10
Const GCL_HCURSOR = -12
Const GCL_HICON = -14
Const GCL_HMODULE = -16
Const GCL_WNDPROC = -24
Const GCL_HICONSM = -34
Const GWL_WNDPROC = -4
Const GWL_HINSTANCE = -6
Const GWL_HWNDPARENT = -8
Const GWL_USERDATA = -21
Const DWL_MSGRESULT = 0
Const DWL_DLGPROC = 4
Const DWL_USER = 8
#endif
Const GWL_STYLE = -16
Const GWL_EXSTYLE = -20
Const GWL_ID = -12
Const GWLP_WNDPROC = -4
Const GWLP_HINSTANCE = -6
Const GWLP_HWNDPARENT = -8
Const GWLP_USERDATA = -21
Const GCL_CBWNDEXTRA = -18
Const GCL_CBCLSEXTRA = -20
Const GCL_STYLE = -26
Const GCW_ATOM = -32
Const GCLP_MENUNAME = -8
Const GCLP_HBRBACKGROUND = -10
Const GCLP_HCURSOR = -12
Const GCLP_HICON = -14
Const GCLP_HMODULE = -16
Const GCLP_WNDPROC = -24
Const GCLP_HICONSM = -34
/*
Const DWLP_MSGRESULT = 0
Const DWLP_DLGPROC = DWLP_MSGRESULT + SizeOf (LRESULT)
Const DWLP_USER = DWLP_DLGPROC + SizeOf (DLGPROC)
*/[/code][/hide]