BOOL GetOSVerIs64Bit() { BOOL bRet=FALSE; SYSTEM_INFO si; typedef VOID(__stdcall*GETNATIVESYSTEMINFO)(LPSYSTEM_INFO lpSystemInfo); GETNATIVESYSTEMINFO fnGetNativeSystemInfo; fnGetNativeSystemInfo=(GETNATIVESYSTEMINFO)GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")),"GetNativeSystemInfo"); if (fnGetNativeSystemInfo!=NULL) { fnGetNativeSystemInfo(&si); if (si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64 || si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_IA64 ) { bRet=TRUE; } } return bRet; }
此方法在程序编译时是用32位,则在64位下返回TRUE。如果编译时就是用64位,此函数在64位下返回为FALSE。
试着给远控加了下,效果不错