-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sync dev/imageResizer with master (#1105)
* tweaking language * adjusting elevated permission verbiage to match Windows * npm audit fix to update stuff * slight bump for fabric ui * Remove unwanted files (#1037) Add temp build files to gitignore * Ensure previous search and replace texts are evaluated and updated in the UI at startup (#1043) Ensure stored settings get evaluated after initial enumeration There was a bug where the list view was not getting updated with the results of the search and replace on launch when we are using a stored search or replace text from a previous session. * adding fancy zone opacity setting, enhancement #631 (#1008) * adding fancy zone opacity setting, enhancement #631 * applying zone opacity setting to all zones during zone selection * changing opacity setting to percentage * runner: show message box when restarting with different elevation fails (#1061) Also make the message box appear on top of the settings window. * Fix misaligned display of zones in layout priview and grid editor (#1010) Fix misaligned display of zones in layout preview and grid editor * MSIX: Extract MSIX building functionality from msix_reinstall.ps1 to a separate script (#1068) * MSIX: label PowerToys as Preview (#1090) * MSIX: Code sign msixbundle (#1093) * Update to MSIX README.md (#1095) * Update README.md few adjustments * Update README.md * Update README.md * adding in privacy statement, removing About in dialog (#1087) * adding in privacy statement, removing About in dialog * added Preview * Revert "Fix misaligned display of zones in layout priview and grid editor (#1010)" (#1097) This reverts commit d03690c. * Fix reversed order of zones in layout (#1071) * Shifted three functions to common (#1101) Co-authored-by: Clint Rutkas <[email protected]> Co-authored-by: Enrico Giordani <[email protected]> Co-authored-by: Chris Davis <[email protected]> Co-authored-by: Yosef Durr <[email protected]> Co-authored-by: Bartosz Sosnowski <[email protected]> Co-authored-by: vldmr11080 <[email protected]> Co-authored-by: yuyoyuppe <[email protected]>
- Loading branch information
1 parent
f65b9fd
commit db7f155
Showing
41 changed files
with
420 additions
and
263 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
makeappx build /v /overwrite /f PackagingLayout.xml /id "PowerToys-x64" /op bin\ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,11 @@ | ||
taskkill /f /im explorer.exe | ||
|
||
Get-AppxPackage -Name 'PowerToys' | select -ExpandProperty "PackageFullName" | Remove-AppxPackage | ||
makeappx build /v /overwrite /f PackagingLayout.xml /id "PowerToys-x64" /op bin\ | ||
|
||
.\build_msix.ps1 | ||
signtool sign /debug /a /fd SHA256 /f PowerToys_TemporaryKey.pfx /p 12345 bin\PowerToys-x64.msix | ||
signtool sign /debug /a /fd SHA256 /f PowerToys_TemporaryKey.pfx /p 12345 bin\PowerToys.msixbundle | ||
|
||
Add-AppxPackage .\bin\PowerToys-x64.msix | ||
|
||
start $Env:windir\explorer.exe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
#include "icon_helpers.h" | ||
#include "pch.h" | ||
|
||
HRESULT GetIconIndexFromPath(_In_ PCWSTR path, _Out_ int* index) | ||
{ | ||
*index = 0; | ||
|
||
HRESULT hr = E_FAIL; | ||
|
||
SHFILEINFO shFileInfo = { 0 }; | ||
|
||
if (!PathIsRelative(path)) | ||
{ | ||
DWORD attrib = GetFileAttributes(path); | ||
HIMAGELIST himl = (HIMAGELIST)SHGetFileInfo(path, attrib, &shFileInfo, sizeof(shFileInfo), (SHGFI_SYSICONINDEX | SHGFI_SMALLICON | SHGFI_USEFILEATTRIBUTES)); | ||
if (himl) | ||
{ | ||
*index = shFileInfo.iIcon; | ||
// We shouldn't free the HIMAGELIST. | ||
hr = S_OK; | ||
} | ||
} | ||
|
||
return hr; | ||
} | ||
|
||
HBITMAP CreateBitmapFromIcon(_In_ HICON hIcon, _In_opt_ UINT width, _In_opt_ UINT height) | ||
{ | ||
HBITMAP hBitmapResult = NULL; | ||
|
||
// Create compatible DC | ||
HDC hDC = CreateCompatibleDC(NULL); | ||
if (hDC != NULL) | ||
{ | ||
// Get bitmap rectangle size | ||
RECT rc = { 0 }; | ||
rc.left = 0; | ||
rc.right = (width != 0) ? width : GetSystemMetrics(SM_CXSMICON); | ||
rc.top = 0; | ||
rc.bottom = (height != 0) ? height : GetSystemMetrics(SM_CYSMICON); | ||
|
||
// Create bitmap compatible with DC | ||
BITMAPINFO BitmapInfo; | ||
ZeroMemory(&BitmapInfo, sizeof(BITMAPINFO)); | ||
|
||
BitmapInfo.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); | ||
BitmapInfo.bmiHeader.biWidth = rc.right; | ||
BitmapInfo.bmiHeader.biHeight = rc.bottom; | ||
BitmapInfo.bmiHeader.biPlanes = 1; | ||
BitmapInfo.bmiHeader.biBitCount = 32; | ||
BitmapInfo.bmiHeader.biCompression = BI_RGB; | ||
|
||
HDC hDCBitmap = GetDC(NULL); | ||
|
||
HBITMAP hBitmap = CreateDIBSection(hDCBitmap, &BitmapInfo, DIB_RGB_COLORS, NULL, NULL, 0); | ||
|
||
ReleaseDC(NULL, hDCBitmap); | ||
|
||
if (hBitmap != NULL) | ||
{ | ||
// Select bitmap into DC | ||
HBITMAP hBitmapOld = (HBITMAP)SelectObject(hDC, hBitmap); | ||
if (hBitmapOld != NULL) | ||
{ | ||
// Draw icon into DC | ||
if (DrawIconEx(hDC, 0, 0, hIcon, rc.right, rc.bottom, 0, NULL, DI_NORMAL)) | ||
{ | ||
// Restore original bitmap in DC | ||
hBitmapResult = (HBITMAP)SelectObject(hDC, hBitmapOld); | ||
hBitmapOld = NULL; | ||
hBitmap = NULL; | ||
} | ||
|
||
if (hBitmapOld != NULL) | ||
{ | ||
SelectObject(hDC, hBitmapOld); | ||
} | ||
} | ||
|
||
if (hBitmap != NULL) | ||
{ | ||
DeleteObject(hBitmap); | ||
} | ||
} | ||
|
||
DeleteDC(hDC); | ||
} | ||
|
||
return hBitmapResult; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#pragma once | ||
#include "common.h" | ||
|
||
HRESULT GetIconIndexFromPath(_In_ PCWSTR path, _Out_ int* index); | ||
HBITMAP CreateBitmapFromIcon(_In_ HICON hIcon, _In_opt_ UINT width = 0, _In_opt_ UINT height = 0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#include "window_helpers.h" | ||
#include "pch.h" | ||
|
||
HWND CreateMsgWindow(_In_ HINSTANCE hInst, _In_ WNDPROC pfnWndProc, _In_ void* p) | ||
{ | ||
WNDCLASS wc = { 0 }; | ||
|
||
PCWSTR wndClassName = L"MsgWindow"; | ||
|
||
wc.lpfnWndProc = DefWindowProc; | ||
wc.cbWndExtra = sizeof(void*); | ||
wc.hInstance = hInst; | ||
wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1); | ||
wc.lpszClassName = wndClassName; | ||
|
||
RegisterClass(&wc); | ||
|
||
HWND hwnd = CreateWindowEx( | ||
0, wndClassName, nullptr, 0, 0, 0, 0, 0, HWND_MESSAGE, 0, hInst, nullptr); | ||
if (hwnd) | ||
{ | ||
SetWindowLongPtr(hwnd, 0, (LONG_PTR)p); | ||
if (pfnWndProc) | ||
{ | ||
SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR)pfnWndProc); | ||
} | ||
} | ||
|
||
return hwnd; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#pragma once | ||
#include "common.h" | ||
|
||
HWND CreateMsgWindow(_In_ HINSTANCE hInst, _In_ WNDPROC pfnWndProc, _In_ void* p); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Oops, something went wrong.