@Jomm

Как вызвать функцию FindWindowA в Windows Forms?

Я написал не большую консольную программу, в ней были эти строки:
hwnd = FindWindowA(NULL, "Notepad");
GetWindowThreadProcessId(hwnd, &procid);

И я решил перенисти приложение с консоли на Windows Forms, но мне выдает ошибки:
unresolved external symbol "extern "C" struct HWND__ * __stdcall FindWindowA(char const *,char const *)" (?FindWindowA@@$$J18YGPAUHWND__@@PBD0@Z)
unresolved external symbol "extern "C" unsigned long __stdcall GetWindowThreadProcessId(struct HWND__ *,unsigned long *)" (?GetWindowThreadProcessId@@$$J18YGKPAUHWND__@@PAK@Z)
  • Вопрос задан
  • 182 просмотра
Решения вопроса 1
@Jomm Автор вопроса
1. Right click on project -- > Properties --> Configuration Properties --> Linker --> Input
2. Select the 'Additional Dependencies" property node and then Click the on the 3 dotted (...) button
3. Then on the 'Additional Dependencies" popup, input "user32.lib" on the top textbox and click on 'Ok' button
4. Click on 'Apply' button and re-compile your application. .............. the linker errors are gone!
Ответ написан
Комментировать
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы