[英]C++ what type should I use if I know the exact type from a few possible?
[英]c++ what type should I use in this dll script?
這是我的dll正常工作的一部分,但我想對其進行改進:
extern "C" __declspec(dllexport) void RightClick()
{
hWindow = FindWindow(NULL, "My Window title");
[...]
}
我想要的是這樣的:
extern "C" __declspec(dllexport) void RightClick(**TYPE** variable)
{
hWindow = FindWindow(NULL, **TYPE** variable);
[...]
}
其中變量是字符串,例如“記事本-無標題”,我可以在自動熱鍵腳本中調用它,例如:
f3::
DllCall("Project4.dll\RightClick", **TYPE**, "Notepad - Untitled")
return
根據FindWindow的文檔,您應該使用LPCTSTR
。 這是一個const TCHAR
字符串。 如果您為Unicode字符集或char
dll,則TCHAR
是wchar_t
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.