Posts

Showing posts with the label windows version

Get correct OS version on win 8.1 without using GetVesionEx API (deprecated )

NTSTATUS (WINAPI *RtlGetVersion)(LPOSVERSIONINFOEXW); OSVERSIONINFOEXW osInfo; *(FARPROC*)&RtlGetVersion = GetProcAddress(GetModuleHandleA( "ntdll" ), "RtlGetVersion" ); if (NULL != RtlGetVersion) {    osInfo.dwOSVersionInfoSize = sizeof (osInfo);    RtlGetVersion(&osInfo); } Use above method on all  platform and it will work fine. Where GetOSVersionEx API deprecated by MS and gives wrong result on WIN 8.1.   Tested above sample on XP to 8,1 and works for me. There is another  alternative of manifest to use GetOSversionEx. Source: CodeProject  

Using Java Script detect if OS is 64 bit version or 32 bit.

Use following html code to show OS version: <html> <script> function onload() { if (navigator.userAgent.indexOf("WOW64") != -1 || navigator.userAgent.indexOf("Win64") != -1 ) {    alert("64 bit"); } else {    alert("32 bit"); } } </script> <body> <body onload="onload()" scrolling="no"> </body> </html> Ref:  UserAgent  (http://msdn.microsoft.com/en-us/library/ms537503%28v=vs.85%29.aspx)