Search Results

Search found 6 results on 1 pages for 'getversionex'.

Page 1/1 | 1 

  • GetVersionEx Not Working on Windows 7?!

    - by Andreas Rejbrand
    On my Windows 7 system, the GetVersionEx Windows API function returns "6.0", indicating Windows Vista, when it should return "6.1". If it matters, I used the following Delphi code: function winver: string; var ver: TOSVersionInfo; begin ver.dwOSVersionInfoSize := SizeOf(ver); if GetVersionEx(ver) then with ver do result := IntToStr(dwMajorVersion) + '.' + IntToStr(dwMinorVersion) + '.' + IntToStr(dwBuildNumber) + ' (' + szCSDVersion + ')'; end; and the string "6.0.6002 (Service Pack 2)" was returned. Isn't this highly odd?

    Read the article

  • Construct a LPCWSTR on WinCE in C++ (Zune/ZDK)

    - by James Cadd
    What's a good way to construct an LPCWSTR on WinCE 6? I'd like to find something similar to String.Format() in C#. My attempt is: OSVERSIONINFO vi; memset (&vi, 0, sizeof vi); vi.dwOSVersionInfoSize = sizeof vi; GetVersionEx (&vi); char buffer[50]; int n = sprintf(buffer, "The OS version is: %d.%d", vi.dwMajorVersion, vi.dwMinorVersion); ZDKSystem_ShowMessageBox(buffer, MESSAGEBOX_TYPE_OK); That ZDKSystem_ShowMessageBox refers to the ZDK for hacked Zunes available at: http://zunedevwiki.org This line of code works well with the message box call: ZDKSystem_ShowMessageBox(L"Hello Zune", MESSAGEBOX_TYPE_OK); My basic goal is to look at the exact version of WinCE running on a Zune HD to see which features are available (i.e. is it R2 or earlier?). Also I haven't seen any tags for the ZDK so please edit if something is more fitting!

    Read the article

  • Should I use a global var or call the function every time? C++

    - by extintor
    Im using: bool GetOS(LPTSTR pszOS) { OSVERSIONINFOEX osve; BOOL bOsVersionInfoEx; ZeroMemory(&osve, sizeof(OSVERSIONINFOEX)); osve.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); if( !(bOsVersionInfoEx = GetVersionEx ((OSVERSIONINFO *) &osve)) ) return false; TCHAR buf[80]; StringCchPrintf( buf, 80, TEXT("%u.%u.%u.%u"), osve.dwPlatformId, osve.dwMajorVersion, osve.dwMinorVersion, osve.dwBuildNumber); StringCchCat(pszOS, BUFSIZE, buf); return true; } to get the windows version, and I am planning to use pszOS every a few minutes, Should I use pszOS as a global var or call GetOS() every time? What's the best option from a performance point of view.

    Read the article

  • Problems with Aero Glass in Delphi 7 applications

    - by Cralias
    Hi everyone! I'm trying to remake some of my older projects to support Aero Glass. Although it's kinda easy to enable glass frame, I've encountered some major problems. I used this code: var xVer: TOSVersionInfo; hDWM: THandle; DwmIsCompositionEnabled: function(pbEnabled: BOOL): HRESULT; stdcall; DwmExtendFrameIntoClientArea: function(hWnd: HWND; const pxMarInset: PRect): HRESULT; stdcall; bEnabled: BOOL; xFrame: TRect; // ... xVer.dwOSVersionInfoSize := SizeOf(TOSVersionInfo); GetVersionEx(xVer); if xVer.dwMajorVersion >= 6 then begin hDWM := LoadLibrary('dwmapi.dll'); @DwmIsCompositionEnabled := GetProcAddress(hDWM, 'DwmIsCompositionEnabled'); @DwmExtendFrameIntoClientArea := GetProcAddress(hDWM, 'DwmExtendFrameIntoClientArea'); if (@DwmIsCompositionEnabled <> nil) and (@DwmExtendFrameIntoClientArea <> nil) then begin DwmIsCompositionEnabled(@bEnabled); if bEnabled then begin xRect := Rect(-1, -1, -1, -1); DwmExtendFrameIntoClientArea(FrmMain.Handle, @xRect); end; end; FreeLibrary(hDWM); end; So I got the pretty glass window now. Due to black being transparent color now (kinda stupid choice, why couldn't it be pink) anything that is clBlack becomes transparent, too. It means all labels, edits, button texts... even if I set text to some other color at design time, DWM still makes them that color AND transparent. Well, my question would be - whether it's possible to solve this somehow?

    Read the article

  • Weird characters at the beginning of a LPTSTR? C++

    - by extintor
    I am using this code to get the windows version: define BUFSIZE 256 bool config::GetOS(LPTSTR OSv) { OSVERSIONINFOEX osve; BOOL bOsVersionInfoEx; ZeroMemory(&osve, sizeof(OSVERSIONINFOEX)); osve.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); if( !(bOsVersionInfoEx = GetVersionEx ((OSVERSIONINFO *) &osve)) ) return false; TCHAR buf[BUFSIZE]; StringCchPrintf(buf, BUFSIZE, TEXT("%u.%u.%u.%u"), osve.dwPlatformId, osve.dwMajorVersion, osve.dwMinorVersion, osve.dwBuildNumber); StringCchCat(OSv, BUFSIZE, buf); return true; } And I am testing it with: LPTSTR OSv= new TCHAR[BUFSIZE]; config c; c.GetOS(OSv); MessageBox(OSv, 0, 0); And in the msgbox I get something like this äì5.1.20 (where 5.1.20 is = to OSv) but the first 2 or 3 chars are some weird characters that I don't know when they came from. Even stranger, if I call that second piece again it shows it ok, it only show the weird characters the first time I execute it. Does someone has an idea what's going on here?

    Read the article

  • Is there any time estimation about sqlite3's open speed?

    - by sxingfeng
    I am using SQLite3 in C++, I found the opening time of sqlite seems unstable at the first time( I mean ,open windows and open the db at the first time) It takes a long tiom on 50M db, about 10s in windows? and vary on different times. Has any one met the same problem? I am writting an desktop application in windows, so the openning speed is really important for me. Thanks in advance! int nRet; #if defined(_UNICODE) || defined(UNICODE) nRet = sqlite3_open16(szFile, &mpDB); // not tested under window 98 #else // For Ansi Version //*************- Added by Begemot szFile must be in unicode- 23/03/06 11:04 - **** OSVERSIONINFOEX osvi; ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX)); osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); GetVersionEx ((OSVERSIONINFO *) &osvi); if ( osvi.dwMajorVersion == 5) { WCHAR pMultiByteStr[MAX_PATH+1]; MultiByteToWideChar( CP_ACP, 0, szFile, _tcslen(szFile)+1, pMultiByteStr, sizeof(pMultiByteStr)/sizeof(pMultiByteStr[0]) ); nRet = sqlite3_open16(pMultiByteStr, &mpDB); } else nRet = sqlite3_open(szFile,&mpDB); #endif //************************* if (nRet != SQLITE_OK) { LPCTSTR szError = (LPCTSTR) _sqlite3_errmsg(mpDB); throw CppSQLite3Exception(nRet, (LPTSTR)szError, DONT_DELETE_MSG); } setBusyTimeout(mnBusyTimeoutMs);

    Read the article

1