OLD | NEW |
1 #include "PluginStdAfx.h" | 1 #include "PluginStdAfx.h" |
2 | 2 |
3 #include "PluginClass.h" | 3 #include "PluginClass.h" |
4 #include "PluginSettings.h" | 4 #include "PluginSettings.h" |
5 #include "PluginSystem.h" | 5 #include "PluginSystem.h" |
6 #ifdef SUPPORT_FILTER | 6 #ifdef SUPPORT_FILTER |
7 #include "PluginFilter.h" | 7 #include "PluginFilter.h" |
8 #endif | 8 #endif |
9 #include "PluginMimeFilterClient.h" | 9 #include "PluginMimeFilterClient.h" |
10 #include "PluginClient.h" | 10 #include "PluginClient.h" |
(...skipping 761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
772 if (!settings->GetPluginEnabled()) | 772 if (!settings->GetPluginEnabled()) |
773 { | 773 { |
774 s_mimeFilter->Unregister(); | 774 s_mimeFilter->Unregister(); |
775 } | 775 } |
776 | 776 |
777 // Load theme module | 777 // Load theme module |
778 s_criticalSectionLocal.Lock(); | 778 s_criticalSectionLocal.Lock(); |
779 { | 779 { |
780 if (!s_hUxtheme) | 780 if (!s_hUxtheme) |
781 { | 781 { |
782 s_hUxtheme = ::GetModuleHandle(_T("uxtheme.dll")); | 782 s_hUxtheme = ::GetModuleHandle(L"uxtheme.dll"); |
783 if (s_hUxtheme) | 783 if (s_hUxtheme) |
784 { | 784 { |
785 pfnClose = (CLOSETHEMEDATA)::GetProcAddress(s_hUxtheme, "CloseThemeData"
); | 785 pfnClose = (CLOSETHEMEDATA)::GetProcAddress(s_hUxtheme, "CloseThemeData"
); |
786 if (!pfnClose) | 786 if (!pfnClose) |
787 { | 787 { |
788 DEBUG_ERROR_LOG(::GetLastError(), PLUGIN_ERROR_UI, PLUGIN_ERROR_UI_GET
_UXTHEME_CLOSE, "Class::InitObject - GetProcAddress(CloseThemeData)"); | 788 DEBUG_ERROR_LOG(::GetLastError(), PLUGIN_ERROR_UI, PLUGIN_ERROR_UI_GET
_UXTHEME_CLOSE, "Class::InitObject - GetProcAddress(CloseThemeData)"); |
789 } | 789 } |
790 | 790 |
791 pfnDrawThemeBackground = (DRAWTHEMEBACKGROUND)::GetProcAddress(s_hUxthem
e, "DrawThemeBackground"); | 791 pfnDrawThemeBackground = (DRAWTHEMEBACKGROUND)::GetProcAddress(s_hUxthem
e, "DrawThemeBackground"); |
792 if (!pfnDrawThemeBackground) | 792 if (!pfnDrawThemeBackground) |
(...skipping 23 matching lines...) Expand all Loading... |
816 wcex.cbSize = sizeof(WNDCLASSEX); | 816 wcex.cbSize = sizeof(WNDCLASSEX); |
817 wcex.style = 0; | 817 wcex.style = 0; |
818 wcex.lpfnWndProc = (WNDPROC)PaneWindowProc; | 818 wcex.lpfnWndProc = (WNDPROC)PaneWindowProc; |
819 wcex.cbClsExtra = 0; | 819 wcex.cbClsExtra = 0; |
820 wcex.cbWndExtra = 0; | 820 wcex.cbWndExtra = 0; |
821 wcex.hInstance = _Module.m_hInst; | 821 wcex.hInstance = _Module.m_hInst; |
822 wcex.hIcon = NULL; | 822 wcex.hIcon = NULL; |
823 wcex.hCursor = NULL; | 823 wcex.hCursor = NULL; |
824 wcex.hbrBackground = NULL; | 824 wcex.hbrBackground = NULL; |
825 wcex.lpszMenuName = NULL; | 825 wcex.lpszMenuName = NULL; |
826 wcex.lpszClassName = _T(STATUSBAR_PANE_NAME); | 826 wcex.lpszClassName = STATUSBAR_PANE_NAME; |
827 wcex.hIconSm = NULL; | 827 wcex.hIconSm = NULL; |
828 | 828 |
829 s_criticalSectionLocal.Lock(); | 829 s_criticalSectionLocal.Lock(); |
830 { | 830 { |
831 s_atomPaneClass = ::RegisterClassEx(&wcex); | 831 s_atomPaneClass = ::RegisterClassEx(&wcex); |
832 } | 832 } |
833 s_criticalSectionLocal.Unlock(); | 833 s_criticalSectionLocal.Unlock(); |
834 | 834 |
835 if (!GetAtomPaneClass()) | 835 if (!GetAtomPaneClass()) |
836 { | 836 { |
(...skipping 29 matching lines...) Expand all Loading... |
866 } | 866 } |
867 return true; | 867 return true; |
868 } | 868 } |
869 | 869 |
870 bool CPluginClass::CreateStatusBarPane() | 870 bool CPluginClass::CreateStatusBarPane() |
871 { | 871 { |
872 CriticalSection::Lock lock(m_csStatusBar); | 872 CriticalSection::Lock lock(m_csStatusBar); |
873 | 873 |
874 CPluginClient* client = CPluginClient::GetInstance(); | 874 CPluginClient* client = CPluginClient::GetInstance(); |
875 | 875 |
876 TCHAR szClassName[MAX_PATH]; | 876 wchar_t szClassName[MAX_PATH]; |
877 // Get browser window and url | 877 // Get browser window and url |
878 HWND hBrowserWnd = GetBrowserHWND(); | 878 HWND hBrowserWnd = GetBrowserHWND(); |
879 if (!hBrowserWnd) | 879 if (!hBrowserWnd) |
880 { | 880 { |
881 DEBUG_ERROR_LOG(0, PLUGIN_ERROR_UI, PLUGIN_ERROR_UI_NO_STATUSBAR_BROWSER, "C
lass::CreateStatusBarPane - No status bar") | 881 DEBUG_ERROR_LOG(0, PLUGIN_ERROR_UI, PLUGIN_ERROR_UI_NO_STATUSBAR_BROWSER, "C
lass::CreateStatusBarPane - No status bar") |
882 return false; | 882 return false; |
883 } | 883 } |
884 | 884 |
885 // Looking for a TabWindowClass window in IE7 | 885 // Looking for a TabWindowClass window in IE7 |
886 // the last one should be parent for statusbar | 886 // the last one should be parent for statusbar |
887 HWND hWndStatusBar = NULL; | 887 HWND hWndStatusBar = NULL; |
888 | 888 |
889 HWND hTabWnd = ::GetWindow(hBrowserWnd, GW_CHILD); | 889 HWND hTabWnd = ::GetWindow(hBrowserWnd, GW_CHILD); |
890 UINT amoundOfNewTabs = 0; | 890 UINT amoundOfNewTabs = 0; |
891 HWND uniqueNewTab = NULL; | 891 HWND uniqueNewTab = NULL; |
892 while (hTabWnd) | 892 while (hTabWnd) |
893 { | 893 { |
894 memset(szClassName, 0, MAX_PATH); | 894 memset(szClassName, 0, MAX_PATH); |
895 GetClassName(hTabWnd, szClassName, MAX_PATH); | 895 GetClassName(hTabWnd, szClassName, MAX_PATH); |
896 | 896 |
897 if (_tcscmp(szClassName, _T("TabWindowClass")) == 0 || _tcscmp(szClassName,_
T("Frame Tab")) == 0) | 897 if (wcscmp(szClassName, L"TabWindowClass") == 0 || wcscmp(szClassName,L"Fram
e Tab") == 0) |
898 { | 898 { |
899 // IE8 support | 899 // IE8 support |
900 HWND hTabWnd2 = hTabWnd; | 900 HWND hTabWnd2 = hTabWnd; |
901 if (_tcscmp(szClassName,_T("Frame Tab")) == 0) | 901 if (wcscmp(szClassName,L"Frame Tab") == 0) |
902 { | 902 { |
903 hTabWnd2 = ::FindWindowEx(hTabWnd2, NULL, _T("TabWindowClass"), NULL); | 903 hTabWnd2 = ::FindWindowEx(hTabWnd2, NULL, L"TabWindowClass", NULL); |
904 } | 904 } |
905 | 905 |
906 if (hTabWnd2) | 906 if (hTabWnd2) |
907 { | 907 { |
908 DWORD nProcessId; | 908 DWORD nProcessId; |
909 ::GetWindowThreadProcessId(hTabWnd2, &nProcessId); | 909 ::GetWindowThreadProcessId(hTabWnd2, &nProcessId); |
910 if (::GetCurrentProcessId() == nProcessId) | 910 if (::GetCurrentProcessId() == nProcessId) |
911 { | 911 { |
912 bool bExistingTab = false; | 912 bool bExistingTab = false; |
913 | 913 |
(...skipping 27 matching lines...) Expand all Loading... |
941 | 941 |
942 hTabWnd = ::GetWindow(hTabWnd, GW_HWNDNEXT); | 942 hTabWnd = ::GetWindow(hTabWnd, GW_HWNDNEXT); |
943 } | 943 } |
944 | 944 |
945 HWND hWnd = ::GetWindow(hBrowserWnd, GW_CHILD); | 945 HWND hWnd = ::GetWindow(hBrowserWnd, GW_CHILD); |
946 while (hWnd) | 946 while (hWnd) |
947 { | 947 { |
948 memset(szClassName, 0, MAX_PATH); | 948 memset(szClassName, 0, MAX_PATH); |
949 ::GetClassName(hWnd, szClassName, MAX_PATH); | 949 ::GetClassName(hWnd, szClassName, MAX_PATH); |
950 | 950 |
951 if (_tcscmp(szClassName,_T("msctls_statusbar32")) == 0) | 951 if (wcscmp(szClassName,L"msctls_statusbar32") == 0) |
952 { | 952 { |
953 hWndStatusBar = hWnd; | 953 hWndStatusBar = hWnd; |
954 break; | 954 break; |
955 } | 955 } |
956 | 956 |
957 hWnd = ::GetWindow(hWnd, GW_HWNDNEXT); | 957 hWnd = ::GetWindow(hWnd, GW_HWNDNEXT); |
958 } | 958 } |
959 | 959 |
960 if (!hWndStatusBar) | 960 if (!hWndStatusBar) |
961 { | 961 { |
(...skipping 18 matching lines...) Expand all Loading... |
980 #ifdef _DEBUG | 980 #ifdef _DEBUG |
981 m_nPaneWidth = 70; | 981 m_nPaneWidth = 70; |
982 #else | 982 #else |
983 m_nPaneWidth = 22; | 983 m_nPaneWidth = 22; |
984 #endif | 984 #endif |
985 } | 985 } |
986 // Create pane window | 986 // Create pane window |
987 HWND hWndNewPane = ::CreateWindowEx( | 987 HWND hWndNewPane = ::CreateWindowEx( |
988 NULL, | 988 NULL, |
989 MAKEINTATOM(GetAtomPaneClass()), | 989 MAKEINTATOM(GetAtomPaneClass()), |
990 _T(""), | 990 L"", |
991 WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, | 991 WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, |
992 rcStatusBar.Width() - 500,0,m_nPaneWidth,rcStatusBar.Height(), | 992 rcStatusBar.Width() - 500,0,m_nPaneWidth,rcStatusBar.Height(), |
993 hWndStatusBar, | 993 hWndStatusBar, |
994 (HMENU)3671, | 994 (HMENU)3671, |
995 _Module.m_hInst, | 995 _Module.m_hInst, |
996 NULL); | 996 NULL); |
997 | 997 |
998 if (!hWndNewPane) | 998 if (!hWndNewPane) |
999 { | 999 { |
1000 DEBUG_ERROR_LOG(::GetLastError(), PLUGIN_ERROR_UI, PLUGIN_ERROR_UI_CREATE_ST
ATUSBAR_PANE, "Class::CreateStatusBarPane - CreateWindowEx") | 1000 DEBUG_ERROR_LOG(::GetLastError(), PLUGIN_ERROR_UI, PLUGIN_ERROR_UI_CREATE_ST
ATUSBAR_PANE, "Class::CreateStatusBarPane - CreateWindowEx") |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1257 } | 1257 } |
1258 | 1258 |
1259 void CPluginClass::DisplayPluginMenu(HMENU hMenu, int nToolbarCmdID, POINT pt, U
INT nMenuFlags) | 1259 void CPluginClass::DisplayPluginMenu(HMENU hMenu, int nToolbarCmdID, POINT pt, U
INT nMenuFlags) |
1260 { | 1260 { |
1261 CPluginClient* client = CPluginClient::GetInstance(); | 1261 CPluginClient* client = CPluginClient::GetInstance(); |
1262 | 1262 |
1263 // Create menu parent window | 1263 // Create menu parent window |
1264 HWND hMenuWnd = ::CreateWindowEx( | 1264 HWND hMenuWnd = ::CreateWindowEx( |
1265 NULL, | 1265 NULL, |
1266 MAKEINTATOM(GetAtomPaneClass()), | 1266 MAKEINTATOM(GetAtomPaneClass()), |
1267 _T(""), | 1267 L"", |
1268 0, | 1268 0, |
1269 0,0,0,0, | 1269 0,0,0,0, |
1270 NULL, | 1270 NULL, |
1271 NULL, | 1271 NULL, |
1272 _Module.m_hInst, | 1272 _Module.m_hInst, |
1273 NULL); | 1273 NULL); |
1274 | 1274 |
1275 if (!hMenuWnd) | 1275 if (!hMenuWnd) |
1276 { | 1276 { |
1277 DestroyMenu(hMenu); | 1277 DestroyMenu(hMenu); |
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1918 return icon; | 1918 return icon; |
1919 } | 1919 } |
1920 | 1920 |
1921 ATOM CPluginClass::GetAtomPaneClass() | 1921 ATOM CPluginClass::GetAtomPaneClass() |
1922 { | 1922 { |
1923 return s_atomPaneClass; | 1923 return s_atomPaneClass; |
1924 } | 1924 } |
1925 | 1925 |
1926 HWND CPluginClass::GetTabHWND() const | 1926 HWND CPluginClass::GetTabHWND() const |
1927 { | 1927 { |
1928 | 1928 wchar_t szClassName[MAX_PATH]; |
1929 TCHAR szClassName[MAX_PATH]; | |
1930 // Get browser window and url | 1929 // Get browser window and url |
1931 HWND hBrowserWnd = GetBrowserHWND(); | 1930 HWND hBrowserWnd = GetBrowserHWND(); |
1932 if (!hBrowserWnd) | 1931 if (!hBrowserWnd) |
1933 { | 1932 { |
1934 DEBUG_ERROR_LOG(0, PLUGIN_ERROR_UI, PLUGIN_ERROR_UI_NO_STATUSBAR_BROWSER, "C
lass::GetTabWindow - No tab window") | 1933 DEBUG_ERROR_LOG(0, PLUGIN_ERROR_UI, PLUGIN_ERROR_UI_NO_STATUSBAR_BROWSER, "C
lass::GetTabWindow - No tab window") |
1935 s_criticalSectionWindow.Unlock(); | 1934 s_criticalSectionWindow.Unlock(); |
1936 | 1935 |
1937 return false; | 1936 return false; |
1938 } | 1937 } |
1939 | 1938 |
1940 // Looking for a TabWindowClass window in IE7 | 1939 // Looking for a TabWindowClass window in IE7 |
1941 | 1940 |
1942 HWND hTabWnd = ::GetWindow(hBrowserWnd, GW_CHILD); | 1941 HWND hTabWnd = ::GetWindow(hBrowserWnd, GW_CHILD); |
1943 while (hTabWnd) | 1942 while (hTabWnd) |
1944 { | 1943 { |
1945 memset(szClassName, 0, MAX_PATH); | 1944 memset(szClassName, 0, MAX_PATH); |
1946 GetClassName(hTabWnd, szClassName, MAX_PATH); | 1945 GetClassName(hTabWnd, szClassName, MAX_PATH); |
1947 | 1946 |
1948 if (_tcscmp(szClassName, _T("TabWindowClass")) == 0 || _tcscmp(szClassName,_
T("Frame Tab")) == 0) | 1947 if (wcscmp(szClassName, L"TabWindowClass") == 0 || wcscmp(szClassName, L"Fra
me Tab") == 0) |
1949 { | 1948 { |
1950 // IE8 support | 1949 // IE8 support |
1951 HWND hTabWnd2 = hTabWnd; | 1950 HWND hTabWnd2 = hTabWnd; |
1952 if (_tcscmp(szClassName,_T("Frame Tab")) == 0) | 1951 if (wcscmp(szClassName, L"Frame Tab") == 0) |
1953 { | 1952 { |
1954 hTabWnd2 = ::FindWindowEx(hTabWnd2, NULL, _T("TabWindowClass"), NULL); | 1953 hTabWnd2 = ::FindWindowEx(hTabWnd2, NULL, L"TabWindowClass", NULL); |
1955 } | 1954 } |
1956 | 1955 |
1957 if (hTabWnd2) | 1956 if (hTabWnd2) |
1958 { | 1957 { |
1959 DWORD nProcessId; | 1958 DWORD nProcessId; |
1960 ::GetWindowThreadProcessId(hTabWnd2, &nProcessId); | 1959 ::GetWindowThreadProcessId(hTabWnd2, &nProcessId); |
1961 if (::GetCurrentProcessId() == nProcessId) | 1960 if (::GetCurrentProcessId() == nProcessId) |
1962 { | 1961 { |
1963 bool bExistingTab = false; | 1962 bool bExistingTab = false; |
1964 s_criticalSectionLocal.Lock(); | 1963 s_criticalSectionLocal.Lock(); |
(...skipping 21 matching lines...) Expand all Loading... |
1986 } | 1985 } |
1987 } | 1986 } |
1988 } | 1987 } |
1989 | 1988 |
1990 hTabWnd = ::GetWindow(hTabWnd, GW_HWNDNEXT); | 1989 hTabWnd = ::GetWindow(hTabWnd, GW_HWNDNEXT); |
1991 } | 1990 } |
1992 | 1991 |
1993 return hTabWnd; | 1992 return hTabWnd; |
1994 | 1993 |
1995 } | 1994 } |
OLD | NEW |