Warnings are your friends...
Observe all warnings coming out from compilation, better one module at time, and eventually enable LEVEL2 warnings.
They give you a lot of information. I.e. the warning:
warning #2145: Using incompatible types 'int __stdcall (*)(HWND, unsigned int, unsigned long long int, long long int)' and 'long long int __stdcall (*)(HWND, unsigned int, unsigned long long int, long long int)'
Is telling you that you tried to assign to a pointer to a function that takes an HWND, an unsigned int, an unsigned long long, a long long, and returns a long long int a pointer to a function that takes the same arguments, but returns an int.
If the value returned is a pointer to memory, i.e. the original type was 'UINT_PTR' or 'DWORD_PTR' or the like (that reduces to a basic long long int on a 64 bits system and to a long int on a 32bits system), the conversion from long long to int, that will happen on a 64bits system, truncate the upper significant 32bits supplying an invalid pointer value. On a 32bits it could work, while not syntactically correct, because int and pointer have same width, 32bits, so no value modification will apply.
I.e. if the long long value was 0x0000123456781234, converted to int becomes 0x56781234 that eventually points to an invalid memory region, or worst to a valid region, corrupting data contained.
The last case is even more poisonus because your program will fail elsewhere from the point were is located the error making absolutely crazy any debug.