If you call functions directly, your program does not load on Win98.
What you can do is use LoadLibrary() / GetProcAddress() to get a pointer to GetFileTime() / SetFileTime() . On Win98, this will not work, giving you a null pointer that you can check and ignore. In 2000 and later you will receive a pointer that you can use.
This is pain, but this is the only solution that I know of.
Here is an example of getting the UpdateLayeredWindow function, if one exists:
typedef BOOL (WINAPI* UpdateLayeredWinFunc) (HWND, HDC, POINT*, SIZE*, HDC, POINT*, COLORREF, BLENDFUNCTION*, DWORD); UpdateLayeredWinFunc updateLayeredWindow = 0; HMODULE user32Mod = GetModuleHandle (_T("user32.dll")); updateLayeredWindow = (UpdateLayeredWinFunc) GetProcAddress (user32Mod, "UpdateLayeredWindow");
Roland Rabien
source share