看一下 WinNT.h 中的定义:
typedef wchar_t WCHAR;
typedef __nullterminated CONST WCHAR *LPCWSTR, *PCWSTR;
再看一下 Python ctypes 中的类型对应关系:
ctypes type C type Python type
c_wchar_p wchar_t * (NUL terminated) unicode or None
所以 LPCWSTR 对应 ctypes 中的 c_wchar_p.
例如:
target_file = ctypes.c_wchar_p(u'C:\\Program Files\\Tencent\\QQ\\Bin\\QQ.exe')