OSDN Git Service

Jumplistへの対応(の下準備)
authoreru <eru01@users.sourceforge.jp>
Fri, 22 Oct 2010 15:45:34 +0000 (15:45 +0000)
committereru <eru01@users.sourceforge.jp>
Fri, 22 Oct 2010 15:45:34 +0000 (15:45 +0000)
PeerCast.root/PeerCast/ui/win32/simple/Simple.cpp
PeerCast.root/PeerCast/ui/win32/simple/gui.cpp
c:/Git/PeerCast.root/PeerCast/ui/win32/simple/Simple.cpp
c:/Git/PeerCast.root/PeerCast/ui/win32/simple/gui.cpp

index 81c7324..b692056 100644 (file)
@@ -82,6 +82,8 @@ ThreadInfo trafficDlgThread;
 HWND trafficDlg = NULL;
 FileStream fs;
 
+bool jumpListEnabled = false; // jumplist flag (only for win7 or later)
+
 // \83v\83\8d\83g\83^\83C\83v\90é\8c¾
 void createGUI(HWND);
 LRESULT CALLBACK TrafficDlgProc(HWND, UINT, WPARAM, LPARAM);
@@ -283,14 +285,27 @@ int WinMainDummy(HINSTANCE hInstance,
        WIN32_FIND_DATA fd; //JP-EX
        HANDLE hFind; //JP-EX
 
-       OSVERSIONINFO osInfo; //JP-EX
-       osInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); //JP-EX
-       GetVersionEx(&osInfo);
+       OSVERSIONINFOEX osInfo; //JP-EX
+       osInfo.dwOSVersionInfoSize = sizeof(osInfo); //JP-EX
+       GetVersionEx(reinterpret_cast<LPOSVERSIONINFO>(&osInfo));
        if (osInfo.dwPlatformId == VER_PLATFORM_WIN32_NT)
                winDistinctionNT = true;
        else
                winDistinctionNT = false;
 
+       // for Windows7 or later
+       if ((osInfo.wProductType == VER_NT_WORKSTATION
+               && osInfo.dwMajorVersion == 6
+               && osInfo.dwMinorVersion == 1)
+               ||
+               (osInfo.dwMajorVersion == 6
+               && osInfo.dwMinorVersion > 1)
+               ||
+               osInfo.dwMajorVersion > 6)
+       {
+               jumpListEnabled = true;
+       }
+
        // off by default now
        showGUI = false;
 
index 61e232d..eac84a7 100644 (file)
@@ -56,6 +56,8 @@ bool shownChannels=false;
 WINDOWPLACEMENT winPlace;
 bool guiFlg = false;
 
+extern bool jumpListEnabled;
+
 using namespace Gdiplus;
 
 #include <comdef.h>
@@ -1534,6 +1536,11 @@ void WmCreateProc(HWND hwnd){
        img_broad_ok = ::new Image(bstr);
        bstr = L"ST_BROAD_FULL.bmp";
        img_broad_full = ::new Image(bstr);
+
+       // jumplist
+       if (jumpListEnabled)
+       {
+       }
 }
 
 void WmPaintProc(HWND hwnd){
index 81c7324..b692056 100644 (file)
@@ -82,6 +82,8 @@ ThreadInfo trafficDlgThread;
 HWND trafficDlg = NULL;
 FileStream fs;
 
+bool jumpListEnabled = false; // jumplist flag (only for win7 or later)
+
 // \83v\83\8d\83g\83^\83C\83v\90é\8c¾
 void createGUI(HWND);
 LRESULT CALLBACK TrafficDlgProc(HWND, UINT, WPARAM, LPARAM);
@@ -283,14 +285,27 @@ int WinMainDummy(HINSTANCE hInstance,
        WIN32_FIND_DATA fd; //JP-EX
        HANDLE hFind; //JP-EX
 
-       OSVERSIONINFO osInfo; //JP-EX
-       osInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); //JP-EX
-       GetVersionEx(&osInfo);
+       OSVERSIONINFOEX osInfo; //JP-EX
+       osInfo.dwOSVersionInfoSize = sizeof(osInfo); //JP-EX
+       GetVersionEx(reinterpret_cast<LPOSVERSIONINFO>(&osInfo));
        if (osInfo.dwPlatformId == VER_PLATFORM_WIN32_NT)
                winDistinctionNT = true;
        else
                winDistinctionNT = false;
 
+       // for Windows7 or later
+       if ((osInfo.wProductType == VER_NT_WORKSTATION
+               && osInfo.dwMajorVersion == 6
+               && osInfo.dwMinorVersion == 1)
+               ||
+               (osInfo.dwMajorVersion == 6
+               && osInfo.dwMinorVersion > 1)
+               ||
+               osInfo.dwMajorVersion > 6)
+       {
+               jumpListEnabled = true;
+       }
+
        // off by default now
        showGUI = false;
 
index 61e232d..eac84a7 100644 (file)
@@ -56,6 +56,8 @@ bool shownChannels=false;
 WINDOWPLACEMENT winPlace;
 bool guiFlg = false;
 
+extern bool jumpListEnabled;
+
 using namespace Gdiplus;
 
 #include <comdef.h>
@@ -1534,6 +1536,11 @@ void WmCreateProc(HWND hwnd){
        img_broad_ok = ::new Image(bstr);
        bstr = L"ST_BROAD_FULL.bmp";
        img_broad_full = ::new Image(bstr);
+
+       // jumplist
+       if (jumpListEnabled)
+       {
+       }
 }
 
 void WmPaintProc(HWND hwnd){