This is how I tried to load user32.dll before getting an API handle from it:
    if (!(hModule = LoadLibrary(" USER32.DLL"))) {  // tried "USER32", same result
        puts("user32.dll not loaded.");
    if ((errCode = GetLastError())) {
        printf(Error Code: %d\n", errCode);
        return (1);
It seems user32.dll is loaded all right since the "not loaded" message never came out,
but the Error Code is always 126 which means "The specified module could not be found."

Please correct me if I did it wrong.
I desperately need to figure out how to get an API handle from a DLL since I always get
undefined reference to xxx when I know that function is in a DLL (eg. SendInput in USER32.DLL).

I am running mingw on a windowsXP SP2 machine, so windows.h should've included winuser.h, but
SendInput somehow is still UNDEFINED !!!
This is a UTF-8 formatted mail
James C.-C.Yu