Widziałem już i próbowałem w.g. instrukcji na stronie:
{
HWND Uchwyt = GetForegroundWindow();
int Dl = GetWindowTextLength(Uchwyt)+1;
wchar_t* Tytul;
GetWindowText(Uchwyt, Tytul, Dl);
String ^systemstring = gcnew String(Tytul);
label1->Text = systemstring;
delete systemstring;
}
Dostaję błędy:
1> Processing resource file "Form1.resX" into "Debug\testcli.Form1.resources".
1>test cli.obj : error LNK2028: unresolved token (0A000012) "extern "C" int __stdcall GetWindowTextW(struct HWND__ *,wchar_t *,int)" (?GetWindowTextW@@$$J212YGHPAUHWND__@@PA_WH@Z) referenced in function "private: void __clrcall testcli::Form1::button1_Click(class System::Object ^,class System::EventArgs ^)" (?button1_Click@Form1@testcli@@$$FA$AAMXP$AAVObject@System@@P$AAVEventArgs@4@@Z)
1>test cli.obj : error LNK2028: unresolved token (0A000013) "extern "C" int __stdcall GetWindowTextLengthW(struct HWND__ *)" (?GetWindowTextLengthW@@$$J14YGHPAUHWND__@@@Z) referenced in function "private: void __clrcall testcli::Form1::button1_Click(class System::Object ^,class System::EventArgs ^)" (?button1_Click@Form1@testcli@@$$FA$AAMXP$AAVObject@System@@P$AAVEventArgs@4@@Z)
1>test cli.obj : error LNK2028: unresolved token (0A000014) "extern "C" struct HWND__ * __stdcall GetForegroundWindow(void)" (?GetForegroundWindow@@$$J10YGPAUHWND__@@XZ) referenced in function "private: void __clrcall testcli::Form1::button1_Click(class System::Object ^,class System::EventArgs ^)" (?button1_Click@Form1@testcli@@$$FA$AAMXP$AAVObject@System@@P$AAVEventArgs@4@@Z)
1>test cli.obj : error LNK2019: unresolved external symbol "extern "C" int __stdcall GetWindowTextW(struct HWND__ *,wchar_t *,int)" (?GetWindowTextW@@$$J212YGHPAUHWND__@@PA_WH@Z) referenced in function "private: void __clrcall testcli::Form1::button1_Click(class System::Object ^,class System::EventArgs ^)" (?button1_Click@Form1@testcli@@$$FA$AAMXP$AAVObject@System@@P$AAVEventArgs@4@@Z)
1>test cli.obj : error LNK2019: unresolved external symbol "extern "C" int __stdcall GetWindowTextLengthW(struct HWND__ *)" (?GetWindowTextLengthW@@$$J14YGHPAUHWND__@@@Z) referenced in function "private: void __clrcall testcli::Form1::button1_Click(class System::Object ^,class System::EventArgs ^)" (?button1_Click@Form1@testcli@@$$FA$AAMXP$AAVObject@System@@P$AAVEventArgs@4@@Z)
1>test cli.obj : error LNK2019: unresolved external symbol "extern "C" struct HWND__ * __stdcall GetForegroundWindow(void)" (?GetForegroundWindow@@$$J10YGPAUHWND__@@XZ) referenced in function "private: void __clrcall testcli::Form1::button1_Click(class System::Object ^,class System::EventArgs ^)" (?button1_Click@Form1@testcli@@$$FA$AAMXP$AAVObject@System@@P$AAVEventArgs@4@@Z)
1>C:\Documents and Settings\ogryz\Pulpit\VSC\test cli\test cli\Debug\test cli.exe : fatal error LNK1120: 6 unresolved externals
Pozdrawiam.