Compare commits

..
Author SHA1 Message Date
ge0rdi b1c5a6abe8 Scale custom button image according to current DPI
Fixes #2246
2025-10-03 08:05:51 +02:00
62 changed files with 240 additions and 1180 deletions
-211
View File
@@ -1,211 +0,0 @@
name: Build
permissions:
contents: read # Default to secure
on:
pull_request:
branches:
- master
paths:
- 'Src/**'
- 'Localization/**'
- '.github/workflows/build.yml'
workflow_dispatch: # allows manual trigger for main/master
jobs:
build:
runs-on: windows-2022
outputs:
new_version: ${{ steps.versioning.outputs.NEW_VERSION }}
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 0 # Essential to see all tags
- name: Prepare version
id: versioning
shell: pwsh
run: |
# Fetch latest tag
$latestTag = git describe --tags --abbrev=0 2>$null
if ($latestTag -notmatch '^v\d+\.\d+\.\d+$') {
Write-Error "Error: Could not find a valid vX.Y.Z tag in history. Found: '$latestTag'"
exit 1
}
# Parse and Increment
$version = [version]$latestTag.Substring(1)
$baseVersion = "$($version.Major).$($version.Minor).$($version.Build + 1)"
# Handle PR Suffix
if ("${{ github.event_name }}" -eq "pull_request") {
$shortSha = "${{ github.event.pull_request.head.sha }}".Substring(0, 7)
$finalVersion = "$baseVersion-pr-$shortSha"
} else {
$finalVersion = $baseVersion
}
# Export
"NEW_VERSION=$finalVersion" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
Write-Host "Building version: $finalVersion"
- name: Build binaries
shell: cmd
env:
CS_VERSION: ${{ steps.versioning.outputs.NEW_VERSION }}
run: Src\Setup\BuildBinaries.bat
- name: Upload binaries
if: github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/master' # Only manual master builds
id: upload-binaries
uses: actions/upload-artifact@v7
with:
name: Binaries
path: |
Src/Setup/Output/
!Src/Setup/Output/*.skin
!Src/Setup/Output/*.skin7
!Src/Setup/Output/*.zip
retention-days: 1
- name: Sign binaries with SignPath
if: github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/master' # Only manual master builds
uses: signpath/github-action-submit-signing-request@v2
with:
api-token: '${{ secrets.SIGNPATH_API_TOKEN }}'
organization-id: 'b34b60e3-e5bf-4a6e-a13c-dcf641b4362c'
project-slug: 'Open-Shell-Menu'
signing-policy-slug: 'release-signing'
artifact-configuration-slug: 'Binaries'
github-artifact-id: '${{ steps.upload-binaries.outputs.artifact-id }}'
wait-for-completion: true
output-artifact-directory: 'Src/Setup/Output/'
- name: Build installers
shell: cmd
env:
CS_VERSION: ${{ steps.versioning.outputs.NEW_VERSION }}
run: Src\Setup\_BuildEnglish.bat
- name: Upload installers
if: github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/master' # Only manual master builds
id: upload-installers
uses: actions/upload-artifact@v7
with:
name: MSI
path: |
Src/Setup/Temp/*.msi
retention-days: 1
- name: Sign installers with SignPath
if: github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/master' # Only manual master builds
uses: signpath/github-action-submit-signing-request@v2
with:
api-token: '${{ secrets.SIGNPATH_API_TOKEN }}'
organization-id: 'b34b60e3-e5bf-4a6e-a13c-dcf641b4362c'
project-slug: 'Open-Shell-Menu'
signing-policy-slug: 'release-signing'
artifact-configuration-slug: 'Installers'
github-artifact-id: '${{ steps.upload-installers.outputs.artifact-id }}'
wait-for-completion: true
output-artifact-directory: 'Src/Setup/Temp/'
- name: Build setup and symbols
shell: cmd
env:
CS_VERSION: ${{ steps.versioning.outputs.NEW_VERSION }}
run: Src\Setup\BuildArchives.bat
- name: Upload symbols
uses: actions/upload-artifact@v7
with:
path: |
Src/Setup/Final/OpenShellSymbols*.7z
archive: false
- name: Upload utility
uses: actions/upload-artifact@v7
with:
path: |
Src/Setup/Final/Utility.exe
archive: false
- name: Upload setup
id: upload-setup
uses: actions/upload-artifact@v7
with:
path: |
Src/Setup/Final/OpenShellSetup*.exe
archive: false
- name: Sign setup with SignPath
if: github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/master' # Only manual master builds
uses: signpath/github-action-submit-signing-request@v2
with:
api-token: '${{ secrets.SIGNPATH_API_TOKEN }}'
organization-id: 'b34b60e3-e5bf-4a6e-a13c-dcf641b4362c'
project-slug: 'Open-Shell-Menu'
signing-policy-slug: 'release-signing'
github-artifact-id: '${{ steps.upload-setup.outputs.artifact-id }}'
wait-for-completion: true
skip-decompress: true
output-artifact-directory: 'Src/Setup/Final/'
# `overwrite: true` doesn't work with `archive: false`, so we have to delete the original first
# https://github.com/actions/upload-artifact/issues/769
# https://github.com/actions/upload-artifact/issues/785
- name: Delete temporary artifacts
if: github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/master' # Only manual master builds
uses: geekyeggo/delete-artifact@v6
with:
name: |
OpenShellSetup*.exe
Binaries
MSI
- name: Upload setup (signed)
if: github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/master' # Only manual master builds
uses: actions/upload-artifact@v7
with:
path: |
Src/Setup/Final/OpenShellSetup*.exe
archive: false
overwrite: true
release:
if: github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/master' # Only manual master builds
needs: build
runs-on: ubuntu-latest # Cheaper/faster than windows for just uploading
permissions:
contents: write # Elevate permissions ONLY for this job
steps:
- name: Download setup
uses: actions/download-artifact@v8
with:
pattern: OpenShellSetup*.exe
- name: Download symbols
uses: actions/download-artifact@v8
with:
pattern: OpenShellSymbols*.7z
- name: Download utility
uses: actions/download-artifact@v8
with:
pattern: Utility.exe
- name: Create GitHub Release
uses: softprops/action-gh-release@v3
with:
tag_name: v${{ needs.build.outputs.new_version }}
name: ${{ needs.build.outputs.new_version }}
generate_release_notes: true
prerelease: true
files: |
OpenShellSetup*.exe
OpenShellSymbols_*.7z
Utility.exe
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+1 -4
View File
@@ -7,7 +7,7 @@ A collection of utilities bringing back classic features to Windows.
*Originally* **[Classic Shell](http://www.classicshell.net)** *by [Ivo Beltchev](https://sourceforge.net/u/ibeltchev/profile/)* *Originally* **[Classic Shell](http://www.classicshell.net)** *by [Ivo Beltchev](https://sourceforge.net/u/ibeltchev/profile/)*
[![GitHub Release](https://img.shields.io/github/release/Open-Shell/Open-Shell-Menu.svg?style=flat-square)](https://github.com/Open-Shell/Open-Shell-Menu/releases/latest)  [![GitHub Pre-Release](https://img.shields.io/github/release/Open-Shell/Open-Shell-Menu/all.svg?style=flat-square)](https://github.com/Open-Shell/Open-Shell-Menu/releases)  [![Build](https://github.com/Open-Shell/Open-Shell-Menu/actions/workflows/build.yml/badge.svg)](https://github.com/Open-Shell/Open-Shell-Menu/actions/workflows/build.yml)  [![Build status](https://img.shields.io/appveyor/build/passionate-coder/Open-Shell-Menu?logo=appveyor&style=flat-square)](https://ci.appveyor.com/project/passionate-coder/open-shell-menu/branch/master)  [![GitQ](https://img.shields.io/badge/gitq-discussions-1577fa?style=flat-square)](https://gitq.com/passionate-coder/Classic-Start)  [![Gitter chat](https://img.shields.io/gitter/room/badges/shields.svg?color=lightseagreen&logo=gitter&style=flat-square)](https://gitter.im/open-shell/Lobby)  [![Discord](https://img.shields.io/discord/757701054782636082?color=mediumslateblue&label=Discord&logo=discord&logoColor=white&style=flat-square)](https://discord.gg/7H6arr5) [![GitHub Release](https://img.shields.io/github/release/Open-Shell/Open-Shell-Menu.svg?style=flat-square)](https://github.com/Open-Shell/Open-Shell-Menu/releases/latest)  [![GitHub Pre-Release](https://img.shields.io/github/release/Open-Shell/Open-Shell-Menu/all.svg?style=flat-square)](https://github.com/Open-Shell/Open-Shell-Menu/releases)  [![Build status](https://img.shields.io/appveyor/build/passionate-coder/Open-Shell-Menu?logo=appveyor&style=flat-square)](https://ci.appveyor.com/project/passionate-coder/open-shell-menu/branch/master)  [![GitQ](https://img.shields.io/badge/gitq-discussions-1577fa?style=flat-square)](https://gitq.com/passionate-coder/Classic-Start)  [![Gitter chat](https://img.shields.io/gitter/room/badges/shields.svg?color=lightseagreen&logo=gitter&style=flat-square)](https://gitter.im/open-shell/Lobby)  [![Discord](https://img.shields.io/discord/757701054782636082?color=mediumslateblue&label=Discord&logo=discord&logoColor=white&style=flat-square)](https://discord.gg/7H6arr5)
[Open-Shell Homepage](https://open-shell.github.io/Open-Shell-Menu) [Open-Shell Homepage](https://open-shell.github.io/Open-Shell-Menu)
@@ -29,9 +29,6 @@ You can find the latest stable version here:
> >
> If you install older one on a Windows for ARM installation (ex. using Parallels Desktop on an Apple Silicon Mac), you will no longer be able to log into your account the next time you reboot. Please refrain from installing Open-Shell on Windows for ARM. > If you install older one on a Windows for ARM installation (ex. using Parallels Desktop on an Apple Silicon Mac), you will no longer be able to log into your account the next time you reboot. Please refrain from installing Open-Shell on Windows for ARM.
### Code signing
Free code signing provided by [SignPath.io](https://about.signpath.io/), certificate by [SignPath Foundation](https://signpath.org/)
### Temporary Translation/Language Solution ### Temporary Translation/Language Solution
1. Download [language DLL](https://coddec.github.io/Classic-Shell/www.classicshell.net/translations/index.html) 1. Download [language DLL](https://coddec.github.io/Classic-Shell/www.classicshell.net/translations/index.html)
2. Place it either in the Open-Shell's __install folder__ or in the `%ALLUSERSPROFILE%\OpenShell\Languages` folder 2. Place it either in the Open-Shell's __install folder__ or in the `%ALLUSERSPROFILE%\OpenShell\Languages` folder
+1 -1
View File
@@ -59,7 +59,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration"> <PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType> <ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v143</PlatformToolset> <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<UseOfAtl>Static</UseOfAtl> <UseOfAtl>Static</UseOfAtl>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization Condition="'$(Configuration)'!='Debug'">true</WholeProgramOptimization> <WholeProgramOptimization Condition="'$(Configuration)'!='Debug'">true</WholeProgramOptimization>
@@ -135,8 +135,6 @@ int WINAPI wWinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpstrC
FARPROC proc=GetProcAddress(dll,"ShowExplorerSettings"); FARPROC proc=GetProcAddress(dll,"ShowExplorerSettings");
if (!proc) return 2; if (!proc) return 2;
HRESULT comResult=CoInitialize(NULL);
proc(); proc();
if (SUCCEEDED(comResult)) CoUninitialize();
return 0; return 0;
} }
@@ -23,7 +23,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration"> <PropertyGroup Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v143</PlatformToolset> <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<UseOfAtl>Static</UseOfAtl> <UseOfAtl>Static</UseOfAtl>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization Condition="'$(Configuration)'!='Debug'">true</WholeProgramOptimization> <WholeProgramOptimization Condition="'$(Configuration)'!='Debug'">true</WholeProgramOptimization>
-2
View File
@@ -252,8 +252,6 @@ int WINAPI wWinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdL
return 0; return 0;
} }
HRESULT comResult=CoInitialize(NULL);
ShowIESettings(); ShowIESettings();
if (SUCCEEDED(comResult)) CoUninitialize();
return 0; return 0;
} }
+1 -1
View File
@@ -47,7 +47,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration"> <PropertyGroup Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v143</PlatformToolset> <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<UseOfAtl>Static</UseOfAtl> <UseOfAtl>Static</UseOfAtl>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization Condition="'$(Configuration)'!='Debug'">true</WholeProgramOptimization> <WholeProgramOptimization Condition="'$(Configuration)'!='Debug'">true</WholeProgramOptimization>
@@ -59,7 +59,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration"> <PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType> <ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v143</PlatformToolset> <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<UseOfAtl>Static</UseOfAtl> <UseOfAtl>Static</UseOfAtl>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization Condition="'$(Configuration)'!='Debug'">true</WholeProgramOptimization> <WholeProgramOptimization Condition="'$(Configuration)'!='Debug'">true</WholeProgramOptimization>
+1 -1
View File
@@ -34,7 +34,7 @@
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<MultiProcessorCompilation>true</MultiProcessorCompilation> <MultiProcessorCompilation>true</MultiProcessorCompilation>
<ConformanceMode>true</ConformanceMode> <ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp20</LanguageStandard> <LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile> </ClCompile>
<Midl> <Midl>
<MkTypLibCompatible>false</MkTypLibCompatible> <MkTypLibCompatible>false</MkTypLibCompatible>
+2 -4
View File
@@ -70,7 +70,7 @@ BEGIN
EDITTEXT IDC_EDITSEARCH,22,7,120,12,ES_AUTOHSCROLL EDITTEXT IDC_EDITSEARCH,22,7,120,12,ES_AUTOHSCROLL
CONTROL "Show all settings",IDC_CHECKALL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,154,7,79,12 CONTROL "Show all settings",IDC_CHECKALL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,154,7,79,12
CONTROL "<a>Help...</a>",IDC_LINKHELP,"SysLink",WS_TABSTOP,348,9,26,10,WS_EX_TRANSPARENT CONTROL "<a>Help...</a>",IDC_LINKHELP,"SysLink",WS_TABSTOP,348,9,26,10,WS_EX_TRANSPARENT
CONTROL "",IDC_TABSETTINGS,"SysTabControl32",TCS_MULTILINE | WS_TABSTOP,7,20,367,169 CONTROL "",IDC_TABSETTINGS,"SysTabControl32",TCS_MULTILINE | TCS_FOCUSNEVER,7,20,367,169
CONTROL "<a>Open-Shell Homepage</a>",IDC_LINKWEB,"SysLink",WS_TABSTOP,7,195,75,10,WS_EX_TRANSPARENT CONTROL "<a>Open-Shell Homepage</a>",IDC_LINKWEB,"SysLink",WS_TABSTOP,7,195,75,10,WS_EX_TRANSPARENT
CONTROL "Name of translator goes <a href=""http://www.yoursite.com"">here</a>",IDC_SYSLINKLOC, CONTROL "Name of translator goes <a href=""http://www.yoursite.com"">here</a>",IDC_SYSLINKLOC,
"SysLink",NOT WS_VISIBLE | WS_TABSTOP,80,195,111,10 "SysLink",NOT WS_VISIBLE | WS_TABSTOP,80,195,111,10
@@ -282,9 +282,7 @@ END
STRINGTABLE STRINGTABLE
BEGIN BEGIN
IDS_SETTINGS_PAGES "Settings pages" IDS_INITIATE_FAIL "Failed to initiate the download."
IDS_SETTING_MODIFIED "modified"
IDS_INITIATE_FAIL "Failed to initiate the download."
IDS_UPDATE_TITLE "Open-Shell Update" IDS_UPDATE_TITLE "Open-Shell Update"
IDS_INST_DOWNLOAD_FAIL "Failed to download the new version." IDS_INST_DOWNLOAD_FAIL "Failed to download the new version."
IDS_INST_SAVE_FAIL "Failed to save file '%s'." IDS_INST_SAVE_FAIL "Failed to save file '%s'."
+1 -1
View File
@@ -43,7 +43,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration"> <PropertyGroup Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType> <ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v143</PlatformToolset> <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<UseOfAtl>Static</UseOfAtl> <UseOfAtl>Static</UseOfAtl>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization Condition="'$(Configuration)'!='Debug'">true</WholeProgramOptimization> <WholeProgramOptimization Condition="'$(Configuration)'!='Debug'">true</WholeProgramOptimization>
+13 -83
View File
@@ -1110,7 +1110,6 @@ class CSettingsDlg: public CResizeableDlg<CSettingsDlg>
public: public:
CSettingsDlg( void ); CSettingsDlg( void );
void Init( CSetting *pSettings, ICustomSettings *pCustom, int tab, const wchar_t* appId ); void Init( CSetting *pSettings, ICustomSettings *pCustom, int tab, const wchar_t* appId );
bool NavigateTab( bool bPrevious );
BEGIN_MSG_MAP( CSettingsDlg ) BEGIN_MSG_MAP( CSettingsDlg )
MESSAGE_HANDLER( WM_INITDIALOG, OnInitDialog ) MESSAGE_HANDLER( WM_INITDIALOG, OnInitDialog )
@@ -1187,7 +1186,7 @@ private:
const wchar_t* m_AppId; const wchar_t* m_AppId;
void AddTabs( int name, const CSetting *pSelect=NULL ); void AddTabs( int name, const CSetting *pSelect=NULL );
void SetCurTab( int index, bool bReset, const CSetting *pSelect=NULL, bool bFocusPanel=true ); void SetCurTab( int index, bool bReset, const CSetting *pSelect=NULL );
bool IsTabValid( void ); bool IsTabValid( void );
void StorePlacement( void ); void StorePlacement( void );
@@ -1313,7 +1312,6 @@ LRESULT CSettingsDlg::OnInitDialog( UINT uMsg, WPARAM wParam, LPARAM lParam, BOO
icon=(HICON)LoadImage(GetModuleHandle(L"shell32.dll"),MAKEINTRESOURCE(323),IMAGE_ICON,GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),LR_DEFAULTCOLOR); icon=(HICON)LoadImage(GetModuleHandle(L"shell32.dll"),MAKEINTRESOURCE(323),IMAGE_ICON,GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),LR_DEFAULTCOLOR);
SendDlgItemMessage(IDC_ICONSEARCH,STM_SETICON,(WPARAM)icon); SendDlgItemMessage(IDC_ICONSEARCH,STM_SETICON,(WPARAM)icon);
SendDlgItemMessage(IDC_EDITSEARCH,EM_SETCUEBANNER,FALSE,(LPARAM)(const wchar_t*)LoadStringEx(IDS_SEARCH_PROMPT)); SendDlgItemMessage(IDC_EDITSEARCH,EM_SETCUEBANNER,FALSE,(LPARAM)(const wchar_t*)LoadStringEx(IDS_SEARCH_PROMPT));
SetControlAccessibleName(GetDlgItem(IDC_EDITSEARCH),LoadStringEx(IDS_SEARCH_PROMPT));
SetWindowSubclass(GetDlgItem(IDC_EDITSEARCH),SubclassSearchBoxProc,'CLSH',0); SetWindowSubclass(GetDlgItem(IDC_EDITSEARCH),SubclassSearchBoxProc,'CLSH',0);
CWindow tooltip; CWindow tooltip;
@@ -1366,7 +1364,6 @@ LRESULT CSettingsDlg::OnInitDialog( UINT uMsg, WPARAM wParam, LPARAM lParam, BOO
SIZE maxSize={0,0}; SIZE maxSize={0,0};
m_Tabs=GetDlgItem(IDC_TABSETTINGS); m_Tabs=GetDlgItem(IDC_TABSETTINGS);
m_Tabs.SetWindowText(LoadStringEx(IDS_SETTINGS_PAGES));
m_Panel=NULL; m_Panel=NULL;
int idx=0; int idx=0;
for (const CSetting *pSetting=m_pSettings;pSetting->name;pSetting++) for (const CSetting *pSetting=m_pSettings;pSetting->name;pSetting++)
@@ -1421,8 +1418,7 @@ LRESULT CSettingsDlg::OnInitDialog( UINT uMsg, WPARAM wParam, LPARAM lParam, BOO
ShowWindow(SW_MAXIMIZE); ShowWindow(SW_MAXIMIZE);
} }
GetDlgItem(IDC_BUTTONBACKUP).SetFocus(); return TRUE;
return FALSE;
} }
LRESULT CSettingsDlg::OnDestroy( UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled ) LRESULT CSettingsDlg::OnDestroy( UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled )
@@ -1481,14 +1477,6 @@ void CSettingsDlg::AddTabs( int name, const CSetting *pSelect )
if (pSetting->nameID==name) if (pSetting->nameID==name)
idx=i; idx=i;
} }
int tabCount=TabCtrl_GetItemCount(m_Tabs);
LONG_PTR tabStyle=m_Tabs.GetWindowLongPtr(GWL_STYLE);
if (tabCount<=1)
tabStyle=(tabStyle&~WS_TABSTOP)|TCS_FOCUSNEVER;
else
tabStyle=(tabStyle|WS_TABSTOP)&~TCS_FOCUSNEVER;
m_Tabs.SetWindowLongPtr(GWL_STYLE,tabStyle);
m_Tabs.SetWindowPos(NULL,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE|SWP_NOZORDER|SWP_NOACTIVATE|SWP_FRAMECHANGED);
m_Index=-1; m_Index=-1;
TabCtrl_SetCurSel(m_Tabs,idx); TabCtrl_SetCurSel(m_Tabs,idx);
m_Tabs.InvalidateRect(NULL); m_Tabs.InvalidateRect(NULL);
@@ -1511,23 +1499,20 @@ LRESULT CSettingsDlg::OnKeyDown( UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL&
if (wParam==VK_TAB && GetKeyState(VK_CONTROL)<0) if (wParam==VK_TAB && GetKeyState(VK_CONTROL)<0)
{ {
int sel=TabCtrl_GetCurSel(m_Tabs); int sel=TabCtrl_GetCurSel(m_Tabs);
int count=TabCtrl_GetItemCount(m_Tabs);
if (GetKeyState(VK_SHIFT)<0) if (GetKeyState(VK_SHIFT)<0)
{ {
if (count>0) if (sel>0)
{ {
int next=(sel+count-1)%count; TabCtrl_SetCurSel(m_Tabs,sel-1);
TabCtrl_SetCurSel(m_Tabs,next); SetCurTab(sel-1,false);
SetCurTab(next,false);
} }
} }
else else
{ {
if (count>0) if (sel<TabCtrl_GetItemCount(m_Tabs)-1)
{ {
int next=(sel+1)%count; TabCtrl_SetCurSel(m_Tabs,sel+1);
TabCtrl_SetCurSel(m_Tabs,next); SetCurTab(sel+1,false);
SetCurTab(next,false);
} }
} }
} }
@@ -1685,7 +1670,7 @@ LRESULT CSettingsDlg::OnBackup( WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL&
ofn.lpstrTitle=title; ofn.lpstrTitle=title;
ofn.lpstrDefExt=L".xml"; ofn.lpstrDefExt=L".xml";
ofn.Flags=OFN_DONTADDTORECENT|OFN_ENABLESIZING|OFN_EXPLORER|OFN_PATHMUSTEXIST|OFN_OVERWRITEPROMPT|OFN_HIDEREADONLY|OFN_NOCHANGEDIR; ofn.Flags=OFN_DONTADDTORECENT|OFN_ENABLESIZING|OFN_EXPLORER|OFN_PATHMUSTEXIST|OFN_OVERWRITEPROMPT|OFN_HIDEREADONLY|OFN_NOCHANGEDIR;
if (GetSaveFileNameSafe(&ofn)) if (GetSaveFileName(&ofn))
{ {
CString err=g_SettingsManager.SaveSettingsXml(path); CString err=g_SettingsManager.SaveSettingsXml(path);
if (!err.IsEmpty()) if (!err.IsEmpty())
@@ -1714,7 +1699,7 @@ LRESULT CSettingsDlg::OnBackup( WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL&
CString title=LoadStringEx(IDS_XML_TITLE_LOAD); CString title=LoadStringEx(IDS_XML_TITLE_LOAD);
ofn.lpstrTitle=title; ofn.lpstrTitle=title;
ofn.Flags=OFN_DONTADDTORECENT|OFN_ENABLESIZING|OFN_EXPLORER|OFN_FILEMUSTEXIST|OFN_HIDEREADONLY|OFN_NOCHANGEDIR; ofn.Flags=OFN_DONTADDTORECENT|OFN_ENABLESIZING|OFN_EXPLORER|OFN_FILEMUSTEXIST|OFN_HIDEREADONLY|OFN_NOCHANGEDIR;
if (GetOpenFileNameSafe(&ofn)) if (GetOpenFileName(&ofn))
{ {
SetCurTab(m_Index,true); // reload tab once to force-close any active edit boxes SetCurTab(m_Index,true); // reload tab once to force-close any active edit boxes
CString error=g_SettingsManager.LoadSettingsXml(path); CString error=g_SettingsManager.LoadSettingsXml(path);
@@ -1755,7 +1740,6 @@ LRESULT CSettingsDlg::OnCheckAll( WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL
{ {
m_bBasic=bBasic; m_bBasic=bBasic;
AddTabs(-1); AddTabs(-1);
::SetFocus(hWndCtl);
} }
return 0; return 0;
} }
@@ -1774,7 +1758,7 @@ LRESULT CSettingsDlg::OnSearchChange( WORD wNotifyCode, WORD wID, HWND hWndCtl,
return 0; return 0;
} }
void CSettingsDlg::SetCurTab( int index, bool bReset, const CSetting *pSelect, bool bFocusPanel ) void CSettingsDlg::SetCurTab( int index, bool bReset, const CSetting *pSelect )
{ {
if (m_Index==index && !bReset) return; if (m_Index==index && !bReset) return;
m_Index=index; m_Index=index;
@@ -1794,59 +1778,12 @@ void CSettingsDlg::SetCurTab( int index, bool bReset, const CSetting *pSelect, b
::MapWindowPoints(NULL,m_hWnd,(POINT*)&rc,2); ::MapWindowPoints(NULL,m_hWnd,(POINT*)&rc,2);
TabCtrl_AdjustRect(m_Tabs,FALSE,&rc); TabCtrl_AdjustRect(m_Tabs,FALSE,&rc);
HWND hwnd=pPanel->Activate(pGroup,rc,bReset); HWND hwnd=pPanel->Activate(pGroup,rc,bReset);
CString pageTitle=LoadStringEx(pGroup->nameID);
::SetWindowText(hwnd,pageTitle);
if (hwnd!=m_Panel) if (hwnd!=m_Panel)
{ {
if (m_Panel) ::ShowWindow(m_Panel,SW_HIDE); if (m_Panel) ::ShowWindow(m_Panel,SW_HIDE);
m_Panel=hwnd; m_Panel=hwnd;
::SetFocus(m_Panel);
} }
if (bFocusPanel) ::SetFocus(m_Panel);
}
bool CSettingsDlg::NavigateTab( bool bPrevious )
{
HWND focus=::GetFocus();
HWND firstPanel=m_Panel?::GetNextDlgTabItem(m_Panel,NULL,FALSE):NULL;
HWND lastPanel=m_Panel?::GetNextDlgTabItem(m_Panel,NULL,TRUE):NULL;
HWND targets[]={
GetDlgItem(IDC_BUTTONBACKUP),
GetDlgItem(IDC_CHECKALL),
GetDlgItem(IDC_EDITSEARCH),
GetDlgItem(IDC_TABSETTINGS),
firstPanel,
GetDlgItem(IDOK),
GetDlgItem(IDCANCEL),
GetDlgItem(IDC_LINKHELP),
GetDlgItem(IDC_LINKWEB),
};
int current=-1;
if (m_Panel && (focus==m_Panel || ::IsChild(m_Panel,focus)))
{
HWND next=::GetNextDlgTabItem(m_Panel,focus,bPrevious);
HWND wrapped=bPrevious?lastPanel:firstPanel;
if (next && next!=wrapped)
return false; // Let IsDialogMessage move within the active page.
current=4;
}
else
{
for (int i=0;i<_countof(targets);i++)
if (focus==targets[i]) { current=i; break; }
}
if (current<0) return false;
for (int step=1;step<=_countof(targets);step++)
{
int index=(current+(bPrevious?-step:step)+_countof(targets)*2)%_countof(targets);
HWND target=(index==4 && bPrevious)?lastPanel:targets[index];
if (!target || !::IsWindowVisible(target) || !::IsWindowEnabled(target)) continue;
if (index==3 && !(::GetWindowLongPtr(target,GWL_STYLE)&WS_TABSTOP)) continue;
::SetFocus(target);
return true;
}
return false;
} }
LRESULT CSettingsDlg::OnSelChanging( int idCtrl, LPNMHDR pnmh, BOOL& bHandled ) LRESULT CSettingsDlg::OnSelChanging( int idCtrl, LPNMHDR pnmh, BOOL& bHandled )
@@ -1856,9 +1793,7 @@ LRESULT CSettingsDlg::OnSelChanging( int idCtrl, LPNMHDR pnmh, BOOL& bHandled )
LRESULT CSettingsDlg::OnSelChange( int idCtrl, LPNMHDR pnmh, BOOL& bHandled ) LRESULT CSettingsDlg::OnSelChange( int idCtrl, LPNMHDR pnmh, BOOL& bHandled )
{ {
// Mouse clicks and Left/Right navigation keep focus on the tab strip. SetCurTab(TabCtrl_GetCurSel(m_Tabs),false);
// Ctrl+Tab is handled separately and moves focus into the new page.
SetCurTab(TabCtrl_GetCurSel(m_Tabs),false,NULL,false);
return 0; return 0;
} }
@@ -1991,11 +1926,6 @@ bool IsSettingsMessage( MSG *msg )
g_SettingsDlg.SendMessage(WM_KEYDOWN,VK_TAB,msg->lParam); g_SettingsDlg.SendMessage(WM_KEYDOWN,VK_TAB,msg->lParam);
return true; return true;
} }
if (msg->message==WM_KEYDOWN && msg->wParam==VK_TAB)
{
if (g_SettingsDlg.NavigateTab(GetKeyState(VK_SHIFT)<0))
return true;
}
if (msg->message==WM_KEYDOWN && msg->wParam==VK_RETURN && GetKeyState(VK_CONTROL)<0) if (msg->message==WM_KEYDOWN && msg->wParam==VK_RETURN && GetKeyState(VK_CONTROL)<0)
{ {
g_SettingsDlg.SendMessage(WM_COMMAND,IDOK,0); g_SettingsDlg.SendMessage(WM_COMMAND,IDOK,0);
+7 -344
View File
@@ -15,184 +15,6 @@
#include <uxtheme.h> #include <uxtheme.h>
#include <map> #include <map>
#include <algorithm> #include <algorithm>
#include <thread>
#include <oleacc.h>
// Local constants avoid forcing every executable that links the Lib static
// library to define the oleacc GUID symbols.
static const GUID CLSID_SettingsAccPropServices={0xb5f8350b,0x0548,0x48b1,{0xa6,0xee,0x88,0xbd,0x00,0xb4,0xa5,0xe7}};
static const GUID PROPID_SettingsAccState={0xa8d4d5b0,0x0a21,0x42d0,{0xa5,0xc0,0x51,0x4e,0x98,0x4f,0x45,0x7b}};
static const GUID PROPID_SettingsAccName={0x608d3df8,0x8128,0x4aa7,{0xa4,0x28,0xf5,0x5e,0x49,0x26,0x72,0x91}};
static const GUID PROPID_SettingsAccRole={0xcb905ff2,0x7bd1,0x4c05,{0xb3,0xc8,0xe6,0xc2,0x41,0x36,0x4d,0x70}};
class CSettingsTreeAccServer: public IAccPropServer
{
public:
CSettingsTreeAccServer( void ): m_RefCount(1)
{
CoCreateInstance(CLSID_SettingsAccPropServices,NULL,CLSCTX_INPROC_SERVER,IID_PPV_ARGS(&m_Props));
}
virtual HRESULT STDMETHODCALLTYPE QueryInterface( REFIID iid, void **object )
{
if (!object) return E_POINTER;
*object=NULL;
if (iid==IID_IUnknown || iid==IID_IAccPropServer)
{
*object=static_cast<IAccPropServer*>(this);
AddRef();
return S_OK;
}
return E_NOINTERFACE;
}
virtual ULONG STDMETHODCALLTYPE AddRef( void ) { return InterlockedIncrement(&m_RefCount); }
virtual ULONG STDMETHODCALLTYPE Release( void )
{
ULONG count=InterlockedDecrement(&m_RefCount);
if (!count) delete this;
return count;
}
virtual HRESULT STDMETHODCALLTYPE GetPropValue( const BYTE *identity, DWORD identitySize, MSAAPROPID prop, VARIANT *value, BOOL *hasProp )
{
if (!value || !hasProp) return E_POINTER;
VariantInit(value);
*hasProp=FALSE;
if (!m_Props) return S_OK;
HWND tree=NULL;
DWORD objectId=0, childId=0;
if (FAILED(m_Props->DecomposeHwndIdentityString(identity,identitySize,&tree,&objectId,&childId)) || objectId!=OBJID_CLIENT || childId==CHILDID_SELF)
return S_OK;
HTREEITEM hItem=TreeView_MapAccIDToHTREEITEM(tree,childId);
if (!hItem) return S_OK;
wchar_t text[256];
TVITEM item={TVIF_IMAGE|TVIF_STATE|TVIF_TEXT,hItem,0,TVIS_SELECTED|TVIS_EXPANDED|TVIS_CUT,text,_countof(text)};
if (!TreeView_GetItem(tree,&item)) return S_OK;
if (prop==PROPID_SettingsAccRole)
{
if (item.iImage&SETTING_STATE_CHECKBOX)
value->lVal=ROLE_SYSTEM_CHECKBUTTON;
else if (item.iImage&SETTING_STATE_RADIO)
value->lVal=ROLE_SYSTEM_RADIOBUTTON;
else
return S_OK;
value->vt=VT_I4;
*hasProp=TRUE;
return S_OK;
}
if (prop==PROPID_SettingsAccName)
{
// A sighted user can see which child choice is checked without
// opening the group. Give screen-reader users the same summary.
for (HTREEITEM child=TreeView_GetChild(tree,hItem);child;child=TreeView_GetNextSibling(tree,child))
{
wchar_t childText[256];
TVITEM childItem={TVIF_IMAGE|TVIF_TEXT,child,0,0,childText,_countof(childText)};
if (TreeView_GetItem(tree,&childItem) && (childItem.iImage&SETTING_STATE_CHECKED))
{
CString name;
name.Format(L"%s: %s",text,childText);
value->vt=VT_BSTR;
value->bstrVal=SysAllocString(name);
if (!value->bstrVal) return E_OUTOFMEMORY;
*hasProp=TRUE;
return S_OK;
}
}
return S_OK;
}
if (prop!=PROPID_SettingsAccState) return S_OK;
LONG state=STATE_SYSTEM_SELECTABLE|STATE_SYSTEM_FOCUSABLE;
if (item.state&TVIS_SELECTED)
{
state|=STATE_SYSTEM_SELECTED;
if (GetFocus()==tree) state|=STATE_SYSTEM_FOCUSED;
}
if (TreeView_GetChild(tree,hItem))
state|=(item.state&TVIS_EXPANDED)?STATE_SYSTEM_EXPANDED:STATE_SYSTEM_COLLAPSED;
if (item.state&TVIS_CUT || (item.iImage&SETTING_STATE_DISABLED))
state|=STATE_SYSTEM_UNAVAILABLE;
if ((item.iImage&(SETTING_STATE_CHECKBOX|SETTING_STATE_RADIO)) && (item.iImage&SETTING_STATE_CHECKED))
state|=STATE_SYSTEM_CHECKED;
RECT rect;
if (!TreeView_GetItemRect(tree,hItem,&rect,FALSE))
state|=STATE_SYSTEM_INVISIBLE;
value->vt=VT_I4;
value->lVal=state;
*hasProp=TRUE;
return S_OK;
}
private:
LONG m_RefCount;
CComPtr<IAccPropServices> m_Props;
};
void EnableSettingsTreeAccessibility( HWND tree )
{
CComPtr<IAccPropServices> props;
if (FAILED(CoCreateInstance(CLSID_SettingsAccPropServices,NULL,CLSCTX_INPROC_SERVER,IID_PPV_ARGS(&props)))) return;
CSettingsTreeAccServer *server=new CSettingsTreeAccServer;
MSAAPROPID property=PROPID_SettingsAccState;
props->SetHwndPropServer(tree,OBJID_CLIENT,CHILDID_SELF,&property,1,server,ANNO_CONTAINER);
server->Release();
}
void ClearSettingsTreeItemAccessibility( HWND tree )
{
CComPtr<IAccPropServices> props;
if (FAILED(CoCreateInstance(CLSID_SettingsAccPropServices,NULL,CLSCTX_INPROC_SERVER,IID_PPV_ARGS(&props)))) return;
MSAAPROPID properties[]={PROPID_SettingsAccState,PROPID_SettingsAccName,PROPID_SettingsAccRole};
for (HTREEITEM item=TreeView_GetRoot(tree);item;)
{
props->ClearHwndProps(tree,OBJID_CLIENT,TreeView_MapHTREEITEMToAccID(tree,item),properties,_countof(properties));
HTREEITEM next=TreeView_GetChild(tree,item);
if (!next)
{
next=TreeView_GetNextSibling(tree,item);
while (!next && (item=TreeView_GetParent(tree,item))!=NULL)
next=TreeView_GetNextSibling(tree,item);
}
item=next;
}
}
void SetControlAccessibleName( HWND control, const wchar_t *name )
{
CComPtr<IAccPropServices> props;
if (SUCCEEDED(CoCreateInstance(CLSID_SettingsAccPropServices,NULL,CLSCTX_INPROC_SERVER,IID_PPV_ARGS(&props))))
props->SetHwndPropStr(control,OBJID_CLIENT,CHILDID_SELF,PROPID_SettingsAccName,name);
}
void SetSettingsTreeAccessibleName( HWND tree, const wchar_t *name )
{
SetControlAccessibleName(tree,name);
}
void SetSettingsTreeItemAccessibleName( HWND tree, HTREEITEM item, const wchar_t *name )
{
CComPtr<IAccPropServices> props;
if (SUCCEEDED(CoCreateInstance(CLSID_SettingsAccPropServices,NULL,CLSCTX_INPROC_SERVER,IID_PPV_ARGS(&props))))
props->SetHwndPropStr(tree,OBJID_CLIENT,TreeView_MapHTREEITEMToAccID(tree,item),PROPID_SettingsAccName,name);
}
void SetSettingsTreeItemAccessibleRole( HWND tree, HTREEITEM item, LONG role )
{
CComPtr<IAccPropServices> props;
if (SUCCEEDED(CoCreateInstance(CLSID_SettingsAccPropServices,NULL,CLSCTX_INPROC_SERVER,IID_PPV_ARGS(&props))))
{
// Some settings hosts do not ask a container annotation server for
// descendant state. Bind the dynamic state provider to the item too.
CSettingsTreeAccServer *server=new CSettingsTreeAccServer;
MSAAPROPID stateProperty=PROPID_SettingsAccState;
props->SetHwndPropServer(tree,OBJID_CLIENT,TreeView_MapHTREEITEMToAccID(tree,item),&stateProperty,1,server,ANNO_THIS);
server->Release();
CComVariant value(role);
props->SetHwndProp(tree,OBJID_CLIENT,TreeView_MapHTREEITEMToAccID(tree,item),PROPID_SettingsAccRole,value);
}
}
const KNOWNFOLDERID FOLDERID_DesktopRoot={'DESK', 'TO', 'P', {'D', 'E', 'S', 'K', 'T', 'O', 'P', 0x00}}; const KNOWNFOLDERID FOLDERID_DesktopRoot={'DESK', 'TO', 'P', {'D', 'E', 'S', 'K', 'T', 'O', 'P', 0x00}};
@@ -1371,7 +1193,7 @@ bool BrowseCommandHelper( HWND parent, wchar_t *text )
ofn.lpstrFile=text; ofn.lpstrFile=text;
ofn.nMaxFile=_MAX_PATH; ofn.nMaxFile=_MAX_PATH;
ofn.Flags=OFN_DONTADDTORECENT|OFN_ENABLESIZING|OFN_EXPLORER|OFN_FILEMUSTEXIST|OFN_HIDEREADONLY|OFN_NOCHANGEDIR|OFN_NODEREFERENCELINKS; ofn.Flags=OFN_DONTADDTORECENT|OFN_ENABLESIZING|OFN_EXPLORER|OFN_FILEMUSTEXIST|OFN_HIDEREADONLY|OFN_NOCHANGEDIR|OFN_NODEREFERENCELINKS;
if (GetOpenFileNameSafe(&ofn)) if (GetOpenFileName(&ofn))
{ {
wchar_t buf[_MAX_PATH]; wchar_t buf[_MAX_PATH];
UnExpandEnvStrings(text,buf,_countof(buf)); UnExpandEnvStrings(text,buf,_countof(buf));
@@ -1394,8 +1216,7 @@ bool BrowseCommandHelper( HWND parent, wchar_t *text )
return false; return false;
} }
// Internal implementation that must be run on an STA thread with COM initialized. bool BrowseLinkHelper( HWND parent, wchar_t *text, bool bFoldersOnly )
static bool BrowseLinkHelperImpl( HWND parent, wchar_t *text, bool bFoldersOnly )
{ {
DoEnvironmentSubst(text,_MAX_PATH); DoEnvironmentSubst(text,_MAX_PATH);
@@ -1455,41 +1276,6 @@ static bool BrowseLinkHelperImpl( HWND parent, wchar_t *text, bool bFoldersOnly
return pResult!=NULL; return pResult!=NULL;
} }
// Run IFileOpenDialog on a separate STA thread and pump messages on the caller while waiting.
bool BrowseLinkHelper( HWND parent, wchar_t *text, bool bFoldersOnly )
{
bool result = false;
std::thread worker([&parent, &text, &bFoldersOnly, &result]() mutable {
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
result = BrowseLinkHelperImpl(parent, text, bFoldersOnly);
CoUninitialize();
});
// Pump messages while waiting for the worker (dialog) to finish
while (true)
{
HANDLE hWorker = worker.native_handle();
if (MsgWaitForMultipleObjects(1, &hWorker, FALSE, INFINITE, QS_ALLINPUT) == WAIT_OBJECT_0)
break;
MSG msg;
while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{
if (msg.message == WM_QUIT)
{
PostQuitMessage((int)msg.wParam);
break;
}
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
worker.join();
return result;
}
bool BrowseIconHelper( HWND parent, wchar_t *text ) bool BrowseIconHelper( HWND parent, wchar_t *text )
{ {
int id=0; int id=0;
@@ -2225,7 +2011,7 @@ LRESULT CBrowseForIconDlg::OnBrowse( WORD wNotifyCode, WORD wID, HWND hWndCtl, B
CString title=LoadStringEx(IDS_ICON_TITLE); CString title=LoadStringEx(IDS_ICON_TITLE);
ofn.lpstrTitle=title; ofn.lpstrTitle=title;
ofn.Flags=OFN_DONTADDTORECENT|OFN_ENABLESIZING|OFN_EXPLORER|OFN_FILEMUSTEXIST|OFN_HIDEREADONLY|OFN_NOCHANGEDIR; ofn.Flags=OFN_DONTADDTORECENT|OFN_ENABLESIZING|OFN_EXPLORER|OFN_FILEMUSTEXIST|OFN_HIDEREADONLY|OFN_NOCHANGEDIR;
if (GetOpenFileNameSafe(&ofn)) if (GetOpenFileName(&ofn))
{ {
wchar_t buf[_MAX_PATH]; wchar_t buf[_MAX_PATH];
UnExpandEnvStrings(path,buf,_countof(buf)); UnExpandEnvStrings(path,buf,_countof(buf));
@@ -2424,7 +2210,7 @@ bool BrowseForBitmap( HWND hWndParent, wchar_t *path, bool bAllowJpeg )
CString title=LoadStringEx(IDS_BMP_TITLE); CString title=LoadStringEx(IDS_BMP_TITLE);
ofn.lpstrTitle=title; ofn.lpstrTitle=title;
ofn.Flags=OFN_DONTADDTORECENT|OFN_ENABLESIZING|OFN_EXPLORER|OFN_FILEMUSTEXIST|OFN_HIDEREADONLY|OFN_NOCHANGEDIR; ofn.Flags=OFN_DONTADDTORECENT|OFN_ENABLESIZING|OFN_EXPLORER|OFN_FILEMUSTEXIST|OFN_HIDEREADONLY|OFN_NOCHANGEDIR;
if (GetOpenFileNameSafe(&ofn)) if (GetOpenFileName(&ofn))
{ {
wchar_t buf[_MAX_PATH]; wchar_t buf[_MAX_PATH];
UnExpandEnvStrings(path,buf,_countof(buf)); UnExpandEnvStrings(path,buf,_countof(buf));
@@ -2456,7 +2242,7 @@ bool BrowseForSound( HWND hWndParent, wchar_t *path )
CString title=LoadStringEx(IDS_WAV_TITLE); CString title=LoadStringEx(IDS_WAV_TITLE);
ofn.lpstrTitle=title; ofn.lpstrTitle=title;
ofn.Flags=OFN_DONTADDTORECENT|OFN_ENABLESIZING|OFN_EXPLORER|OFN_FILEMUSTEXIST|OFN_HIDEREADONLY|OFN_NOCHANGEDIR; ofn.Flags=OFN_DONTADDTORECENT|OFN_ENABLESIZING|OFN_EXPLORER|OFN_FILEMUSTEXIST|OFN_HIDEREADONLY|OFN_NOCHANGEDIR;
if (GetOpenFileNameSafe(&ofn)) if (GetOpenFileName(&ofn))
{ {
wchar_t buf[_MAX_PATH]; wchar_t buf[_MAX_PATH];
UnExpandEnvStrings(path,buf,_countof(buf)); UnExpandEnvStrings(path,buf,_countof(buf));
@@ -2511,6 +2297,7 @@ public:
NOTIFY_HANDLER( IDC_SETTINGS, TVN_KEYDOWN, OnKeyDown ) NOTIFY_HANDLER( IDC_SETTINGS, TVN_KEYDOWN, OnKeyDown )
NOTIFY_HANDLER( IDC_SETTINGS, TVN_GETINFOTIP, OnGetInfoTip ) NOTIFY_HANDLER( IDC_SETTINGS, TVN_GETINFOTIP, OnGetInfoTip )
NOTIFY_HANDLER( IDC_SETTINGS, TVN_SELCHANGED, OnSelChanged ) NOTIFY_HANDLER( IDC_SETTINGS, TVN_SELCHANGED, OnSelChanged )
NOTIFY_HANDLER( IDC_SETTINGS, TVN_ITEMEXPANDING, OnExpanding )
END_MSG_MAP() END_MSG_MAP()
BEGIN_RESIZE_MAP BEGIN_RESIZE_MAP
@@ -2540,6 +2327,7 @@ protected:
LRESULT OnClick( int idCtrl, LPNMHDR pnmh, BOOL& bHandled ); LRESULT OnClick( int idCtrl, LPNMHDR pnmh, BOOL& bHandled );
LRESULT OnGetInfoTip( int idCtrl, LPNMHDR pnmh, BOOL& bHandled ); LRESULT OnGetInfoTip( int idCtrl, LPNMHDR pnmh, BOOL& bHandled );
LRESULT OnSelChanged( int idCtrl, LPNMHDR pnmh, BOOL& bHandled ); LRESULT OnSelChanged( int idCtrl, LPNMHDR pnmh, BOOL& bHandled );
LRESULT OnExpanding( int idCtrl, LPNMHDR pnmh, BOOL& bHandled ) { return TRUE; } // prevent collapsing
private: private:
CWindow m_Tree; CWindow m_Tree;
@@ -2573,32 +2361,6 @@ static LRESULT CALLBACK SubclassTreeProc( HWND hWnd, UINT uMsg, WPARAM wParam, L
{ {
if (uMsg==WM_COMMAND) if (uMsg==WM_COMMAND)
return SendMessage(GetParent(hWnd),uMsg,wParam,lParam); return SendMessage(GetParent(hWnd),uMsg,wParam,lParam);
if (uMsg==WM_KEYDOWN && (wParam==VK_LEFT || wParam==VK_RIGHT) && GetKeyState(VK_MENU)>=0)
{
HTREEITEM item=TreeView_GetSelection(hWnd);
if (!item) return 0;
HTREEITEM child=TreeView_GetChild(hWnd,item);
TVITEM state={TVIF_STATE,item,0,TVIS_EXPANDED};
TreeView_GetItem(hWnd,&state);
if (wParam==VK_LEFT)
{
if (child && (state.state&TVIS_EXPANDED))
TreeView_Expand(hWnd,item,TVE_COLLAPSE);
else
{
HTREEITEM parent=TreeView_GetParent(hWnd,item);
if (parent) TreeView_SelectItem(hWnd,parent);
}
}
else if (child)
{
if (state.state&TVIS_EXPANDED)
TreeView_SelectItem(hWnd,child);
else
TreeView_Expand(hWnd,item,TVE_EXPAND);
}
return 0;
}
return DefSubclassProc(hWnd,uMsg,wParam,lParam); return DefSubclassProc(hWnd,uMsg,wParam,lParam);
} }
@@ -2735,16 +2497,6 @@ LRESULT CTreeSettingsDlg::OnInitDialog( UINT uMsg, WPARAM wParam, LPARAM lParam,
SetWindowTheme(m_Tree,L"Explorer",NULL); SetWindowTheme(m_Tree,L"Explorer",NULL);
} }
m_Tree.SendMessage(TVM_SETEXTENDEDSTYLE,TVS_EX_DOUBLEBUFFER,TVS_EX_DOUBLEBUFFER); m_Tree.SendMessage(TVM_SETEXTENDEDSTYLE,TVS_EX_DOUBLEBUFFER,TVS_EX_DOUBLEBUFFER);
EnableSettingsTreeAccessibility(m_Tree);
CString tip;
GetDlgItemText(IDC_STATICTIP,tip);
int line=tip.Find(L'\n');
if (line>=0)
{
tip=tip.Mid(line+1);
tip.Trim();
SetControlAccessibleName(GetDlgItem(IDC_STATICTIP),tip);
}
SetWindowSubclass(m_Tree,SubclassTreeProc,'CLSH',0); SetWindowSubclass(m_Tree,SubclassTreeProc,'CLSH',0);
HINSTANCE hInstance=_AtlBaseModule.GetResourceInstance(); HINSTANCE hInstance=_AtlBaseModule.GetResourceInstance();
@@ -3412,7 +3164,6 @@ void CTreeSettingsDlg::ItemSelected( HTREEITEM hItem, CSetting *pSetting, bool b
if (mode!=EDIT_NONE) if (mode!=EDIT_NONE)
{ {
CString str=LoadStringEx(pSetting->nameID); CString str=LoadStringEx(pSetting->nameID);
SetControlAccessibleName(m_EditBox,str);
TVITEM item={TVIF_TEXT,hItem,0,0,(LPWSTR)(LPCWSTR)str}; TVITEM item={TVIF_TEXT,hItem,0,0,(LPWSTR)(LPCWSTR)str};
TreeView_SetItem(m_Tree,&item); TreeView_SetItem(m_Tree,&item);
m_Tree.GetClientRect(&rc); m_Tree.GetClientRect(&rc);
@@ -3454,12 +3205,6 @@ void CTreeSettingsDlg::ItemSelected( HTREEITEM hItem, CSetting *pSetting, bool b
m_EditBox.SetWindowPos(NULL,&rc,SWP_NOZORDER|SWP_SHOWWINDOW); m_EditBox.SetWindowPos(NULL,&rc,SWP_NOZORDER|SWP_SHOWWINDOW);
SendMessage(WM_NEXTDLGCTL,(LPARAM)m_EditBox.m_hWnd,TRUE); SendMessage(WM_NEXTDLGCTL,(LPARAM)m_EditBox.m_hWnd,TRUE);
SetWindowSubclass(m_EditBox,SubclassEditProc,'CLSH',(mode==EDIT_HOTKEY)?1:((mode==EDIT_HOTKEY_ANY)?2:0)); SetWindowSubclass(m_EditBox,SubclassEditProc,'CLSH',(mode==EDIT_HOTKEY)?1:((mode==EDIT_HOTKEY_ANY)?2:0));
// The same overlay edit is reused while Up/Down moves through the
// tree. Its HWND and keyboard focus do not change, so explicitly
// announce that its accessible name has changed.
NotifyWinEvent(EVENT_OBJECT_NAMECHANGE,m_EditBox,OBJID_CLIENT,CHILDID_SELF);
if (::GetFocus()==m_EditBox)
NotifyWinEvent(EVENT_OBJECT_FOCUS,m_EditBox,OBJID_CLIENT,CHILDID_SELF);
} }
else else
m_EditBox.ShowWindow(SW_HIDE); m_EditBox.ShowWindow(SW_HIDE);
@@ -3603,14 +3348,11 @@ HTREEITEM CTreeSettingsDlg::FindSettingsItem( const wchar_t *name )
void CTreeSettingsDlg::SetGroup( CSetting *pGroup, const CString &filter, const CSetting *pSelect ) void CTreeSettingsDlg::SetGroup( CSetting *pGroup, const CString &filter, const CSetting *pSelect )
{ {
CString groupName=LoadStringEx(pGroup->nameID);
SetSettingsTreeAccessibleName(m_Tree,groupName);
ItemSelected(NULL,NULL,false); ItemSelected(NULL,NULL,false);
m_pGroup=pGroup; m_pGroup=pGroup;
// fill tree control // fill tree control
m_Tree.SendMessage(WM_SETREDRAW,FALSE); m_Tree.SendMessage(WM_SETREDRAW,FALSE);
TreeView_SelectItem(m_Tree,NULL); TreeView_SelectItem(m_Tree,NULL);
ClearSettingsTreeItemAccessibility(m_Tree);
TreeView_DeleteAllItems(m_Tree); TreeView_DeleteAllItems(m_Tree);
int level=0; int level=0;
HTREEITEM hRadioParent=NULL; HTREEITEM hRadioParent=NULL;
@@ -3787,14 +3529,9 @@ void CTreeSettingsDlg::UpdateGroup( const CSetting *pModified )
RECT rc; RECT rc;
TreeView_GetItemRect(m_Tree,hItem,&rc,FALSE); TreeView_GetItemRect(m_Tree,hItem,&rc,FALSE);
m_Tree.InvalidateRect(&rc); m_Tree.InvalidateRect(&rc);
NotifyWinEvent(EVENT_OBJECT_STATECHANGE,m_Tree,OBJID_CLIENT,TreeView_MapHTREEITEMToAccID(m_Tree,hItem));
} }
if (pSetting->type==CSetting::TYPE_BOOL)
SetSettingsTreeItemAccessibleRole(m_Tree,hItem,ROLE_SYSTEM_CHECKBUTTON);
// update radio buttons // update radio buttons
wchar_t selectedText[256];
selectedText[0]=0;
if (pSetting->type==CSetting::TYPE_INT && pSetting[1].type==CSetting::TYPE_RADIO) if (pSetting->type==CSetting::TYPE_INT && pSetting[1].type==CSetting::TYPE_RADIO)
{ {
int val=0; int val=0;
@@ -3824,37 +3561,9 @@ void CTreeSettingsDlg::UpdateGroup( const CSetting *pModified )
RECT rc; RECT rc;
TreeView_GetItemRect(m_Tree,hRadio,&rc,FALSE); TreeView_GetItemRect(m_Tree,hRadio,&rc,FALSE);
m_Tree.InvalidateRect(&rc); m_Tree.InvalidateRect(&rc);
NotifyWinEvent(EVENT_OBJECT_STATECHANGE,m_Tree,OBJID_CLIENT,TreeView_MapHTREEITEMToAccID(m_Tree,hRadio));
} }
SetSettingsTreeItemAccessibleRole(m_Tree,hRadio,ROLE_SYSTEM_RADIOBUTTON);
}
for (HTREEITEM hRadio=TreeView_GetChild(m_Tree,hItem);hRadio;hRadio=TreeView_GetNextSibling(m_Tree,hRadio))
{
TVITEM radioName={TVIF_IMAGE|TVIF_TEXT,hRadio,0,0,selectedText,_countof(selectedText)};
if (TreeView_GetItem(m_Tree,&radioName) && (radioName.iImage&SETTING_STATE_CHECKED)) break;
selectedText[0]=0;
} }
} }
// Bold is the visual indication that a setting differs from its
// default. Expose the same information in the accessible name.
wchar_t parentText[256];
TVITEM parentName={TVIF_TEXT,hItem,0,0,parentText,_countof(parentText)};
TreeView_GetItem(m_Tree,&parentName);
CString accessibleName=parentText;
if (selectedText[0])
{
accessibleName+=L": ";
accessibleName+=selectedText;
}
if (!bDefault)
{
accessibleName+=L", ";
accessibleName+=LoadStringEx(IDS_SETTING_MODIFIED);
}
SetSettingsTreeItemAccessibleName(m_Tree,hItem,accessibleName);
if (pSetting==pModified)
NotifyWinEvent(EVENT_OBJECT_NAMECHANGE,m_Tree,OBJID_CLIENT,TreeView_MapHTREEITEMToAccID(m_Tree,hItem));
} }
} }
@@ -3921,49 +3630,3 @@ DWORD ParseColor(const wchar_t* str)
wchar_t* end; wchar_t* end;
return wcstoul(str, &end, 16) & 0xFFFFFF; return wcstoul(str, &end, 16) & 0xFFFFFF;
} }
// Run GetOpenFileName/GetSaveFileName on a separate STA thread and pump messages on the caller
template <typename auto Fnc>
static BOOL GetFileNameSafe(OPENFILENAME* pOfn)
{
BOOL result = FALSE;
std::thread worker([&pOfn, &result]() mutable {
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
result = Fnc(pOfn);
CoUninitialize();
});
// Pump messages while waiting for the worker (dialog) to finish
while (true)
{
HANDLE hWorker = worker.native_handle();
if (MsgWaitForMultipleObjects(1, &hWorker, FALSE, INFINITE, QS_ALLINPUT) == WAIT_OBJECT_0)
break;
MSG msg;
while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{
if (msg.message == WM_QUIT)
{
PostQuitMessage((int)msg.wParam);
break;
}
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
worker.join();
return result;
}
BOOL GetOpenFileNameSafe(OPENFILENAME* pOfn)
{
return GetFileNameSafe<GetOpenFileNameW>(pOfn);
}
BOOL GetSaveFileNameSafe(OPENFILENAME* pOfn)
{
return GetFileNameSafe<GetSaveFileNameW>(pOfn);
}
-14
View File
@@ -14,16 +14,6 @@ class CSettingsTree;
class ISettingsPanel; class ISettingsPanel;
struct CSetting; struct CSetting;
// Adds the checked/unchecked and unavailable states used by the settings
// trees to their MSAA/UIA representation. The visual state remains provided
// by Open-Shell's existing image list.
void EnableSettingsTreeAccessibility( HWND tree );
void ClearSettingsTreeItemAccessibility( HWND tree );
void SetControlAccessibleName( HWND control, const wchar_t *name );
void SetSettingsTreeAccessibleName( HWND tree, const wchar_t *name );
void SetSettingsTreeItemAccessibleName( HWND tree, HTREEITEM item, const wchar_t *name );
void SetSettingsTreeItemAccessibleRole( HWND tree, HTREEITEM item, LONG role );
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// CResizeableDlg - a dialog that rearranges its controls when it gets resized // CResizeableDlg - a dialog that rearranges its controls when it gets resized
@@ -405,7 +395,3 @@ DWORD BgrToRgb(DWORD val);
// parse color from hexadecimal string // parse color from hexadecimal string
DWORD ParseColor(const wchar_t* str); DWORD ParseColor(const wchar_t* str);
// safe versions of GetOpenFileName/GetSaveFileName (run API on a separate STA thread and pump messages on the caller)
BOOL GetOpenFileNameSafe(OPENFILENAME* pOfn);
BOOL GetSaveFileNameSafe(OPENFILENAME* pOfn);
-2
View File
@@ -139,8 +139,6 @@
#define IDS_BMP_FILTERS2 4077 #define IDS_BMP_FILTERS2 4077
#define IDS_UNSAVED_CHANGES 4078 #define IDS_UNSAVED_CHANGES 4078
#define IDS_UNSAVED_TITLE 4079 #define IDS_UNSAVED_TITLE 4079
#define IDS_SETTINGS_PAGES 4080
#define IDS_SETTING_MODIFIED 4081
// Next default values for new objects // Next default values for new objects
// //
+1 -1
View File
@@ -31,7 +31,7 @@
<String Id="Advanced_Font_Bigger_Size" Overridable="yes">12</String> <String Id="Advanced_Font_Bigger_Size" Overridable="yes">12</String>
<String Id="Advanced_Font_Title_Size" Overridable="yes">9</String> <String Id="Advanced_Font_Title_Size" Overridable="yes">9</String>
<String Id="Advanced_Font_Emphasized_Size" Overridable="yes">8</String> <String Id="Advanced_Font_Emphasized_Size" Overridable="yes">8</String>
<String Id="Advanced_Font_FaceName" Overridable="yes">"MS UI Gothic", "MS PGothic", "MS Pゴシック", "MS Gothic", "MS ゴシック", Yu Gothic UI, Tahoma</String> <String Id="Advanced_Font_FaceName" Overridable="yes">"MS UI Gothic", "MS PGothic", "MS Pゴシック", "MS Gothic", "MS ゴシック", Osaka, Tahoma</String>
<String Id="BrowseDlg_Title" Overridable="yes">[ProductName] セットアップ</String> <String Id="BrowseDlg_Title" Overridable="yes">[ProductName] セットアップ</String>
<String Id="BrowseDlgComboLabel" Overridable="yes">場所(&amp;L):</String> <String Id="BrowseDlgComboLabel" Overridable="yes">場所(&amp;L):</String>
+1 -143
View File
@@ -1,145 +1,5 @@
@echo off
set PATH=C:\Program Files\7-Zip\;%PATH%
cd %~dp0
call _Version.bat
REM ********* Build MSI Checksums
echo --- MSI Checksums
..\..\build\bin\Release\Utility.exe crcmsi Temp
@if ERRORLEVEL 1 exit /b 1
REM ********* Build bootstrapper
echo --- Bootstrapper
for /f "usebackq tokens=*" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -requires Microsoft.Component.MSBuild -property installationPath`) do set MSBuildDir=%%i\MSBuild\Current\Bin\
"%MSBuildDir%MSBuild.exe" Setup.sln /m /t:Rebuild /p:Configuration="Release" /p:Platform="Win32" /verbosity:quiet /nologo
@if ERRORLEVEL 1 exit /b 1
if exist Final rd /Q /S Final
md Final
copy /B ..\..\build\bin\Release\Setup.exe Final\OpenShellSetup_%CS_VERSION_STR%.exe > nul
if defined APPVEYOR (
appveyor PushArtifact Final\OpenShellSetup_%CS_VERSION_STR%.exe
)
REM ***** Collect PDBs REM ***** Collect PDBs
REM ********* Collect debug info
md Output\PDB32
md Output\PDB64
md Output\PDBARM64
REM Explorer 32
copy /B ..\..\build\bin\Setup\ClassicExplorer32.pdb Output\PDB32 > nul
copy /B Output\ClassicExplorer32.dll Output\PDB32 > nul
copy /B ..\..\build\bin\Setup\ClassicExplorerSettings.pdb Output\PDB32 > nul
copy /B Output\ClassicExplorerSettings.exe Output\PDB32 > nul
REM Explorer 64
copy /B ..\..\build\bin\Setup64\ClassicExplorer64.pdb Output\PDB64 > nul
copy /B Output\x64\ClassicExplorer64.dll Output\PDB64 > nul
REM Explorer ARM64
copy /B ..\..\build\bin\SetupARM64\ClassicExplorer64.pdb Output\PDBARM64 > nul
copy /B Output\ARM64\ClassicExplorer64.dll Output\PDBARM64 > nul
REM IE 32
copy /B ..\..\build\bin\Setup\ClassicIEDLL_32.pdb Output\PDB32 > nul
copy /B Output\ClassicIEDLL_32.dll Output\PDB32 > nul
copy /B ..\..\build\bin\Setup\ClassicIE_32.pdb Output\PDB32 > nul
copy /B Output\ClassicIE_32.exe Output\PDB32 > nul
REM IE 64
copy /B ..\..\build\bin\Setup64\ClassicIEDLL_64.pdb Output\PDB64 > nul
copy /B Output\x64\ClassicIEDLL_64.dll Output\PDB64 > nul
copy /B ..\..\build\bin\Setup64\ClassicIE_64.pdb Output\PDB64 > nul
copy /B Output\x64\ClassicIE_64.exe Output\PDB64 > nul
REM IE ARM64
copy /B ..\..\build\bin\SetupARM64\ClassicIEDLL_64.pdb Output\PDBARM64 > nul
copy /B Output\ARM64\ClassicIEDLL_64.dll Output\PDBARM64 > nul
copy /B ..\..\build\bin\SetupARM64\ClassicIE_64.pdb Output\PDBARM64 > nul
copy /B Output\ARM64\ClassicIE_64.exe Output\PDBARM64 > nul
REM Menu 32
copy /B ..\..\build\bin\Setup\StartMenu.pdb Output\PDB32 > nul
copy /B Output\StartMenu.exe Output\PDB32 > nul
copy /B ..\..\build\bin\Setup\StartMenuDLL.pdb Output\PDB32 > nul
copy /B Output\StartMenuDLL.dll Output\PDB32 > nul
copy /B ..\..\build\bin\Setup\StartMenuHelper32.pdb Output\PDB32 > nul
copy /B Output\StartMenuHelper32.dll Output\PDB32 > nul
copy /B ..\..\build\bin\Release\Update.pdb Output\PDB32 > nul
copy /B Output\Update.exe Output\PDB32 > nul
copy /B ..\..\build\bin\Release\DesktopToasts.pdb Output\PDB32 > nul
copy /B Output\DesktopToasts.dll Output\PDB32 > nul
REM Menu 64
copy /B ..\..\build\bin\Setup64\StartMenu.pdb Output\PDB64 > nul
copy /B Output\x64\StartMenu.exe Output\PDB64 > nul
copy /B ..\..\build\bin\Setup64\StartMenuDLL.pdb Output\PDB64 > nul
copy /B Output\x64\StartMenuDLL.dll Output\PDB64 > nul
copy /B ..\..\build\bin\Setup64\StartMenuHelper64.pdb Output\PDB64 > nul
copy /B Output\x64\StartMenuHelper64.dll Output\PDB64 > nul
REM Menu ARM64
copy /B ..\..\build\bin\SetupARM64\StartMenu.pdb Output\PDBARM64 > nul
copy /B Output\ARM64\StartMenu.exe Output\PDBARM64 > nul
copy /B ..\..\build\bin\SetupARM64\StartMenuDLL.pdb Output\PDBARM64 > nul
copy /B Output\ARM64\StartMenuDLL.dll Output\PDBARM64 > nul
copy /B ..\..\build\bin\SetupARM64\StartMenuHelper64.pdb Output\PDBARM64 > nul
copy /B Output\ARM64\StartMenuHelper64.dll Output\PDBARM64 > nul
REM ********* Source Index PDBs
set PDBSTR_PATH="C:\Program Files (x86)\Windows Kits\10\Debuggers\x86\srcsrv\pdbstr.exe"
if exist %PDBSTR_PATH% (
echo --- Adding source index to PDBs
call CreateSourceIndex.bat ..\.. > Output\pdbstr.txt
for %%f in (Output\PDB32\*.pdb) do (
%PDBSTR_PATH% -w -p:%%f -s:srcsrv -i:Output\pdbstr.txt
if not ERRORLEVEL 0 (
echo Error adding source index to PDB
exit /b 1
)
)
for %%f in (Output\PDB64\*.pdb) do (
%PDBSTR_PATH% -w -p:%%f -s:srcsrv -i:Output\pdbstr.txt
if not ERRORLEVEL 0 (
echo Error adding source index to PDB
exit /b 1
)
)
for %%f in (Output\PDBARM64\*.pdb) do (
%PDBSTR_PATH% -w -p:%%f -s:srcsrv -i:Output\pdbstr.txt
if not ERRORLEVEL 0 (
echo Error adding source index to PDB
exit /b 1
)
)
)
REM ********* Prepare symbols
set SYMSTORE_PATH="C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\symstore.exe"
%SYMSTORE_PATH% add /r /f Output\PDB32 /s Output\symbols /t OpenShell -:NOREFS > nul
%SYMSTORE_PATH% add /r /f Output\PDB64 /s Output\symbols /t OpenShell -:NOREFS > nul
%SYMSTORE_PATH% add /r /f Output\PDBARM64 /s Output\symbols /t OpenShell -:NOREFS > nul
rd /Q /S Output\symbols\000Admin > nul
del Output\symbols\pingme.txt > nul
rd /Q /S Output\PDB32
rd /Q /S Output\PDB64
rd /Q /S Output\PDBARM64
echo -- Creating symbols package echo -- Creating symbols package
set CS_SYMBOLS_NAME=OpenShellSymbols_%CS_VERSION_STR%.7z set CS_SYMBOLS_NAME=OpenShellSymbols_%CS_VERSION_STR%.7z
@@ -160,10 +20,8 @@ cd ..
cd Setup cd Setup
copy /B Output\Utility.exe .\Final > nul
if defined APPVEYOR ( if defined APPVEYOR (
appveyor PushArtifact Output\Utility.exe appveyor PushArtifact ..\..\build\bin\Release\Utility.exe
) )
exit /b 0 exit /b 0
+114 -7
View File
@@ -1,8 +1,3 @@
@echo off
cd %~dp0
call _Version.bat
if exist Output rd /Q /S Output if exist Output rd /Q /S Output
md Output md Output
md Output\x64 md Output\x64
@@ -55,7 +50,6 @@ copy /B ..\..\build\bin\Setup\StartMenuHelper32.dll Output > nul
copy /B ..\..\build\bin\Release\Update.exe Output > nul copy /B ..\..\build\bin\Release\Update.exe Output > nul
copy /B ..\..\build\bin\Release\DesktopToasts.dll Output > nul copy /B ..\..\build\bin\Release\DesktopToasts.dll Output > nul
copy /B ..\..\build\bin\Release\SetupHelper.exe Output > nul copy /B ..\..\build\bin\Release\SetupHelper.exe Output > nul
copy /B ..\..\build\bin\Release\Utility.exe Output > nul
copy /B ..\..\build\bin\SetupARM64\ClassicExplorer64.dll Output\ARM64 > nul copy /B ..\..\build\bin\SetupARM64\ClassicExplorer64.dll Output\ARM64 > nul
copy /B ..\..\build\bin\SetupARM64\ClassicIEDLL_64.dll Output\ARM64 > nul copy /B ..\..\build\bin\SetupARM64\ClassicIEDLL_64.dll Output\ARM64 > nul
@@ -88,6 +82,119 @@ copy /B "..\..\build\bin\Skins\Metallic.skin7" Output > nul
copy /B "..\..\build\bin\Skins\Immersive.skin" Output > nul copy /B "..\..\build\bin\Skins\Immersive.skin" Output > nul
copy /B "..\..\build\bin\Skins\Immersive.skin7" Output > nul copy /B "..\..\build\bin\Skins\Immersive.skin7" Output > nul
REM ********* Collect debug info
md Output\PDB32
md Output\PDB64
md Output\PDBARM64
REM Explorer 32
copy /B ..\..\build\bin\Setup\ClassicExplorer32.pdb Output\PDB32 > nul
copy /B Output\ClassicExplorer32.dll Output\PDB32 > nul
copy /B ..\..\build\bin\Setup\ClassicExplorerSettings.pdb Output\PDB32 > nul
copy /B Output\ClassicExplorerSettings.exe Output\PDB32 > nul
REM Explorer 64
copy /B ..\..\build\bin\Setup64\ClassicExplorer64.pdb Output\PDB64 > nul
copy /B Output\x64\ClassicExplorer64.dll Output\PDB64 > nul
REM Explorer ARM64
copy /B ..\..\build\bin\SetupARM64\ClassicExplorer64.pdb Output\PDBARM64 > nul
copy /B Output\ARM64\ClassicExplorer64.dll Output\PDBARM64 > nul
REM IE 32
copy /B ..\..\build\bin\Setup\ClassicIEDLL_32.pdb Output\PDB32 > nul
copy /B Output\ClassicIEDLL_32.dll Output\PDB32 > nul
copy /B ..\..\build\bin\Setup\ClassicIE_32.pdb Output\PDB32 > nul
copy /B Output\ClassicIE_32.exe Output\PDB32 > nul
REM IE 64
copy /B ..\..\build\bin\Setup64\ClassicIEDLL_64.pdb Output\PDB64 > nul
copy /B Output\x64\ClassicIEDLL_64.dll Output\PDB64 > nul
copy /B ..\..\build\bin\Setup64\ClassicIE_64.pdb Output\PDB64 > nul
copy /B Output\x64\ClassicIE_64.exe Output\PDB64 > nul
REM IE ARM64
copy /B ..\..\build\bin\SetupARM64\ClassicIEDLL_64.pdb Output\PDBARM64 > nul
copy /B Output\ARM64\ClassicIEDLL_64.dll Output\PDBARM64 > nul
copy /B ..\..\build\bin\SetupARM64\ClassicIE_64.pdb Output\PDBARM64 > nul
copy /B Output\ARM64\ClassicIE_64.exe Output\PDBARM64 > nul
REM Menu 32
copy /B ..\..\build\bin\Setup\StartMenu.pdb Output\PDB32 > nul
copy /B Output\StartMenu.exe Output\PDB32 > nul
copy /B ..\..\build\bin\Setup\StartMenuDLL.pdb Output\PDB32 > nul
copy /B Output\StartMenuDLL.dll Output\PDB32 > nul
copy /B ..\..\build\bin\Setup\StartMenuHelper32.pdb Output\PDB32 > nul
copy /B Output\StartMenuHelper32.dll Output\PDB32 > nul
copy /B ..\..\build\bin\Release\Update.pdb Output\PDB32 > nul
copy /B Output\Update.exe Output\PDB32 > nul
copy /B ..\..\build\bin\Release\DesktopToasts.pdb Output\PDB32 > nul
copy /B Output\DesktopToasts.dll Output\PDB32 > nul
REM Menu 64
copy /B ..\..\build\bin\Setup64\StartMenu.pdb Output\PDB64 > nul
copy /B Output\x64\StartMenu.exe Output\PDB64 > nul
copy /B ..\..\build\bin\Setup64\StartMenuDLL.pdb Output\PDB64 > nul
copy /B Output\x64\StartMenuDLL.dll Output\PDB64 > nul
copy /B ..\..\build\bin\Setup64\StartMenuHelper64.pdb Output\PDB64 > nul
copy /B Output\x64\StartMenuHelper64.dll Output\PDB64 > nul
REM Menu ARM64
copy /B ..\..\build\bin\SetupARM64\StartMenu.pdb Output\PDBARM64 > nul
copy /B Output\ARM64\StartMenu.exe Output\PDBARM64 > nul
copy /B ..\..\build\bin\SetupARM64\StartMenuDLL.pdb Output\PDBARM64 > nul
copy /B Output\ARM64\StartMenuDLL.dll Output\PDBARM64 > nul
copy /B ..\..\build\bin\SetupARM64\StartMenuHelper64.pdb Output\PDBARM64 > nul
copy /B Output\ARM64\StartMenuHelper64.dll Output\PDBARM64 > nul
REM ********* Source Index PDBs
set PDBSTR_PATH="C:\Program Files (x86)\Windows Kits\10\Debuggers\x86\srcsrv\pdbstr.exe"
if exist %PDBSTR_PATH% (
echo --- Adding source index to PDBs
call CreateSourceIndex.bat ..\.. > Output\pdbstr.txt
for %%f in (Output\PDB32\*.pdb) do (
%PDBSTR_PATH% -w -p:%%f -s:srcsrv -i:Output\pdbstr.txt
if not ERRORLEVEL 0 (
echo Error adding source index to PDB
exit /b 1
)
)
for %%f in (Output\PDB64\*.pdb) do (
%PDBSTR_PATH% -w -p:%%f -s:srcsrv -i:Output\pdbstr.txt
if not ERRORLEVEL 0 (
echo Error adding source index to PDB
exit /b 1
)
)
for %%f in (Output\PDBARM64\*.pdb) do (
%PDBSTR_PATH% -w -p:%%f -s:srcsrv -i:Output\pdbstr.txt
if not ERRORLEVEL 0 (
echo Error adding source index to PDB
exit /b 1
)
)
)
REM ********* Prepare symbols
set SYMSTORE_PATH="C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\symstore.exe"
%SYMSTORE_PATH% add /r /f Output\PDB32 /s Output\symbols /t OpenShell -:NOREFS > nul
%SYMSTORE_PATH% add /r /f Output\PDB64 /s Output\symbols /t OpenShell -:NOREFS > nul
%SYMSTORE_PATH% add /r /f Output\PDBARM64 /s Output\symbols /t OpenShell -:NOREFS > nul
rd /Q /S Output\symbols\000Admin > nul
del Output\symbols\pingme.txt > nul
rd /Q /S Output\PDB32
rd /Q /S Output\PDB64
rd /Q /S Output\PDBARM64
REM ********* Build ADMX REM ********* Build ADMX
echo --- ADMX echo --- ADMX
if exist Output\PolicyDefinitions.zip ( if exist Output\PolicyDefinitions.zip (
@@ -102,7 +209,7 @@ cd ..\Localization\English
@if ERRORLEVEL 1 exit /b 1 @if ERRORLEVEL 1 exit /b 1
md en-US md en-US
copy /B *.adml en-US > nul copy /B *.adml en-US > nul
tar -a -c -f ..\..\Setup\Output\PolicyDefinitions.zip *.admx en-US\*.adml PolicyDefinitions.rtf 7z a ..\..\Setup\Output\PolicyDefinitions.zip *.admx en-US\*.adml PolicyDefinitions.rtf > nul
rd /Q /S en-US rd /Q /S en-US
cd ..\..\Setup cd ..\..\Setup
+24 -6
View File
@@ -1,9 +1,3 @@
@echo off
set PATH=C:\Program Files (x86)\HTML Help Workshop;C:\Program Files (x86)\WiX Toolset v3.14\bin\;%PATH%
cd %~dp0
call _Version.bat
REM ********* Build Help REM ********* Build Help
echo -- Building Installer (%CS_LANG_NAME_SHORT%) echo -- Building Installer (%CS_LANG_NAME_SHORT%)
@setlocal EnableDelayedExpansion @setlocal EnableDelayedExpansion
@@ -28,6 +22,9 @@ echo -- Building Installer (%CS_LANG_NAME_SHORT%)
@if _%CS_LANG_NAME%==_ echo Unrecognized language '%CS_LANG_FOLDER%' @if _%CS_LANG_NAME%==_ echo Unrecognized language '%CS_LANG_FOLDER%'
@if _%CS_LANG_NAME%==_ exit /b 1 @if _%CS_LANG_NAME%==_ exit /b 1
SET CS_INSTALLER_NAME=OpenShellSetup_%CS_VERSION_STR%-%CS_LANG_NAME_SHORT%
if %CS_LANG_NAME_SHORT%==en SET CS_INSTALLER_NAME=OpenShellSetup_%CS_VERSION_STR%
if exist Temp rd /Q /S Temp if exist Temp rd /Q /S Temp
md Temp md Temp
@@ -69,6 +66,27 @@ candle Setup.wxs -nologo -out Temp\SetupARM64.wixobj -ext WixUIExtension -ext Wi
light Temp\SetupARM64.wixobj -nologo -out Temp\SetupARM64.msi -ext WixUIExtension -ext WixUtilExtension -loc ..\Localization\%CS_LANG_FOLDER%\OpenShellText-%CS_LANG_NAME%.wxl -loc ..\Localization\%CS_LANG_FOLDER%\WixUI_%CS_LANG_NAME%.wxl -sice:ICE38 -sice:ICE43 -sice:ICE09 light Temp\SetupARM64.wixobj -nologo -out Temp\SetupARM64.msi -ext WixUIExtension -ext WixUtilExtension -loc ..\Localization\%CS_LANG_FOLDER%\OpenShellText-%CS_LANG_NAME%.wxl -loc ..\Localization\%CS_LANG_FOLDER%\WixUI_%CS_LANG_NAME%.wxl -sice:ICE38 -sice:ICE43 -sice:ICE09
@if ERRORLEVEL 1 exit /b 1 @if ERRORLEVEL 1 exit /b 1
REM ********* Build MSI Checksums
echo --- MSI Checksums
..\..\build\bin\Release\Utility.exe crcmsi Temp
@if ERRORLEVEL 1 exit /b 1
REM ********* Build bootstrapper
echo --- Bootstrapper
for /f "usebackq tokens=*" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -requires Microsoft.Component.MSBuild -property installationPath`) do set MSBuildDir=%%i\MSBuild\Current\Bin\
"%MSBuildDir%MSBuild.exe" Setup.sln /m /t:Rebuild /p:Configuration="Release" /p:Platform="Win32" /verbosity:quiet /nologo
@if ERRORLEVEL 1 exit /b 1
if exist Final rd /Q /S Final
md Final
copy /B ..\..\build\bin\Release\Setup.exe Final\%CS_INSTALLER_NAME%.exe > nul
if defined APPVEYOR (
appveyor PushArtifact Final\%CS_INSTALLER_NAME%.exe
)
SET CS_LANG_FOLDER= SET CS_LANG_FOLDER=
SET CS_LANG_NAME= SET CS_LANG_NAME=
SET CS_LANG_NAME_SHORT= SET CS_LANG_NAME_SHORT=
+2 -2
View File
@@ -12,8 +12,8 @@ set SRC_ROOT=%~fdp1
rem get repo url rem get repo url
for /f %%A in ('git remote get-url origin') do set REPO_URL=%%A for /f %%A in ('git remote get-url origin') do set REPO_URL=%%A
rem remove eventual .git from the end rem remove .git from the end
if /I "%REPO_URL:~-4%"==".git" set "REPO_URL=%REPO_URL:~0,-4%" set REPO_URL=%REPO_URL:~0,-4%
rem get actual commit id rem get actual commit id
for /f %%A in ('git rev-parse HEAD') do set COMMIT=%%A for /f %%A in ('git rev-parse HEAD') do set COMMIT=%%A
-74
View File
@@ -47,69 +47,6 @@ struct Chunk
int start1, start2, len; int start1, start2, len;
}; };
static bool IsExplorerShellRunning( void )
{
HWND shellWindow=GetShellWindow();
if (!shellWindow)
return false;
DWORD shellProcessId=0;
GetWindowThreadProcessId(shellWindow,&shellProcessId);
if (!shellProcessId)
return false;
DWORD currentSession=0;
DWORD shellSession=0;
if (!ProcessIdToSessionId(GetCurrentProcessId(),&currentSession) ||
!ProcessIdToSessionId(shellProcessId,&shellSession) ||
currentSession!=shellSession)
{
return false;
}
HANDLE process=OpenProcess(PROCESS_QUERY_LIMITED_INFORMATION,FALSE,shellProcessId);
if (!process)
return false;
wchar_t path[_MAX_PATH];
DWORD pathSize=_countof(path);
bool isExplorer=false;
if (QueryFullProcessImageName(process,0,path,&pathSize))
isExplorer=_wcsicmp(PathFindFileName(path),L"explorer.exe")==0;
CloseHandle(process);
return isExplorer;
}
static void RestoreExplorerShellIfNeeded( bool wasRunning )
{
if (!wasRunning)
return;
// Restart Manager normally brings Explorer back before msiexec exits.
// Give it a short grace period before applying our fallback so we don't
// race a normal restart or create an extra Explorer process.
for (int i=0;i<50;i++)
{
if (IsExplorerShellRunning())
return;
Sleep(100);
}
wchar_t explorerPath[_MAX_PATH];
UINT len=GetWindowsDirectory(explorerPath,_countof(explorerPath));
if (!len || len>=_countof(explorerPath) || !PathAppend(explorerPath,L"explorer.exe"))
return;
STARTUPINFO startupInfo={sizeof(startupInfo)};
PROCESS_INFORMATION processInfo={};
if (CreateProcess(explorerPath,NULL,NULL,NULL,FALSE,0,NULL,NULL,&startupInfo,&processInfo))
{
CloseHandle(processInfo.hThread);
CloseHandle(processInfo.hProcess);
}
}
static void WriteFileXOR( HANDLE hFile, const unsigned char *buf, int size ) static void WriteFileXOR( HANDLE hFile, const unsigned char *buf, int size )
{ {
if (size>0) if (size>0)
@@ -472,11 +409,6 @@ int APIENTRY wWinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCm
if (extractType == ARM64) if (extractType == ARM64)
Wow64DisableWow64FsRedirection(&wow64FsRedirVal); Wow64DisableWow64FsRedirection(&wow64FsRedirVal);
// Remember whether this interactive session had the Explorer desktop shell.
// If Restart Manager closes it during MSI processing but fails to bring it
// back, restore only the shell that was present before setup started.
const bool explorerWasRunning=IsExplorerShellRunning();
// start the installer // start the installer
STARTUPINFO startupInfo={sizeof(startupInfo)}; STARTUPINFO startupInfo={sizeof(startupInfo)};
PROCESS_INFORMATION processInfo; PROCESS_INFORMATION processInfo;
@@ -506,12 +438,6 @@ int APIENTRY wWinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCm
GetExitCodeProcess(processInfo.hProcess,&code); GetExitCodeProcess(processInfo.hProcess,&code);
CloseHandle(processInfo.hProcess); CloseHandle(processInfo.hProcess);
DeleteFile(msiName); DeleteFile(msiName);
// Only repair the shell after a successful transaction. Reboot-required
// outcomes deliberately keep Windows Installer in control of recovery.
if (code==ERROR_SUCCESS)
RestoreExplorerShellIfNeeded(explorerWasRunning);
return code; return code;
} }
} }
+1 -1
View File
@@ -19,7 +19,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration"> <PropertyGroup Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v143</PlatformToolset> <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization Condition="'$(Configuration)'!='Debug'">true</WholeProgramOptimization> <WholeProgramOptimization Condition="'$(Configuration)'!='Debug'">true</WholeProgramOptimization>
</PropertyGroup> </PropertyGroup>
+1 -1
View File
@@ -19,7 +19,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration"> <PropertyGroup Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v143</PlatformToolset> <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization Condition="'$(Configuration)'!='Debug'">true</WholeProgramOptimization> <WholeProgramOptimization Condition="'$(Configuration)'!='Debug'">true</WholeProgramOptimization>
</PropertyGroup> </PropertyGroup>
+6 -6
View File
@@ -30,17 +30,17 @@
#ifdef SAFE_MODE #ifdef SAFE_MODE
#define RegDeleteTree2(x,y) 5 #define RegDeleteTree2(x,y) 5
#define RegDeleteValue2(x,y) 5 #define RegDeleteValue2(x,y) 5
#define DeleteFile3(x) (SetLastError(3), FALSE) #define DeleteFile2(x) (SetLastError(3), FALSE)
#define MoveFileEx2(x,y,z) (SetLastError(5), FALSE) #define MoveFileEx2(x,y,z) (SetLastError(5), FALSE)
#define SHFileOperation2(x) 0x78 #define SHFileOperation2(x) 0x78
#define RemoveDirectory3(x) FALSE #define RemoveDirectory2(x) FALSE
#else #else
#define RegDeleteTree2(x,y) RegDeleteTree(x,y) #define RegDeleteTree2(x,y) RegDeleteTree(x,y)
#define RegDeleteValue2(x,y) RegDeleteValue(x,y) #define RegDeleteValue2(x,y) RegDeleteValue(x,y)
#define DeleteFile3(x) DeleteFile(x) #define DeleteFile2(x) DeleteFile(x)
#define MoveFileEx2(x,y,z) MoveFileEx(x,y,z) #define MoveFileEx2(x,y,z) MoveFileEx(x,y,z)
#define SHFileOperation2(x) SHFileOperation(x) #define SHFileOperation2(x) SHFileOperation(x)
#define RemoveDirectory3(x) RemoveDirectory(x) #define RemoveDirectory2(x) RemoveDirectory(x)
#endif #endif
// files to delete from the Open-Shell folder // files to delete from the Open-Shell folder
@@ -777,7 +777,7 @@ static bool DeleteFileEx( const wchar_t *fname, bool bAllowDelay )
if (attribs&FILE_ATTRIBUTE_READONLY) if (attribs&FILE_ATTRIBUTE_READONLY)
SetFileAttributes(fname,attribs&~FILE_ATTRIBUTE_READONLY); SetFileAttributes(fname,attribs&~FILE_ATTRIBUTE_READONLY);
LogMessage(-1,L"Deleting file %s",fname); LogMessage(-1,L"Deleting file %s",fname);
if (!DeleteFile3(fname)) if (!DeleteFile2(fname))
{ {
int error=GetLastError(); int error=GetLastError();
if (error==ERROR_ACCESS_DENIED && bAllowDelay) if (error==ERROR_ACCESS_DENIED && bAllowDelay)
@@ -826,7 +826,7 @@ static void DeleteDirectoryEx( const wchar_t *path, bool bDelay )
else else
{ {
LogMessage(-1,L"Deleting directory %s",path); LogMessage(-1,L"Deleting directory %s",path);
if (!RemoveDirectory3(path)) if (!RemoveDirectory2(path))
{ {
int error=GetLastError(); int error=GetLastError();
bool bOldHasErrors=g_bHasErrors; bool bOldHasErrors=g_bHasErrors;
+1 -1
View File
@@ -35,7 +35,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration"> <PropertyGroup Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v143</PlatformToolset> <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<UseOfAtl>Static</UseOfAtl> <UseOfAtl>Static</UseOfAtl>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization Condition="'$(Configuration)'!='Debug'">true</WholeProgramOptimization> <WholeProgramOptimization Condition="'$(Configuration)'!='Debug'">true</WholeProgramOptimization>
-3
View File
@@ -1,6 +1,3 @@
@echo off
cd %~dp0
SET CS_LANG_FOLDER=English SET CS_LANG_FOLDER=English
SET CS_LANG_NAME=en-US SET CS_LANG_NAME=en-US
SET CS_LANG_NAME_SHORT=en SET CS_LANG_NAME_SHORT=en
-9
View File
@@ -1,9 +0,0 @@
@echo off
rem Convert . to _
set CS_VERSION_STR=%CS_VERSION:.=_%
set CS_VERSION_ORIG=%CS_VERSION%
rem Strip optional "-xyz" suffix from version
for /f "delims=- tokens=1,1" %%i in ("%CS_VERSION%") do set CS_VERSION=%%i
+1 -1
View File
@@ -15,7 +15,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration"> <PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType> <ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v143</PlatformToolset> <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+1 -1
View File
@@ -15,7 +15,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration"> <PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType> <ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v143</PlatformToolset> <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+1 -1
View File
@@ -15,7 +15,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration"> <PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType> <ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v143</PlatformToolset> <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+1 -1
View File
@@ -15,7 +15,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration"> <PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType> <ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v143</PlatformToolset> <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+1 -1
View File
@@ -15,7 +15,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration"> <PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType> <ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v143</PlatformToolset> <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+1 -1
View File
@@ -15,7 +15,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration"> <PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType> <ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v143</PlatformToolset> <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+1 -1
View File
@@ -15,7 +15,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration"> <PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType> <ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v143</PlatformToolset> <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+1 -1
View File
@@ -15,7 +15,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration"> <PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType> <ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v143</PlatformToolset> <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+1 -1
View File
@@ -15,7 +15,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration"> <PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType> <ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v143</PlatformToolset> <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+1 -1
View File
@@ -15,7 +15,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration"> <PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType> <ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v143</PlatformToolset> <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+1 -1
View File
@@ -15,7 +15,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration"> <PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType> <ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v143</PlatformToolset> <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+1 -1
View File
@@ -15,7 +15,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration"> <PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType> <ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v143</PlatformToolset> <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+1 -1
View File
@@ -15,7 +15,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration"> <PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType> <ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v143</PlatformToolset> <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+1 -1
View File
@@ -15,7 +15,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration"> <PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType> <ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v143</PlatformToolset> <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+1 -1
View File
@@ -15,7 +15,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration"> <PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType> <ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v143</PlatformToolset> <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+1 -1
View File
@@ -15,7 +15,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration"> <PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType> <ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v143</PlatformToolset> <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+1 -1
View File
@@ -15,7 +15,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration"> <PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType> <ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v143</PlatformToolset> <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+1 -1
View File
@@ -47,7 +47,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration"> <PropertyGroup Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v143</PlatformToolset> <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<UseOfAtl>Static</UseOfAtl> <UseOfAtl>Static</UseOfAtl>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization Condition="'$(Configuration)'!='Debug'">true</WholeProgramOptimization> <WholeProgramOptimization Condition="'$(Configuration)'!='Debug'">true</WholeProgramOptimization>
+2 -17
View File
@@ -53,14 +53,7 @@ HRESULT STDMETHODCALLTYPE CMenuAccessible::get_accName( VARIANT varChild, BSTR *
if (!m_pOwner) return RPC_E_DISCONNECTED; if (!m_pOwner) return RPC_E_DISCONNECTED;
*pszName=NULL; *pszName=NULL;
if (varChild.vt!=VT_I4) return S_FALSE; if (varChild.vt!=VT_I4) return S_FALSE;
if (varChild.lVal==CHILDID_SELF) if (varChild.lVal==CHILDID_SELF) return S_FALSE;
{
if (m_pOwner->m_pParent && m_pOwner->m_ParentIndex>=0 && m_pOwner->m_ParentIndex<(int)m_pOwner->m_pParent->m_Items.size())
*pszName=SysAllocString(m_pOwner->m_pParent->m_Items[m_pOwner->m_ParentIndex].name);
else
*pszName=SysAllocString(L"Start");
return *pszName?S_OK:E_OUTOFMEMORY;
}
int index=varChild.lVal-1; int index=varChild.lVal-1;
if (index<0 || index>=(int)m_pOwner->m_Items.size()) return S_FALSE; if (index<0 || index>=(int)m_pOwner->m_Items.size()) return S_FALSE;
if (m_pOwner->m_Items[index].id==MENU_SEPARATOR) return S_FALSE; if (m_pOwner->m_Items[index].id==MENU_SEPARATOR) return S_FALSE;
@@ -112,10 +105,7 @@ HRESULT STDMETHODCALLTYPE CMenuAccessible::get_accState( VARIANT varChild, VARIA
if (m_pOwner->m_HotItem==index) if (m_pOwner->m_HotItem==index)
flags|=STATE_SYSTEM_FOCUSED; flags|=STATE_SYSTEM_FOCUSED;
if (item.bFolder) if (item.bFolder)
{
flags|=STATE_SYSTEM_HASPOPUP; flags|=STATE_SYSTEM_HASPOPUP;
flags|=(m_pOwner->m_Submenu==index)?STATE_SYSTEM_EXPANDED:STATE_SYSTEM_COLLAPSED;
}
if (item.id==MENU_SEPARATOR) if (item.id==MENU_SEPARATOR)
flags=0; flags=0;
RECT rc; RECT rc;
@@ -177,12 +167,7 @@ HRESULT STDMETHODCALLTYPE CMenuAccessible::get_accDefaultAction( VARIANT varChil
return S_FALSE; return S_FALSE;
const CMenuContainer::MenuItem &item=m_pOwner->m_Items[index]; const CMenuContainer::MenuItem &item=m_pOwner->m_Items[index];
if (item.id!=MENU_SEPARATOR && item.id!=MENU_EMPTY && item.id!=MENU_EMPTY_TOP) if (item.id!=MENU_SEPARATOR && item.id!=MENU_EMPTY && item.id!=MENU_EMPTY_TOP)
{ *pszDefaultAction=SysAllocString(item.bFolder?FindTranslation(L"Menu.ActionOpen",L"Open"):FindTranslation(L"Menu.ActionExecute",L"Execute"));
if (item.bFolder)
*pszDefaultAction=SysAllocString(m_pOwner->m_Submenu==index?FindTranslation(L"Menu.ActionClose",L"Close"):FindTranslation(L"Menu.ActionOpen",L"Open"));
else
*pszDefaultAction=SysAllocString(FindTranslation(L"Menu.ActionExecute",L"Execute"));
}
return S_OK; return S_OK;
} }
+5 -14
View File
@@ -3337,19 +3337,19 @@ void CItemManager::LoadCacheFile( void )
info.iconColor=data.iconColor; info.iconColor=data.iconColor;
info.iconIndex=data.iconIndex; info.iconIndex=data.iconIndex;
info.smallIcon=data.smallIcon>=0 && (size_t)data.smallIcon<remapIcons.size()?remapIcons[data.smallIcon]:NULL; info.smallIcon=data.smallIcon<(int)remapIcons.size()?remapIcons[data.smallIcon]:NULL;
if (!info.smallIcon) if (!info.smallIcon)
{ {
info.validFlags&=~INFO_SMALL_ICON; info.validFlags&=~INFO_SMALL_ICON;
info.smallIcon=m_DefaultSmallIcon; info.smallIcon=m_DefaultSmallIcon;
} }
info.largeIcon=data.largeIcon>=0 && (size_t)data.largeIcon<remapIcons.size()?remapIcons[data.largeIcon]:NULL; info.largeIcon=data.largeIcon<(int)remapIcons.size()?remapIcons[data.largeIcon]:NULL;
if (!info.largeIcon) if (!info.largeIcon)
{ {
info.validFlags&=~INFO_LARGE_ICON; info.validFlags&=~INFO_LARGE_ICON;
info.largeIcon=m_DefaultLargeIcon; info.largeIcon=m_DefaultLargeIcon;
} }
info.extraLargeIcon=data.extraLargeIcon>=0 && (size_t)data.extraLargeIcon<remapIcons.size()?remapIcons[data.extraLargeIcon]:NULL; info.extraLargeIcon=data.extraLargeIcon<(int)remapIcons.size()?remapIcons[data.extraLargeIcon]:NULL;
if (!info.extraLargeIcon) if (!info.extraLargeIcon)
{ {
info.validFlags&=~INFO_EXTRA_LARGE_ICON; info.validFlags&=~INFO_EXTRA_LARGE_ICON;
@@ -3422,7 +3422,7 @@ DWORD CALLBACK CItemManager::SaveCacheFileThread( void *param )
RWLock lock(pThis,false,RWLOCK_ICONS); RWLock lock(pThis,false,RWLOCK_ICONS);
for (std::multimap<unsigned int,IconInfo>::const_iterator it=pThis->m_IconInfos.begin();it!=pThis->m_IconInfos.end();++it) for (std::multimap<unsigned int,IconInfo>::const_iterator it=pThis->m_IconInfos.begin();it!=pThis->m_IconInfos.end();++it)
{ {
if (!it->second.bTemp && !it->second.bMetro && !it->second.PATH.IsEmpty() && it->second.PATH[1]!='#' && it->first!=0) if (!it->second.PATH.IsEmpty() && it->second.PATH[1]!='#' && it->first!=0)
iconInfos.push_back(&*it); iconInfos.push_back(&*it);
} }
} }
@@ -3433,7 +3433,7 @@ DWORD CALLBACK CItemManager::SaveCacheFileThread( void *param )
RWLock lock(pThis,false,RWLOCK_ITEMS); RWLock lock(pThis,false,RWLOCK_ITEMS);
for (std::multimap<unsigned int,ItemInfo>::const_iterator it=pThis->m_ItemInfos.begin();it!=pThis->m_ItemInfos.end();++it) for (std::multimap<unsigned int,ItemInfo>::const_iterator it=pThis->m_ItemInfos.begin();it!=pThis->m_ItemInfos.end();++it)
{ {
if (!it->second.bTemp && it->first!=0) if (it->first!=0)
itemInfos.push_back(&*it); itemInfos.push_back(&*it);
} }
for (std::set<unsigned int>::const_iterator it=pThis->m_BlackListInfos10.begin();it!=pThis->m_BlackListInfos10.end();++it) for (std::set<unsigned int>::const_iterator it=pThis->m_BlackListInfos10.begin();it!=pThis->m_BlackListInfos10.end();++it)
@@ -3566,15 +3566,6 @@ void CItemManager::SaveCacheFile( void )
void CItemManager::ClearCache( void ) void CItemManager::ClearCache( void )
{ {
// The save thread keeps pointers to persistent cache entries while serializing them.
// Let it finish before clearing the containers those pointers refer to.
if (m_SaveCacheThread)
{
WaitForSingleObject(m_SaveCacheThread,INFINITE);
CloseHandle(m_SaveCacheThread);
m_SaveCacheThread=NULL;
}
Lock cleanupLock(this,LOCK_CLEANUP); Lock cleanupLock(this,LOCK_CLEANUP);
RWLock itemLock(this,true,RWLOCK_ITEMS); RWLock itemLock(this,true,RWLOCK_ITEMS);
RWLock iconLock(this,true,RWLOCK_ICONS); RWLock iconLock(this,true,RWLOCK_ICONS);
+1 -1
View File
@@ -383,7 +383,7 @@ private:
static DWORD CALLBACK StaticRefreshInfoThread( void *param ); static DWORD CALLBACK StaticRefreshInfoThread( void *param );
static DWORD CALLBACK SaveCacheFileThread( void *param ); static DWORD CALLBACK SaveCacheFileThread( void *param );
// all paths are in caps and end with backslash // all paths are in caps and end with \
CString m_RootStartMenu1; CString m_RootStartMenu1;
CString m_RootStartMenu2; CString m_RootStartMenu2;
CString m_RootStartMenu3; CString m_RootStartMenu3;
+3 -70
View File
@@ -24,52 +24,6 @@
#include <propvarutil.h> #include <propvarutil.h>
#include <algorithm> #include <algorithm>
#include <propkey.h> #include <propkey.h>
#include <thread>
// Execute function on a separate STA thread while pumping messages on caller thread.
template <typename TFunc>
static auto ExecuteOnSTAThread(TFunc&& func) -> decltype(func())
{
using ReturnType = decltype(func());
ReturnType result{};
std::thread worker([&func, &result]() mutable {
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
result = func();
CoUninitialize();
});
// Pump messages while waiting for the worker (dialog) to finish
while (true)
{
HANDLE hWorker = worker.native_handle();
if (MsgWaitForMultipleObjects(1, &hWorker, FALSE, INFINITE, QS_ALLINPUT) == WAIT_OBJECT_0)
break;
MSG msg;
while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{
if (msg.message == WM_QUIT)
{
PostQuitMessage((int)msg.wParam);
break;
}
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
worker.join();
return result;
}
// Wrapper for SHOpenFolderAndSelectItems that runs on separate STA thread and pumps messages
static HRESULT SHOpenFolderAndSelectItemsSafe(PCIDLIST_ABSOLUTE pidlFolder, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD dwFlags)
{
return ExecuteOnSTAThread([=]() {
return SHOpenFolderAndSelectItems(pidlFolder, cidl, apidl, dwFlags);
});
}
static CString g_RenameText; static CString g_RenameText;
static POINT g_RenamePos; static POINT g_RenamePos;
@@ -981,7 +935,7 @@ static bool ExecuteShutdownCommand(TMenuID menuCommand)
if (!ProceedWithShutdown(flags)) if (!ProceedWithShutdown(flags))
return true; return true;
flags |= SHUTDOWN_FORCE_OTHERS | SHUTDOWN_ARSO; flags |= SHUTDOWN_FORCE_OTHERS;
if (SetShutdownPrivileges()) if (SetShutdownPrivileges())
{ {
@@ -1425,19 +1379,6 @@ static HRESULT CreatePinLink( PCIDLIST_ABSOLUTE sourcePidl, const wchar_t *name,
return S_OK; return S_OK;
} }
static CString GetContextMenuItemVerb(IContextMenu* pContextMenu, UINT_PTR uId)
{
wchar_t verbW[256] = {};
if (SUCCEEDED(pContextMenu->GetCommandString(uId, GCS_VERBW, nullptr, reinterpret_cast<char*>(verbW), sizeof(verbW))))
return CString(verbW);
char verbA[256] = {};
if (SUCCEEDED(pContextMenu->GetCommandString(uId, GCS_VERBA, nullptr, verbA, sizeof(verbA))))
return CString(verbA);
return {};
}
// This function "activates" an item. The item can be activated in multiple ways: // This function "activates" an item. The item can be activated in multiple ways:
// ACTIVATE_SELECT - select the item, make sure it is visible // ACTIVATE_SELECT - select the item, make sure it is visible
// ACTIVATE_OPEN - if the item is a submenu, it is opened. otherwise the item is just selected (but all submenus are closed first) // ACTIVATE_OPEN - if the item is a submenu, it is opened. otherwise the item is just selected (but all submenus are closed first)
@@ -2930,7 +2871,7 @@ void CMenuContainer::ActivateItem( int index, TActivateType type, const POINT *p
} }
else else
{ {
SHOpenFolderAndSelectItemsSafe(pItemPidl1,0,NULL,0); SHOpenFolderAndSelectItems(pItemPidl1,0,NULL,0);
} }
res=0; res=0;
} }
@@ -3172,15 +3113,7 @@ void CMenuContainer::ActivateItem( int index, TActivateType type, const POINT *p
} }
else else
{ {
HRESULT hr{}; HRESULT hr=pInvokeMenu->InvokeCommand((LPCMINVOKECOMMANDINFO)&info);
auto verb = GetContextMenuItemVerb(pInvokeMenu, (UINT_PTR)info.lpVerbW);
// "opencontaining" may block the UI thread on recent Windows 11 versions.
// Use the shell API on a worker STA for that operation, without passing
// the apartment-bound IContextMenu interface to another thread.
if (verb.CompareNoCase(L"opencontaining") == 0)
hr = SHOpenFolderAndSelectItemsSafe(pItemPidl1, 0, NULL, 0);
else
hr = pInvokeMenu->InvokeCommand((LPCMINVOKECOMMANDINFO)&info);
LOG_MENU(LOG_EXECUTE,L"Invoke command, ptr=%p, res=%d",this,hr); LOG_MENU(LOG_EXECUTE,L"Invoke command, ptr=%p, res=%d",this,hr);
executeSuccess=SUCCEEDED(hr); executeSuccess=SUCCEEDED(hr);
} }
+4 -8
View File
@@ -2537,11 +2537,10 @@ void CMenuContainer::InitItems( void )
} }
} }
if (!m_bSubMenu && m_Items.empty() && m_Path1[0] && m_pDropFolder[0]) if (m_Items.empty() && m_Path1[0] && m_pDropFolder[0])
{ {
// Keep the top-level drop target placeholder. Submenus defer their // add (Empty) item to the empty submenus
// empty-state decision until after custom/standard items are appended. MenuItem item(m_bSubMenu?MENU_EMPTY:MENU_EMPTY_TOP);
MenuItem item(MENU_EMPTY_TOP);
item.name=FindTranslation(L"Menu.Empty",L"(Empty)"); item.name=FindTranslation(L"Menu.Empty",L"(Empty)");
m_Items.push_back(item); m_Items.push_back(item);
} }
@@ -6367,10 +6366,7 @@ LRESULT CMenuContainer::OnRefresh( UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL
} }
} }
else if (m_Items[m_OriginalCount].id==MENU_SEARCH_CATEGORY) else if (m_Items[m_OriginalCount].id==MENU_SEARCH_CATEGORY)
{ hotItem=m_OriginalCount+1;
if (!bSearching || !s_SearchResults.programs.empty())
hotItem=m_OriginalCount+1;
}
} }
else else
hotItem=-1; hotItem=-1;
+6 -16
View File
@@ -1185,23 +1185,13 @@ void CMenuContainer::CreateBackground( int width1, int width2, int height1, int
if (opacity!=MenuSkin::OPACITY_SOLID && !bMask) if (opacity!=MenuSkin::OPACITY_SOLID && !bMask)
{ {
// set the visible part to opaque. BitBlt/AlphaBlend above clip to // set to opaque
// the destination bitmap automatically, but this direct pixel pass
// must do the same before forming a pointer into the DIB.
SelectObject(hdc,bmp0); // deselect m_Bitmap so all the GDI operations get flushed SelectObject(hdc,bmp0); // deselect m_Bitmap so all the GDI operations get flushed
RECT imageRect={pos.x,pos.y,pos.x+s_Skin.User_image_size,pos.y+s_Skin.User_image_size}; unsigned int *bits2=bits+pos.y*totalWidth+pos.x;
RECT bitmapRect={0,0,totalWidth,totalHeight}; alpha<<=24;
RECT clippedRect; for (int y=0;y<s_Skin.User_image_size;y++,bits2+=totalWidth)
if (IntersectRect(&clippedRect,&imageRect,&bitmapRect)) for (int x=0;x<s_Skin.User_image_size;x++)
{ bits2[x]=alpha|(bits2[x]&0xFFFFFF);
unsigned int opaqueAlpha=alpha<<24;
for (int y=clippedRect.top;y<clippedRect.bottom;y++)
{
unsigned int *row=bits+y*totalWidth+clippedRect.left;
for (int x=clippedRect.left;x<clippedRect.right;x++,row++)
*row=opaqueAlpha|(*row&0xFFFFFF);
}
}
SelectObject(hdc,m_Bitmap); SelectObject(hdc,m_Bitmap);
} }
+2 -13
View File
@@ -207,10 +207,6 @@ LRESULT CSkinSettingsDlg::OnInitDialog( UINT uMsg, WPARAM wParam, LPARAM lParam,
EnableThemeDialogTexture(m_hWnd,ETDT_ENABLETAB); EnableThemeDialogTexture(m_hWnd,ETDT_ENABLETAB);
m_Tree=GetDlgItem(IDC_SKINOPTIONS); m_Tree=GetDlgItem(IDC_SKINOPTIONS);
EnableSettingsTreeAccessibility(m_Tree);
CString optionsName;
GetDlgItemText(IDC_STATICOPT,optionsName);
SetSettingsTreeAccessibleName(m_Tree,optionsName);
SetWindowSubclass(m_Tree,SubclassTreeProc,'CLSH',0); SetWindowSubclass(m_Tree,SubclassTreeProc,'CLSH',0);
TreeView_SetImageList(m_Tree,GetSettingsImageList(m_Tree),TVSIL_NORMAL); TreeView_SetImageList(m_Tree,GetSettingsImageList(m_Tree),TVSIL_NORMAL);
m_Tree.SendMessage(TVM_SETEXTENDEDSTYLE,TVS_EX_DOUBLEBUFFER,TVS_EX_DOUBLEBUFFER); m_Tree.SendMessage(TVM_SETEXTENDEDSTYLE,TVS_EX_DOUBLEBUFFER,TVS_EX_DOUBLEBUFFER);
@@ -294,7 +290,6 @@ LRESULT CSkinSettingsDlg::OnDestroy( UINT uMsg, WPARAM wParam, LPARAM lParam, BO
void CSkinSettingsDlg::InitSkinUI( void ) void CSkinSettingsDlg::InitSkinUI( void )
{ {
m_Tree.SetRedraw(FALSE); m_Tree.SetRedraw(FALSE);
ClearSettingsTreeItemAccessibility(m_Tree);
TreeView_DeleteAllItems(m_Tree); TreeView_DeleteAllItems(m_Tree);
m_VariationIndex=-1; m_VariationIndex=-1;
m_EditItemIndex=-1; m_EditItemIndex=-1;
@@ -401,12 +396,10 @@ void CSkinSettingsDlg::UpdateSkinSettings( void )
{ {
item.iImage=item.iSelectedImage=image; item.iImage=item.iSelectedImage=image;
TreeView_SetItem(m_Tree,&item); TreeView_SetItem(m_Tree,&item);
NotifyWinEvent(EVENT_OBJECT_STATECHANGE,m_Tree,OBJID_CLIENT,TreeView_MapHTREEITEMToAccID(m_Tree,hVar));
RECT rc; RECT rc;
TreeView_GetItemRect(m_Tree,hVar,&rc,FALSE); TreeView_GetItemRect(m_Tree,hVar,&rc,FALSE);
m_Tree.InvalidateRect(&rc); m_Tree.InvalidateRect(&rc);
} }
SetSettingsTreeItemAccessibleRole(m_Tree,hVar,ROLE_SYSTEM_RADIOBUTTON);
} }
hItem=TreeView_GetNextSibling(m_Tree,hItem); hItem=TreeView_GetNextSibling(m_Tree,hItem);
} }
@@ -449,8 +442,6 @@ void CSkinSettingsDlg::UpdateSkinSettings( void )
item.iImage=item.iSelectedImage=image; item.iImage=item.iSelectedImage=image;
item.mask|=TVIF_TEXT; item.mask|=TVIF_TEXT;
TreeView_SetItem(m_Tree,&item); TreeView_SetItem(m_Tree,&item);
NotifyWinEvent(EVENT_OBJECT_STATECHANGE,m_Tree,OBJID_CLIENT,TreeView_MapHTREEITEMToAccID(m_Tree,hItem));
SetSettingsTreeItemAccessibleRole(m_Tree,hItem,option.groupId>=0?ROLE_SYSTEM_RADIOBUTTON:ROLE_SYSTEM_CHECKBUTTON);
item.mask&=~TVIF_TEXT; item.mask&=~TVIF_TEXT;
RECT rc; RECT rc;
TreeView_GetItemRect(m_Tree,hItem,&rc,FALSE); TreeView_GetItemRect(m_Tree,hItem,&rc,FALSE);
@@ -4465,7 +4456,6 @@ CSetting g_Settings[]={
{L"CustomButton",CSetting::TYPE_RADIO,IDS_CUSTOM_BUTTON,IDS_CUSTOM_BUTTON_TIP}, {L"CustomButton",CSetting::TYPE_RADIO,IDS_CUSTOM_BUTTON,IDS_CUSTOM_BUTTON_TIP},
{L"StartButtonPath",CSetting::TYPE_BITMAP,IDS_BUTTON_IMAGE,IDS_BUTTON_IMAGE_TIP,L"",0,L"#StartButtonType=2",L"CustomButton"}, {L"StartButtonPath",CSetting::TYPE_BITMAP,IDS_BUTTON_IMAGE,IDS_BUTTON_IMAGE_TIP,L"",0,L"#StartButtonType=2",L"CustomButton"},
{L"StartButtonSize",CSetting::TYPE_INT,IDS_BUTTON_SIZE,IDS_BUTTON_SIZE_TIP2,0,0,L"#StartButtonType=2",L"CustomButton"}, {L"StartButtonSize",CSetting::TYPE_INT,IDS_BUTTON_SIZE,IDS_BUTTON_SIZE_TIP2,0,0,L"#StartButtonType=2",L"CustomButton"},
{L"StartButtonOffset",CSetting::TYPE_INT,IDS_BUTTON_OFFSET,IDS_BUTTON_OFFSET_TIP,0,0,L"#StartButtonType=2",L"CustomButton"},
{L"StartButtonAlign",CSetting::TYPE_BOOL,IDS_BUTTON_ALIGN,IDS_BUTTON_ALIGN_TIP,0,0,L"#StartButtonType=2",L"CustomButton"}, {L"StartButtonAlign",CSetting::TYPE_BOOL,IDS_BUTTON_ALIGN,IDS_BUTTON_ALIGN_TIP,0,0,L"#StartButtonType=2",L"CustomButton"},
{L"StartButtonIcon",CSetting::TYPE_ICON,IDS_BUTTON_ICON,IDS_BUTTON_ICON_TIP,L",1",0,L"#StartButtonType=1",L"ClasicButton"}, {L"StartButtonIcon",CSetting::TYPE_ICON,IDS_BUTTON_ICON,IDS_BUTTON_ICON_TIP,L",1",0,L"#StartButtonType=1",L"ClasicButton"},
{L"StartButtonIconSize",CSetting::TYPE_INT,IDS_BUTTON_ICON_SIZE,IDS_BUTTON_ICON_SIZE_TIP,0,0,L"#StartButtonType=1",L"ClasicButton"}, {L"StartButtonIconSize",CSetting::TYPE_INT,IDS_BUTTON_ICON_SIZE,IDS_BUTTON_ICON_SIZE_TIP,0,0,L"#StartButtonType=1",L"ClasicButton"},
@@ -5167,7 +5157,7 @@ void InitSettings( void )
InitSettings(g_Settings,COMPONENT_MENU,&g_CustomSettings); InitSettings(g_Settings,COMPONENT_MENU,&g_CustomSettings);
} }
static int g_ButtonPath, g_ButtonSize, g_ButtonIcon, g_ButtonOffset, g_ButtonIconSize, g_ButtonText, g_ButtonTip; static int g_ButtonPath, g_ButtonSize, g_ButtonIcon, g_ButtonIconSize, g_ButtonText, g_ButtonTip;
static bool g_bButtonEnable, g_bTaskbarsChanged, g_bTaskbarsUpdated; static bool g_bButtonEnable, g_bTaskbarsChanged, g_bTaskbarsUpdated;
static void StoreButtonSettings( void ) static void StoreButtonSettings( void )
@@ -5185,7 +5175,6 @@ static void StoreButtonSettings( void )
if (g_ButtonPath==START_BUTTON_CUSTOM) if (g_ButtonPath==START_BUTTON_CUSTOM)
g_ButtonPath=CalcFNVHash(GetSettingString(L"StartButtonPath")); g_ButtonPath=CalcFNVHash(GetSettingString(L"StartButtonPath"));
g_ButtonSize=GetSettingInt(L"StartButtonSize"); g_ButtonSize=GetSettingInt(L"StartButtonSize");
g_ButtonOffset=GetSettingInt(L"StartButtonOffset");
g_ButtonIconSize=GetSettingInt(L"StartButtonIconSize"); g_ButtonIconSize=GetSettingInt(L"StartButtonIconSize");
} }
@@ -5202,7 +5191,7 @@ static void UpdateButtons( bool bForce )
} }
if (path==START_BUTTON_CUSTOM) if (path==START_BUTTON_CUSTOM)
path=CalcFNVHash(GetSettingString(L"StartButtonPath")); path=CalcFNVHash(GetSettingString(L"StartButtonPath"));
bool bRecreate=(g_bButtonEnable!=GetSettingBool(L"EnableStartButton") || path!=g_ButtonPath || g_ButtonSize!=GetSettingInt(L"StartButtonSize") || g_ButtonOffset!=GetSettingInt(L"StartButtonOffset") bool bRecreate=(g_bButtonEnable!=GetSettingBool(L"EnableStartButton") || path!=g_ButtonPath || g_ButtonSize!=GetSettingInt(L"StartButtonSize")
|| g_ButtonIcon!=icon || g_ButtonIconSize!=GetSettingInt(L"StartButtonIconSize") || g_ButtonText!=text || g_ButtonTip!=tip); || g_ButtonIcon!=icon || g_ButtonIconSize!=GetSettingInt(L"StartButtonIconSize") || g_ButtonText!=text || g_ButtonTip!=tip);
if ((g_bTaskbarsChanged && !g_bTaskbarsUpdated) || bForce || bRecreate) if ((g_bTaskbarsChanged && !g_bTaskbarsUpdated) || bForce || bRecreate)
{ {
@@ -2918,28 +2918,6 @@ bool MenuSkin::LoadSkin( HMODULE hMod, const wchar_t *variation, const wchar_t *
ItemSettings[COLUMN2_INLINE].bmpIconFrame.bIsOwned=false; ItemSettings[COLUMN2_INLINE].bmpIconFrame.bIsOwned=false;
ItemSettings[COLUMN2_INLINE].bmpSeparator.bIsOwned=false; ItemSettings[COLUMN2_INLINE].bmpSeparator.bIsOwned=false;
// A skin's "new item" colors must not override the user's High Contrast
// palette. This only changes the highlighted-new variants while High
// Contrast is active; normal themed rendering remains untouched.
HIGHCONTRAST contrast={sizeof(contrast)};
if (SystemParametersInfo(SPI_GETHIGHCONTRAST,sizeof(contrast),&contrast,0) && (contrast.dwFlags&HCF_HIGHCONTRASTON))
{
const int newItems[]={COLUMN1_NEW,COLUMN2_NEW,SUBMENU_NEW,PROGRAMS_TREE_NEW,PROGRAMS_BUTTON_NEW,PROGRAMS_CASCADING_NEW};
for (int i=0;i<_countof(newItems);i++)
{
ItemDrawSettings &settings=ItemSettings[newItems[i]];
settings.bmpSelection.Reset(true);
settings.bmpSelection=GetSysColor(COLOR_HIGHLIGHT);
settings.glowSize=0;
for (int j=0;j<_countof(settings.textColors);j++)
{
settings.textColors[j]=GetSysColor(COLOR_HIGHLIGHTTEXT);
settings.textShadowColors[j]=GetSysColor(COLOR_HIGHLIGHT);
}
settings.arrColors[0]=settings.arrColors[1]=GetSysColor(COLOR_HIGHLIGHTTEXT);
}
}
HDC hdc=CreateCompatibleDC(NULL); HDC hdc=CreateCompatibleDC(NULL);
HGDIOBJ font0=GetCurrentObject(hdc,OBJ_FONT); HGDIOBJ font0=GetCurrentObject(hdc,OBJ_FONT);
for (int i=0;i<_countof(ItemSettings);i++) for (int i=0;i<_countof(ItemSettings);i++)
+10 -62
View File
@@ -22,7 +22,6 @@
#include <dbghelp.h> #include <dbghelp.h>
#include <set> #include <set>
#include <Thumbcache.h> #include <Thumbcache.h>
#include <tlhelp32.h>
#define HOOK_DROPTARGET // define this to replace the IDropTarget of the start button #define HOOK_DROPTARGET // define this to replace the IDropTarget of the start button
#define START_TOUCH // touch support for the start button #define START_TOUCH // touch support for the start button
@@ -1347,9 +1346,6 @@ static void UpdateStartButtonPosition(const TaskbarInfo* taskBar, const WINDOWPO
// We will shift our Aero button to cover original button // We will shift our Aero button to cover original button
if (IsWin11() && (x == info.rcMonitor.left) && (GetStartButtonType() == START_BUTTON_AERO) && !g_epTaskbar) if (IsWin11() && (x == info.rcMonitor.left) && (GetStartButtonType() == START_BUTTON_AERO) && !g_epTaskbar)
x += ScaleForDpi(taskBar->taskBar, 6); x += ScaleForDpi(taskBar->taskBar, 6);
if (GetStartButtonType() == START_BUTTON_CUSTOM)
x += ScaleForDpi(taskBar->taskBar, GetSettingInt(L"StartButtonOffset"));
} }
RECT rcButton = { x, y, x + taskBar->startButtonSize.cx, y + taskBar->startButtonSize.cy }; RECT rcButton = { x, y, x + taskBar->startButtonSize.cx, y + taskBar->startButtonSize.cy };
@@ -1628,7 +1624,7 @@ static void ComputeTaskbarColors( int *data )
{ {
bool bDefLook; bool bDefLook;
int look=GetSettingInt(L"TaskbarLook",bDefLook); int look=GetSettingInt(L"TaskbarLook",bDefLook);
if (GetWinVersion()<WIN_VER_WIN10 || !IsAppThemed() || look==TASKBAR_AEROGLASS || (look==TASKBAR_TRANSPARENT && g_TaskbarTexture)) if (GetWinVersion()<WIN_VER_WIN10 || look==TASKBAR_AEROGLASS || (look==TASKBAR_TRANSPARENT && g_TaskbarTexture))
{ {
memset(data,0,16); memset(data,0,16);
} }
@@ -1876,7 +1872,6 @@ static LRESULT CALLBACK SubclassTaskBarProc( HWND hWnd, UINT uMsg, WPARAM wParam
ComputeTaskbarColors(data); ComputeTaskbarColors(data);
WINCOMPATTRDATA attrData={0x13,&data,sizeof(data)}; WINCOMPATTRDATA attrData={0x13,&data,sizeof(data)};
SetWindowCompositionAttribute(hWnd,&attrData); SetWindowCompositionAttribute(hWnd,&attrData);
UpdateTaskBars(TASKBAR_UPDATE_TEXTURE);
return res; return res;
} }
if ((uMsg==WM_DWMCOLORIZATIONCOLORCHANGED || uMsg==WM_SETTINGCHANGE) && taskBar && taskBar->bCustomLook && SetWindowCompositionAttribute && GetWinVersion()<WIN_VER_WIN10) if ((uMsg==WM_DWMCOLORIZATIONCOLORCHANGED || uMsg==WM_SETTINGCHANGE) && taskBar && taskBar->bCustomLook && SetWindowCompositionAttribute && GetWinVersion()<WIN_VER_WIN10)
@@ -1937,7 +1932,7 @@ static LRESULT CALLBACK SubclassTaskBarProc( HWND hWnd, UINT uMsg, WPARAM wParam
WINCOMPATTRDATA attrData={0x13,&data,sizeof(data)}; WINCOMPATTRDATA attrData={0x13,&data,sizeof(data)};
SetWindowCompositionAttribute(hWnd,&attrData); SetWindowCompositionAttribute(hWnd,&attrData);
} }
if (g_TaskbarTexture) if (g_TaskbarTexture && IsAppThemed())
{ {
// draw taskbar background (behind start button and separators) // draw taskbar background (behind start button and separators)
PAINTSTRUCT ps; PAINTSTRUCT ps;
@@ -2388,19 +2383,12 @@ void UpdateTaskBars( TUpdateTaskbar update )
} }
} }
} }
else if ((GetWinVersion()<WIN_VER_WIN10 && (!bDefColor || !bDefOpacity)) || !IsAppThemed()) else if (GetWinVersion()<WIN_VER_WIN10 && (!bDefColor || !bDefOpacity))
{ {
if (bDefColor && GetWinVersion()>WIN_VER_WIN7) if (bDefColor && GetWinVersion()>WIN_VER_WIN7)
{ {
if (IsAppThemed()) color=GetSystemGlassColor8();
{ color=((color&0xFF)<<16)|(color&0xFF00)|((color>>16)&0xFF);
color=GetSystemGlassColor8();
color=((color&0xFF)<<16)|(color&0xFF00)|((color>>16)&0xFF);
}
else
{
color=GetSysColor(COLOR_BTNFACE);
}
} }
BITMAPINFO bi={0}; BITMAPINFO bi={0};
bi.bmiHeader.biSize=sizeof(BITMAPINFOHEADER); bi.bmiHeader.biSize=sizeof(BITMAPINFOHEADER);
@@ -2940,35 +2928,6 @@ static void OpenCortana( void )
ShellExecute(NULL,NULL,L"shell:::{2559a1f8-21d7-11d4-bdaf-00c04f60b9f0}",NULL,NULL,SW_SHOWNORMAL); ShellExecute(NULL,NULL,L"shell:::{2559a1f8-21d7-11d4-bdaf-00c04f60b9f0}",NULL,NULL,SW_SHOWNORMAL);
} }
HMODULE GetModuleHandleByPrefix(const WCHAR* prefix)
{
HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, GetCurrentProcessId());
if (snapshot == INVALID_HANDLE_VALUE)
return nullptr;
size_t prefixLength = wcslen(prefix);
MODULEENTRY32 me{};
me.dwSize = sizeof(me);
HMODULE result = nullptr;
if (Module32First(snapshot, &me))
{
do
{
if (_wcsnicmp(me.szModule, prefix, prefixLength) == 0)
{
result = reinterpret_cast<HMODULE>(me.modBaseAddr);
break;
}
} while (Module32Next(snapshot, &me));
}
CloseHandle(snapshot);
return result;
}
static void InitStartMenuDLL( void ) static void InitStartMenuDLL( void )
{ {
static bool initCalled = false; static bool initCalled = false;
@@ -3012,7 +2971,10 @@ static void InitStartMenuDLL( void )
auto module=GetModuleHandle(L"taskbar.dll"); auto module=GetModuleHandle(L"taskbar.dll");
if (!module) if (!module)
{ {
module = GetModuleHandleByPrefix(L"ep_taskbar"); module = GetModuleHandle(L"ep_taskbar.5.dll");
if (!module)
module = GetModuleHandle(L"ep_taskbar.2.dll");
if (module) if (module)
g_epTaskbar = true; g_epTaskbar = true;
} }
@@ -3050,10 +3012,7 @@ static void InitStartMenuDLL( void )
if (GetWinVersion()<=WIN_VER_WIN81) if (GetWinVersion()<=WIN_VER_WIN81)
g_DrawThemeBackgroundHook=SetIatHook(module,"uxtheme.dll","DrawThemeBackground",DrawThemeBackground2); g_DrawThemeBackgroundHook=SetIatHook(module,"uxtheme.dll","DrawThemeBackground",DrawThemeBackground2);
g_DrawThemeTextHook=SetIatHook(module,"uxtheme.dll","DrawThemeText",DrawThemeText2); g_DrawThemeTextHook=SetIatHook(module,"uxtheme.dll","DrawThemeText",DrawThemeText2);
if (IsAppThemed()) g_DrawThemeTextExHook=SetIatHook(module,"uxtheme.dll","DrawThemeTextEx",DrawThemeTextEx2);
{
g_DrawThemeTextExHook=SetIatHook(module,"uxtheme.dll","DrawThemeTextEx",DrawThemeTextEx2);
}
g_DrawThemeTextCtlHook=SetIatHook(GetModuleHandle(L"comctl32.dll"),"uxtheme.dll","DrawThemeText",DrawThemeText2); g_DrawThemeTextCtlHook=SetIatHook(GetModuleHandle(L"comctl32.dll"),"uxtheme.dll","DrawThemeText",DrawThemeText2);
if (GetWinVersion()>=WIN_VER_WIN10) if (GetWinVersion()>=WIN_VER_WIN10)
g_SetWindowCompositionAttributeHook=SetIatHook(module,"user32.dll","SetWindowCompositionAttribute",SetWindowCompositionAttribute2); g_SetWindowCompositionAttributeHook=SetIatHook(module,"user32.dll","SetWindowCompositionAttribute",SetWindowCompositionAttribute2);
@@ -4229,17 +4188,6 @@ if (!g_bTrimHooks)
} }
else if (bShowWinX) else if (bShowWinX)
{ {
// Win+X is shown asynchronously on Windows 11. Cancel any pending
// hover-open timer first, otherwise it can open the configured
// hover menu a moment later and dismiss Win+X again.
if (taskBar->bTimer)
{
taskBar->bTimer=false;
if (taskBar->startButton)
KillTimer(taskBar->startButton,'CLSM');
if (taskBar->oldButton && taskBar->oldButton!=taskBar->startButton)
KillTimer(taskBar->oldButton,'CLSM');
}
ShowWinX(); ShowWinX();
} }
else if (bShowWin7) else if (bShowWin7)
+2 -4
View File
@@ -1073,8 +1073,6 @@ BEGIN
IDS_MENU_GLASS "Enable Aero Glass (requires Aero Glass mod)" IDS_MENU_GLASS "Enable Aero Glass (requires Aero Glass mod)"
IDS_MENU_GLASS_TIP "Check this to use glass transparency (requires the Aero Glass mod to be installed)" IDS_MENU_GLASS_TIP "Check this to use glass transparency (requires the Aero Glass mod to be installed)"
IDS_MAIN_MENU_SETTINGS "Main Menu" IDS_MAIN_MENU_SETTINGS "Main Menu"
IDS_BUTTON_OFFSET "Button offset"
IDS_BUTTON_OFFSET_TIP "Offset the start button horizontally by the amount of pixels specified"
END END
STRINGTABLE STRINGTABLE
@@ -1083,9 +1081,9 @@ BEGIN
IDS_RIGHT_SHIFT_TIP "When this is checked, right-click on the start button will open the standard Windows context menu instead of the Open-Shell menu. Otherwise Shift+right-click will open it" IDS_RIGHT_SHIFT_TIP "When this is checked, right-click on the start button will open the standard Windows context menu instead of the Open-Shell menu. Otherwise Shift+right-click will open it"
IDS_RIGHT_SHIFTX "Right click opens Win+X menu" IDS_RIGHT_SHIFTX "Right click opens Win+X menu"
IDS_RIGHT_SHIFTX_TIP "When this is checked, right-click on the start button will open the Win+X power menu instead of the Open-Shell menu. Otherwise Shift+right-click will open it" IDS_RIGHT_SHIFTX_TIP "When this is checked, right-click on the start button will open the Win+X power menu instead of the Open-Shell menu. Otherwise Shift+right-click will open it"
IDS_STARTSCREEN_ITEM "Show Start Menu/Screen shortcut" IDS_STARTSCREEN_ITEM "Show Start screen shortcut"
IDS_STARTSCREEN_ITEM_TIP IDS_STARTSCREEN_ITEM_TIP
"When this is checked, the main menu will contain a shortcut to open original Start menu/screen" "When this is checked, the main menu will contain a shortcut to open the Start screen"
IDS_MIN_HEIGHT "Minimum menu height" IDS_MIN_HEIGHT "Minimum menu height"
IDS_MIN_HEIGHT_TIP "The main menu will be at least as tall as this many search results" IDS_MIN_HEIGHT_TIP "The main menu will be at least as tall as this many search results"
IDS_GLASS_OVERRIDE "Override glass color" IDS_GLASS_OVERRIDE "Override glass color"
@@ -47,7 +47,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration"> <PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType> <ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v143</PlatformToolset> <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<UseOfAtl>Static</UseOfAtl> <UseOfAtl>Static</UseOfAtl>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization Condition="'$(Configuration)'!='Debug'">true</WholeProgramOptimization> <WholeProgramOptimization Condition="'$(Configuration)'!='Debug'">true</WholeProgramOptimization>
-2
View File
@@ -786,8 +786,6 @@
#define IDS_ENABLE_ACCELERATORS_TIP 3687 #define IDS_ENABLE_ACCELERATORS_TIP 3687
#define IDS_ALT_ACCELERATORS 3688 #define IDS_ALT_ACCELERATORS 3688
#define IDS_ALT_ACCELERATORS_TIP 3689 #define IDS_ALT_ACCELERATORS_TIP 3689
#define IDS_BUTTON_OFFSET 3690
#define IDS_BUTTON_OFFSET_TIP 3691
#define IDS_STRING7001 7001 #define IDS_STRING7001 7001
#define IDS_STRING7002 7002 #define IDS_STRING7002 7002
#define IDS_STRING7003 7003 #define IDS_STRING7003 7003
+2 -2
View File
@@ -55,8 +55,8 @@ END_COM_MAP()
STDMETHODIMP InvokeCommand( CMINVOKECOMMANDINFO *pInfo ); STDMETHODIMP InvokeCommand( CMINVOKECOMMANDINFO *pInfo );
STDMETHODIMP GetCommandString( UINT_PTR idCmd, UINT uFlags, UINT* pwReserved, LPSTR pszName, UINT cchMax ); STDMETHODIMP GetCommandString( UINT_PTR idCmd, UINT uFlags, UINT* pwReserved, LPSTR pszName, UINT cchMax );
wchar_t m_PinFolder1[_MAX_PATH]; // ending with backslash wchar_t m_PinFolder1[_MAX_PATH]; // ending with \
wchar_t m_PinFolder2[_MAX_PATH]; // ending with backslash wchar_t m_PinFolder2[_MAX_PATH]; // ending with \
wchar_t m_FileName[_MAX_PATH]; wchar_t m_FileName[_MAX_PATH];
LPITEMIDLIST m_FilePidl; LPITEMIDLIST m_FilePidl;
bool m_bInPinFolder1, m_bInPinFolder2; bool m_bInPinFolder1, m_bInPinFolder2;
@@ -59,7 +59,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration"> <PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType> <ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v143</PlatformToolset> <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<UseOfAtl>Static</UseOfAtl> <UseOfAtl>Static</UseOfAtl>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization Condition="'$(Configuration)'!='Debug'">true</WholeProgramOptimization> <WholeProgramOptimization Condition="'$(Configuration)'!='Debug'">true</WholeProgramOptimization>
@@ -20,7 +20,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration"> <PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType> <ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v143</PlatformToolset> <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization Condition="'$(Configuration)'!='Debug'">true</WholeProgramOptimization> <WholeProgramOptimization Condition="'$(Configuration)'!='Debug'">true</WholeProgramOptimization>
</PropertyGroup> </PropertyGroup>
+1 -1
View File
@@ -19,7 +19,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration"> <PropertyGroup Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v143</PlatformToolset> <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<UseOfAtl>Static</UseOfAtl> <UseOfAtl>Static</UseOfAtl>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization Condition="'$(Configuration)'!='Debug'">true</WholeProgramOptimization> <WholeProgramOptimization Condition="'$(Configuration)'!='Debug'">true</WholeProgramOptimization>
+1 -1
View File
@@ -21,5 +21,5 @@ deploy:
on: on:
APPVEYOR_ACCOUNT_NAME: passionate-coder APPVEYOR_ACCOUNT_NAME: passionate-coder
auth_token: auth_token:
secure: SOu6Y71k0oIxXJR35x+7ZeU/+WRW8kaGnCWcbR3OVOd8HeCJwB1Tw3hUJa5EveLGKaGoMKGqAh01Pwc8tWX4xmphZsYYUr09IVjA0+rqgN5VT87CXD6OQxUxBJ7g+9IN secure: SOu6Y71k0oIxXJR35x+7ZTrqDa3HqUM4kLNJc+DbohPz9zhVHh9O8QYwmI7LI0qslug5L11fo9pZVfVgZttw4eBgooHaX9TNBTTA6sJItkXqMX+M6mKAG7tbI/O3Eg0v
prerelease: true prerelease: true