Files
PowerToys/src/settings-ui/Settings.UI/Helpers/CHOOSEFONT.cs
Jaime Bernardo 21fd5092b3 [New utility]Sysinternals ZoomIt (#35880)
* ZoomIt initial code dump

* Change vcxproj to normalize dependency versions

* Fix code quality to build

* Add to PowerToys solution

* Clean out C-style casts

* Fix some more analyzer errors

* Constexpr a function

* Disable some warnings locally that it seemed better not to touch

* Add ZoomIt module interface

* Add GPO

* Add Settings page with Enable button

* Output as PowerToys.ZoomIt.exe

* Extract ZoomIt Settings definition to its own header

* Make ZoomItModuleInterface build with ZoomItSettings too

* WinRT C++ interop for ZoomItSettings

* From Registry To PowerToys Json

* Properly fix const_cast analyzer error

* Initial Settings page loading from registry

* Zoom mode settings

* Save settings

* Add file picker and DemoType file support

* Remaining DemoType settings

* Have ZoomIt properly reloading Settings and exiting

* Remove context menu entries for Options and Exit

* ZoomIt simple Break Options

* Break advanced options

* Simple Record settings

* Record Microphone setting

* Fix break background file picker title

* Font setting

* Fix build issues after merge

* Add ZoomIt conflict warning to Settings

* Exclude Eula from spell checking

* Fix spellcheck errors

* Fix spell check for accelerated menu items

* Remove cursor files from spellcheck. They're binary

* Fix forbidden patterns

* Fix XAML style

* Fix C# analyzers

* Fix signing

* Also sign module interface dll

* Use actual ZoomIt icon

* Add OOBE page for ZoomIt

* ZoomIt image for Settings

* Flyout and Dashboard entries

* Fix type speed slider labels

* Correctly load default Font

* Correctly register shortcuts on ZoomIt startup first run

* Fix modifier keys not changing until restart

* Show MsgBox on taken shortcut

* Start PowerToys Settings

* Normalize ZoomIt file properties with rest of PowerToys

* Add attribution

* Add ZoomIt team to Community.md

* More copyright adjustments

* Fix spellcheck

* Fix MsgBox simultaneous instance to the front

* Add mention of capturevideosample code use

* Add ZoomIt to process lists

* Add telemetry

* Add logging

* React to gpo

* Normalize code to space identation

* Fix installer build

* Localize percent setting

* Fix XAML styling

* Update src/settings-ui/Settings.UI/Strings/en-us/Resources.resw

Co-authored-by: Stefan Markovic <57057282+stefansjfw@users.noreply.github.com>

* Fix spellcheck

* One more spellcheck fix

* Integrate LiveDraw feature changes from upstream

* Fix name reuse in same scope

* Fix c-style casts

* Also register LIVEDRAW_HOTKEY

* Fix newLiveZoomToggleKey

* Update LiveZoom description in Settings to take LiveDraw into account

* Fix spellcheck

* Fix more spellcheck

* Fix Sysinternals capitalization

* Fix ARM64 Debug build

* Support Sysinternals build (#36873)

* Remove unneeded files

* Make build compatible with Sysinternals

* Separate PowerToys ZoomIt product name (#36887)

* Separate PowerToys ZoomIt product name

To help maintain the Sysinternals branding in the standalone version.

* Clarify branding-related includes

* Remove ZoomIt.sln

* Add foxmsft to spell-check names

* Add ZoomIt to README

* Add ZoomIt to GH templates

* Add ZoomIt events to DATA_AND_PRIVACY.md

* Remove publish_config.json

* Remove publish_config.json from vcxproj too

---------

Co-authored-by: Mark Russinovich <markruss@microsoft.com>
Co-authored-by: Alex Mihaiuc <69110671+foxmsft@users.noreply.github.com>
Co-authored-by: John Stephens <johnstep@microsoft.com>
Co-authored-by: Stefan Markovic <57057282+stefansjfw@users.noreply.github.com>
2025-01-16 20:52:24 +00:00

71 lines
3.1 KiB
C#

// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Runtime.InteropServices;
namespace Microsoft.PowerToys.Settings.UI.Helpers
{
[System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.NamingRules", "SA1307:Accessible fields should begin with upper-case letter", Justification = "Keep original names from original structure")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.NamingRules", "SA1306:Field names should begin with lower-case letter", Justification = "Keep original names from original structure")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1401:Fields should be private", Justification = "Structure used for win32 interop. We need to access the fields")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Performance", "CA1805:Do not initialize unnecessarily", Justification = "Let's have initializations be explicit for these win32 interop types")]
// Class to select the Dialog options to call ChooseFont.
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
public class CHOOSEFONT
{
public int lStructSize = Marshal.SizeOf(typeof(CHOOSEFONT));
public IntPtr hwndOwner = IntPtr.Zero;
public IntPtr hDC = IntPtr.Zero;
public IntPtr lpLogFont = IntPtr.Zero;
public int iPointSize = 0;
public int Flags = 0;
public int rgbColors = 0;
public IntPtr lCustData = IntPtr.Zero;
public IntPtr lpfnHook = IntPtr.Zero;
public string lpTemplateName = null;
public IntPtr hInstance = IntPtr.Zero;
public string lpszStyle = null;
public short nFontType;
private short __MISSING_ALIGNMENT__;
public int nSizeMin;
public int nSizeMax;
}
[Flags]
public enum CHOOSE_FONT_FLAGS
{
CF_SCREENFONTS = 0x00000001,
CF_PRINTER_FONTS = 0x00000002,
CF_BOTH = CF_SCREENFONTS | CF_PRINTER_FONTS,
CF_SHOW_HELP = 0x00000004,
CF_ENABLE_HOOK = 0x00000008,
CF_ENABLETEMPLATE = 0x00000010,
CF_ENABLETEMPLATE_HANDLE = 0x00000020,
CF_INITTOLOGFONTSTRUCT = 0x00000040,
CF_USE_STYLE = 0x00000080,
CF_EFFECTS = 0x00000100,
CF_APPLY = 0x00000200,
CF_ANSI_ONLY = 0x00000400,
CF_SCRIPTS_ONLY = CF_ANSI_ONLY,
CF_NO_VECTOR_FONTS = 0x00000800,
CF_NO_OEM_FONTS = CF_NO_VECTOR_FONTS,
CF_NO_SIMULATIONS = 0x00001000,
CF_LIMITSIZE = 0x00002000,
CF_FIXED_PITCH_ONLY = 0x00004000,
CF_WYSIWYG = 0x00008000,
CF_FORCE_FONT_EXIST = 0x00010000,
CF_SCALABLE_ONLY = 0x00020000,
CF_TT_ONLY = 0x00040000,
CF_NO_FACE_SEL = 0x00080000,
CF_NO_STYLE_SEL = 0x00100000,
CF_NO_SIZE_SEL = 0x00200000,
CF_SELECT_SCRIPT = 0x00400000,
CF_NO_SCRIPT_SEL = 0x00800000,
CF_NO_VERT_FONTS = 0x01000000,
CF_INACTIVE_FONTS = 0x02000000,
}
}