Skip to content

Instantly share code, notes, and snippets.

@smourier
Created September 27, 2024 06:44
Show Gist options
  • Save smourier/0cde3e8cab3ac1bbdac2f26a066ab4ea to your computer and use it in GitHub Desktop.
Save smourier/0cde3e8cab3ac1bbdac2f26a066ab4ea to your computer and use it in GitHub Desktop.
GetProcAddress
extern "C" __declspec(dllimport) BOOL getCursorPos(LPPOINT);
extern "C" FARPROC __imp_getCursorPos = GetProcAddress(LoadLibrary(L"user32.dll"), "GetCursorPos");
int main()
{
POINT p{};
getCursorPos(&p);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment