LoadLibrary和GetProcAddress获得API的地址

#include <windows.h>
#include <stdio.h>
typedef void (*MYPROC)(LPTSTR);
int main()
{    
        HINSTANCE LibHandle;
        MYPROC ProcAdd;
          LibHandle = LoadLibrary("user32");
        printf("user32 LibHandle = //x%x\n", LibHandle);
        ProcAdd=(MYPROC)GetProcAddress(LibHandle,"MessageBoxA");    
        printf("MessageBoxA = //x%x\n", ProcAdd);

    
        return 0;
}

用于尝试查找API

你可能感兴趣的:(library)