; 20240422:dbgba添加了数据大小到列表中,并优化了显示
; ==============================================================
; AHK Version ...: AHK_L 1.1.22.00 x64 Unicode
; Win Version ...: Windows 7 Professional x64 SP1
; Description ...: Windows Data Types for AHK
;                 (https://msdn.microsoft.com/en-us/library/aa383751.aspx)
; Version .......: v0.2
; Modified ......: 2015.05.04-1927
; Author ........: jNizM(+ just me for the translation)
; Licence .......: Unlicense(http://unlicense.org/)
; ==============================================================
;@Ahk2Exe-SetName Windows_Data_Types_for_AHK
;@Ahk2Exe-SetDescription Windows Data Types for AHK
;@Ahk2Exe-SetVersion v0.2
;@Ahk2Exe-SetCopyright Copyright(c) 2015-2015`, jNizM
;@Ahk2Exe-SetOrigFilename Windows_Data_Types_for_AHK.ahk
; ==============================================================

; GLOBAL SETTINGS =====================================================

#Warn
#NoEnv
#SingleInstance Force

; MSDN_TYPES ==========================================================

; Windows数据类型大小:https://www.autohotkey.com/boards/viewtopic.php?t=79797
; https://docs.microsoft.com/en-us/windows/win32/winprog/windows-data-types
MSDN_TYPES=
(
ATOM,UShort,2 / 2,,typedef WORD ATOM
BOOL,Int,4 / 4,,typedef int BOOL
BOOLEAN,UChar,1 / 1,,typedef BYTE BOOLEAN
BYTE,UChar,1 / 1,,typedef unsigned char BYTE
CCHAR,Char,1 / 1,,typedef char CCHAR
CHAR,Char,1 / 1,,typedef char CHAR
COLORREF,UInt,4 / 4,,typedef DWORD COLORREF
DWORD,UInt,4 / 4,,typedef unsigned long DWORD
DWORDLONG,Int64,8 / 8,,typedef unsigned __int64 DWORDLONG
DWORD_PTR,UPtr,4 / 8,,typedef ULONG_PTR DWORD_PTR
DWORD32,UInt,4 / 4,,typedef unsigned int DWORD32
DWORD64,Int64,8 / 8,,typedef unsigned __int64 DWORD64
FLOAT,Float,4 / 4,,typedef float FLOAT
HACCEL,Ptr,4 / 8,,typedef HANDLE HACCEL
HALF_PTR,Short(32)|Int(64),2 / 4,,typedef short HALF_PTR|typedef int HALF_PTR
HANDLE,Ptr,4 / 8,,typedef PVOID HANDLE
HBITMAP,Ptr,4 / 8,,typedef HANDLE HBITMAP
HBRUSH,Ptr,4 / 8,,typedef HANDLE HBRUSH
HCOLORSPACE,Ptr,4 / 8,,typedef HANDLE HCOLORSPACE
HCONV,Ptr,4 / 8,,typedef HANDLE HCONV
HCONVLIST,Ptr,4 / 8,,typedef HANDLE HCONVLIST
HCURSOR,Ptr,4 / 8,,typedef HICON HCURSOR
HDC,Ptr,4 / 8,,typedef HANDLE HDC
HDDEDATA,Ptr,4 / 8,,typedef HANDLE HDDEDATA
HDESK,Ptr,4 / 8,,typedef HANDLE HDESK
HDROP,Ptr,4 / 8,,typedef HANDLE HDROP
HDWP,Ptr,4 / 8,,typedef HANDLE HDWP
HENHMETAFILE,Ptr,4 / 8,,typedef HANDLE HENHMETAFILE
HFILE,Int,4 / 4,,typedef int HFILE
HFONT,Ptr,4 / 8,,typedef HANDLE HFONT
HGDIOBJ,Ptr,4 / 8,,typedef HANDLE HGDIOBJ
HGLOBAL,Ptr,4 / 8,,typedef HANDLE HGLOBAL
HHOOK,Ptr,4 / 8,,typedef HANDLE HHOOK
HICON,Ptr,4 / 8,,typedef HANDLE HICON
HINSTANCE,Ptr,4 / 8,,typedef HANDLE HINSTANCE
HKEY,Ptr,4 / 8,,typedef HANDLE HKEY
HKL,Ptr,4 / 8,,typedef HANDLE HKL
HLOCAL,Ptr,4 / 8,,typedef HANDLE HLOCAL
HMENU,Ptr,4 / 8,,typedef HANDLE HMENU
HMETAFILE,Ptr,4 / 8,,typedef HANDLE HMETAFILE
HMODULE,Ptr,4 / 8,,typedef HINSTANCE HMODULE
HMONITOR,Ptr,4 / 8,,typedef HANDLE HMONITOR
HPALETTE,Ptr,4 / 8,,typedef HANDLE HPALETTE
HPEN,Ptr,4 / 8,,typedef HANDLE HPEN
HRESULT,Int,4 / 4,,typedef LONG HRESULT
HRGN,Ptr,4 / 8,,typedef HANDLE HRGN
HRSRC,Ptr,4 / 8,,typedef HANDLE HRSRC
HSZ,Ptr,4 / 8,,typedef HANDLE HSZ
HWINSTA,Ptr,4 / 8,,typedef HANDLE WINSTA
HWND,Ptr,4 / 8,,typedef HANDLE HWND
INT,Int,4 / 4,,typedef int INT
INT_PTR,Ptr,4 / 8,,typedef int INT_PTR / __int64 INT_PTR
INT8,Char,1 / 1,,typedef signed char INT8
INT16,Short,2 / 2,,typedef signed short INT16
INT32,Int,4 / 4,,typedef signed int INT32
INT64,Int64,8 / 8,,typedef signed __int64 INT64
LANGID,UShort,2 / 2,,typedef WORD LANGID
LCID,UInt,4 / 4,,typedef DWORD LCID
LCTYPE,UInt,4 / 4,,typedef DWORD LCTYPE
LGRPID,UInt,4 / 4,,typedef DWORD LGRPID
LONG,Int,4 / 4,,typedef long LONG
LONGLONG,Int64,8 / 8,,typedef __int64 LONGLONG
LONG_PTR,Ptr,4 / 8,,typedef long LONG_PTR / __int64 LONG_PTR
LONG32,Int,4 / 4,,typedef signed int LONG32
LONG64,Int64,8 / 8,,typedef __int64 LONG64
LPARAM,Ptr,4 / 8,,typedef LONG_PTR LPARAM
LPBOOL,Ptr,4 / 8,IntP,typedef BOOL far *LPBOOL
LPBYTE,Ptr,4 / 8,UCharP,typedef BYTE far *LPBYTE
LPCOLORREF,Ptr,4 / 8,UIntP,typedef DWORD *LPCOLORREF
LPCSTR,Ptr,4 / 8,Str / AStr,typedef __nullterminated CONST CHAR *LPCST
LPCTSTR,Ptr,4 / 8,Str,typedef LPCSTR LPCTSTR / LPCWSTR LPCTSTR
LPCVOID,Ptr,4 / 8,PtrP,typedef CONST void *LPCVOID
LPCWSTR,Ptr,4 / 8,Str / WStr,typedef CONST WCHAR *LPCWSTR
LPDWORD,Ptr,4 / 8,UIntP,typedef DWORD *LPDWORD
LPHANDLE,Ptr,4 / 8,PtrP,typedef HANDLE *LPHANDLE
LPINT,Ptr,4 / 8,IntP,typedef int *LPINT
LPLONG,Ptr,4 / 8,IntP,typedef long *LPLONG
LPSTR,Ptr,4 / 8,Str / AStr,typedef CHAR *LPSTR
LPTSTR,Ptr,4 / 8,Str,typedef LPSTR LPTSTR / LPWSTR LPTSTR
LPVOID,Ptr,4 / 8,PtrP,typedef void *LPVOID
LPWORD,Ptr,4 / 8,UShortP,typedef WORD *LPWORD
LPWSTR,Ptr,4 / 8,Str / WStr,typedef WCHAR *LPWSTR
LRESULT,Ptr,4 / 8,,typedef LONG_PTR LRESULT
PBOOL,Ptr,4 / 8,IntP,typedef BOOL *PBOOL
PBOOLEAN,Ptr,4 / 8,CharP,typedef BOOLEAN *PBOOLEAN
PBYTE,Ptr,4 / 8,UCharP,typedef BYTE *PBYTE
PCHAR,Ptr,4 / 8,CharP,typedef CHAR *PCHAR
PCSTR,Ptr,4 / 8,Str / AStr,typedef CONST CHAR *PCSTR
PCTSTR,Ptr,4 / 8,Str,typedef LPCSTR PCTSTR / LPCWSTR PCTSTR
PCWSTR,Ptr,4 / 8,Str / WStr,typedef CONST WCHAR *PCWSTR
PDWORD,Ptr,4 / 8,UIntP,typedef DWORD *PDWORD
PDWORDLONG,Ptr,4 / 8,Int64P,typedef DWORDLONG *PDWORDLONG
PDWORD_PTR,Ptr,4 / 8,UPtrP,typedef DWORD_PTR *PDWORD_PTR
PDWORD32,Ptr,4 / 8,UIntP,typedef DWORD32 *PDWORD3
PDWORD64,Ptr,4 / 8,Int64P,typedef DWORD64 *PDWORD64
PFLOAT,Ptr,4 / 8,FloatP,typedef FLOAT *PFLOAT
PHALF_PTR,Short(32)|Int(64),4 / 8,ShortP|IntP,typedef HALF_PTR *PHALF_PTR|typedef HALF_PTR *PHALF_PTR
PHANDLE,Ptr,4 / 8,PtrP,typedef HANDLE *PHANDLE
PHKEY,Ptr,4 / 8,PtrP,typedef HKEY *PHKEY
PINT,Ptr,4 / 8,IntP,typedef int *PINT
PINT_PTR,Ptr,4 / 8,PtrP,typedef INT_PTR *PINT_PTR
PINT8,Ptr,4 / 8,CharP,typedef INT8 *PINT8
PINT16,Ptr,4 / 8,ShortP,typedef INT16 *PINT16
PINT32,Ptr,4 / 8,IntP,typedef INT32 *PINT32
PINT64,Ptr,4 / 8,Int64P,typedef INT64 *PINT64
PLCID,Ptr,4 / 8,UIntP,typedef PDWORD PLCID
PLONG,Ptr,4 / 8,IntP,typedef LONG *PLONG
PLONGLONG,Ptr,4 / 8,Int64P,typedef LONGLONG *PLONGLONG
PLONG_PTR,Ptr,4 / 8,PtrP,typedef LONG_PTR *PLONG_PTR
PLONG32,Ptr,4 / 8,IntP,typedef LONG32 *PLONG32
PLONG64,Ptr,4 / 8,Int64P,typedef LONG64 *PLONG64
POINTER_32,Int,无法编译,,#define POINTER_32 __ptr32
POINTER_64,Int64,无法编译,,#define POINTER_64 __ptr64
POINTER_SIGNED,Ptr,无法编译,,#define POINTER_SIGNED __sptr
POINTER_UNSIGNED,UPtr,无法编译,,#define POINTER_UNSIGNED __uptr
PSHORT,Ptr,4 / 8,ShortP,typedef SHORT *PSHORT
PSIZE_T,Ptr,4 / 8,UPtrP,typedef SIZE_T *PSIZE_T
PSSIZE_T,Ptr,4 / 8,PtrP,typedef SSIZE_T *PSSIZE_T
PSTR,Ptr,4 / 8,Str / AStr,typedef CHAR *PSTR
PTBYTE,Ptr,4 / 8,UCharP(A)|UShortP(U),typedef TBYTE *PTBYTE|typedef TBYTE *PTBYTE
PTCHAR,Ptr,4 / 8,CharP(A)|ShortP(U),typedef TCHAR *PTCHAR|typedef TCHAR *PTCHAR
PTSTR,Ptr,4 / 8,Str / AStr / WStr,typedef LPSTR PTSTR / LPWSTR PTSTR
PUCHAR,Ptr,4 / 8,UCharP,typedef UCHAR *PUCHAR
PUHALF_PTR,UShort(32)|UInt(64),4 / 8,UShortP|UIntP,typedef UHALF_PTR *PUHALF_PTR|typedef UHALF_PTR *PUHALF_PTR
PUINT,Ptr,4 / 8,UIntP,typedef UINT *PUINT
PUINT_PTR,UPtr,4 / 8,UPtrP,typedef UINT_PTR *PUINT_PTR
PUINT8,Ptr,4 / 8,UCharP,typedef UINT8 *PUINT8
PUINT16,Ptr,4 / 8,UShortP,typedef UINT16 *PUINT16
PUINT32,Ptr,4 / 8,UIntP,typedef UINT32 *PUINT32
PUINT64,Ptr,4 / 8,Int64P,typedef UINT64 *PUINT64
PULONG,Ptr,4 / 8,UIntP,typedef ULONG *PULONG
PULONGLONG,Ptr,4 / 8,Int64P,typedef ULONGLONG *PULONGLONG
PULONG_PTR,UPtr,4 / 8,UPtrP,typedef ULONG_PTR *PULONG_PTR
PULONG32,Ptr,4 / 8,UIntP,typedef ULONG32 *PULONG32
PULONG64,Ptr,4 / 8,Int64P,typedef ULONG64 *PULONG64
PUSHORT,Ptr,4 / 8,UShortP,typedef USHORT *PUSHORT
PVOID,Ptr,4 / 8,PtrP,typedef void *PVOID
PWCHAR,Ptr,4 / 8,UShortP,typedef WCHAR *PWCHAR
PWORD,Ptr,4 / 8,UShortP,typedef WORD *PWORD
PWSTR,Ptr,4 / 8,Str / WStr,typedef WCHAR *PWSTR
QWORD,Int64,8 / 16,,typedef unsigned __int64 QWORD;
SC_HANDLE,Ptr,4 / 8,,typedef HANDLE SC_HANDLE
SC_LOCK,Ptr,4 / 8,PtrP,typedef LPVOID SC_LOCK
SERVICE_STATUS_HANDLE,Ptr,4 / 8,,typedef HANDLE SERVICE_STATUS_HANDLE
SHORT,Short,2 / 2,,typedef short SHORT
SIZE_T,UPtr,4 / 8,,typedef ULONG_PTR SIZE_T
SSIZE_T,Ptr,4 / 8,,typedef LONG_PTR SSIZE_T
TBYTE,UChar(A)|UShort(U),1 / 1,,typedef unsigned char TBYTE|typedef WCHAR TBYTE
TCHAR,Char(A)|UShort(U),1 / 1,,typedef char TCHAR|typedef WCHAR TCHAR
UCHAR,UChar,1 / 1,,typedef unsigned char UCHAR
UHALF_PTR,UShort(32)|UInt(64),2 / 4,,typedef unsigned short UHALF_PTR|typedef unsigned int UHALF_PTR
UINT,UInt,4 / 4,,typedef unsigned int UINT
UINT_PTR,UPtr,4 / 8,,typedef unsigned int UINT_PTR / unsigned __int64 UINT_PTR
UINT8,UChar,1 / 1,,typedef unsigned char UINT8
UINT16,UShort,2 / 2,,typedef unsigned short UINT16
UINT32,UInt,4 / 4,,typedef unsigned int UINT32
UINT64,Int64,8 / 8,,typedef usigned __int 64 UINT64
ULONG,UInt,4 / 4,,typedef unsigned long ULONG
ULONGLONG,Int64,8 / 8,,typedef unsigned __int64 ULONGLONG
ULONG_PTR,UPtr,4 / 8,,typedef unsigned long ULONG_PTR / unsigned __int64 ULONG_PTR
ULONG32,UInt,4 / 4,,typedef unsigned int ULONG32
ULONG64,Int64,8 / 8,,typedef unsigned __int64 ULONG64
USHORT,UShort,2 / 2,,typedef unsigned short USHORT
USN,Int64,8 / 8,,typedef LONGLONG USN
VOID,Ptr,4 / 8,,#define VOID void
WCHAR,UShort,2 / 2,,typedef wchar_t WCHAR
WORD,UShort,2 / 2,,typedef unsigned short WORD
WPARAM,UPtr,4 / 8,,typedef UINT_PTR WPARAM
)

; GUI =======================================================

Gui +Resize -MaximizeBox
Gui, Font,, Microsoft YaHei UI
Gui, Add, ListView, x5 y5 w900 h400 vLVData, % "数据类型|AHK类型|大小 32b/64b|DllCall() 的替代方案|MSDN定义"
LV_ModifyCol(1, 136), LV_ModifyCol(2, 130), LV_ModifyCol(3, 90), LV_ModifyCol(4, 140), LV_ModifyCol(5, 386)
Gui, Add, Edit, x5 y+1 w445 h23 hWndEditSearch gLVSearch vEditSearch
DllCall("user32.dll\SendMessage", "Ptr", EditSearch, "UInt", 0x1501, "Ptr", 1, "Str", "搜索数据类型", "Ptr")
Gui, Add, Edit, x+5 yp w54 h23 0x800 vEditEntries
Gui, Show, AutoSize, % "AHK的Windows数据类型"
Gui, +LastFound
WinSet, Redraw
Loop 4
    LV_ModifyCol(A_Index, "Center")  ; 居中

ListView:
    MSDN_TYPES_ARR := []
    loop, parse, MSDN_TYPES, `n, `r
    {
        MSDN_TYPES_ARR := StrSplit(A_LoopField, ",")
        LV_Add("", MSDN_TYPES_ARR[1], MSDN_TYPES_ARR[2], MSDN_TYPES_ARR[3], MSDN_TYPES_ARR[4], MSDN_TYPES_ARR[5]), LV_ModifyCol(1, "Sort")
    }
    GuiControl,, EditEntries, % LV_GetCount()
    GuiControl, Focus, EditSearch
return

; SCRIPT =======================================================

GuiSize:
    if(ErrorLevel)
        return
    GuiControl, Move, LVData, % "x5 y5 w"(A_GuiWidth - 10) " h"(A_GuiHeight - 40)
    GuiControl, Move, EditSearch, % "x5 y"(A_GuiHeight - 29) " w"(A_GuiWidth - 69)
    GuiControl, Move, EditEntries, % "x"(A_GuiWidth - 59) " y"(A_GuiHeight - 29)
return

LVSearch:
    Gui, Submit, NoHide
    LV_Delete(), MSDN_TYPES_ARR := []
    loop, parse, MSDN_TYPES, `n, `r
    {
        MSDN_TYPES_ARR := StrSplit(A_LoopField, ",")
        if(InStr(MSDN_TYPES_ARR[1], EditSearch))
            LV_Add("", MSDN_TYPES_ARR[1], MSDN_TYPES_ARR[2], MSDN_TYPES_ARR[3], MSDN_TYPES_ARR[4], MSDN_TYPES_ARR[5]), LV_ModifyCol(1, "Sort")
    }
    GuiControl,, EditEntries, % LV_GetCount()
return

; EXIT =========================================================

GuiClose:
GuiEscape:
    ExitApp

 

声明:站内资源为整理优化好的代码上传分享与学习研究,如果是开源代码基本都会标明出处,方便大家扩展学习路径。请不要恶意搬运,破坏站长辛苦整理维护的劳动成果。本站为爱好者分享站点,所有内容不作为商业行为。如若本站上传内容侵犯了原著者的合法权益,请联系我们进行删除下架。