2016-11-26 5 views
0

Hier ist der Teil meiner dll ist, der gut arbeitet, aber ich will, es verbessern:C++ welchen Typ sollte ich in diesem DLL-Skript verwenden?

extern "C" __declspec(dllexport) void RightClick() 
    { 
     hWindow = FindWindow(NULL, "My Window title"); 
     [...] 
    } 

Was ich so etwas haben möchten ist:

extern "C" __declspec(dllexport) void RightClick(**TYPE** variable) 
    { 
     hWindow = FindWindow(NULL, **TYPE** variable); 
     [...] 
    } 

Wo Variable string, zum Beispiel „Notepad - Untitled“, die ich in meiner autohotkey Skript, examplery anrufen:

f3::  
DllCall("Project4.dll\RightClick", **TYPE**, "Notepad - Untitled") 
return 
+0

'const char *'. –

Antwort

2

Gemäß der Dokumentation von FindWindow sollten Sie LPCTSTR. Es ist ein const TCHAR String. TCHAR ist ein wchar_t, wenn Sie Ihre DLL für Unicode-Zeichensatz oder char sonst erstellen.

Verwandte Themen