[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>
This commit is contained in:
Jaime Bernardo 2025-01-16 20:52:24 +00:00 коммит произвёл GitHub
Родитель 65e09dbed7
Коммит 21fd5092b3
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
123 изменённых файлов: 17201 добавлений и 20 удалений

1
.github/ISSUE_TEMPLATE/bug_report.yml поставляемый
Просмотреть файл

@ -79,6 +79,7 @@ body:
- TextExtractor
- Workspaces
- Welcome / PowerToys Tour window
- ZoomIt
validations:
required: true

Просмотреть файл

@ -53,6 +53,7 @@ body:
- TextExtractor
- Workspaces
- Welcome / PowerToys Tour window
- ZoomIt
validations:
required: true
- type: input

5
.github/actions/spell-check/allow/names.txt поставляемый
Просмотреть файл

@ -33,6 +33,7 @@ Adoumie
Advaith
alekhyareddy
Aleks
amihaiuc
angularsen
Anirudha
arjunbalgovind
@ -67,6 +68,7 @@ Essey
Feng
ethanfangg
ferraridavide
foxmsft
frankychen
Gaarden
gaardmark
@ -114,6 +116,7 @@ martinchrzan
martinmoene
Melman
Mengyuan
Mihaiuc
Mikhayelyan
msft
Mykhailo
@ -141,6 +144,7 @@ ricardosantos
riri
ritchielawrence
robmikh
Russinovich
Rutkas
ryanbodrug
saahmedm
@ -185,6 +189,7 @@ Zykova
Bilibili
BVID
capturevideosample
cmdow
Controlz
cortana

2
.github/actions/spell-check/excludes.txt поставляемый
Просмотреть файл

@ -16,6 +16,7 @@
(?:|$^ 92.31% - excluded 12/13)/editor/[^/]+$
/images/launcher/[^/]+$
/TestFiles/
[^/]\.cur$
[^/]\.gcode$
[^/]\.rgs$
\.a$
@ -119,5 +120,6 @@
^src/modules/MouseWithoutBorders/App/Helper/.*\.resx$
^src/modules/previewpane/UnitTests-MarkdownPreviewHandler/HelperFiles/MarkdownWithHTMLImageTag\.txt$
^src/Monaco/
^src/common/sysinternals/Eula/
^tools/Verification scripts/Check preview handler registration\.ps1$
ignore$

166
.github/actions/spell-check/expect.txt поставляемый
Просмотреть файл

@ -15,6 +15,7 @@ AColumn
acrt
ACTIVATEAPP
activationaction
ADDSTRING
ADDUNDORECORD
ADifferent
adml
@ -27,8 +28,10 @@ AGGREGATABLE
ahk
AHybrid
akv
ALIGNRIGHT
ALarger
ALLAPPS
ALLCHILDREN
ALLINPUT
ALLOWUNDO
ALLVIEW
@ -39,6 +42,7 @@ AMPROPSETID
amr
ANDSCANS
animatedvisuals
Animnate
ansicolor
ANull
AOC
@ -69,6 +73,7 @@ ARemapped
ARPINSTALLLOCATION
ARPPRODUCTICON
ARRAYSIZE
ARROWKEYS
asf
AShortcut
ASingle
@ -86,9 +91,14 @@ atlstr
ATRIOX
aumid
Authenticode
AUTOBUDDY
AUTOCHECKBOX
AUTOHIDE
AUTOHSCROLL
AUTOMATIONPROPERTIES
AUTORADIOBUTTON
Autorun
AUTOTICKS
AUTOUPDATE
AValid
awakeness
@ -105,12 +115,17 @@ BIF
bigbar
bigobj
binlog
binres
BITMAPFILEHEADER
bitmapimage
BITMAPINFO
BITMAPINFOHEADER
Bitmaps
BITSPERPEL
BITSPIXEL
bla
BLACKFRAME
BLENDFUNCTION
Blockquotes
blogs
Blt
@ -143,6 +158,7 @@ BVal
BValue
byapp
BYPOSITION
CALCRECT
CALG
callbackptr
calpwstr
@ -171,6 +187,7 @@ CHANGECBCHAIN
changecursor
CHILDACTIVATE
CHILDWINDOW
CHOOSEFONT
cidl
cim
CImage
@ -209,6 +226,7 @@ colorformat
colorhistory
colorhistorylimit
COLORKEY
comctl
comdef
comdlg
comexp
@ -231,14 +249,17 @@ CONTEXTMENUHANDLER
CONTROLL
CONTROLPARENT
copiedcolorrepresentation
COPYPEN
COREWINDOW
cotaskmem
COULDNOT
countof
cph
cplusplus
CPower
cppwinrt
createdump
CREATEPROCESS
CREATESCHEDULEDTASK
CREATESTRUCT
CREATEWINDOWFAILED
@ -254,6 +275,8 @@ cso
CSRW
CStyle
CTest
CTEXT
CTLCOLORSTATIC
currentculture
CURRENTDIR
CURSORINFO
@ -313,10 +336,12 @@ DELA
DELETEDKEYIMAGE
DELETESCANS
deletethis
DEMOTYPE
DENORMAL
depersist
deprioritized
DESELECTOTHERS
DESIGNINFO
DESKTOPABSOLUTEEDITING
DESKTOPABSOLUTEPARSING
desktopshorcutinstalled
@ -331,12 +356,17 @@ DEVMON
devpkey
DEVSOURCE
DGR
DIALOGEX
DIIRFLAG
dimm
DISABLEASACTIONKEY
DISABLENOSCROLL
diskmgmt
DISPLAYCHANGE
DISPLAYCONFIG
DISPLAYFLAGS
DISPLAYFREQUENCY
DISPLAYORIENTATION
displayname
divyan
Dlg
@ -360,8 +390,11 @@ DRAWFRAME
drawingcolor
dreamsofameaningfullife
drivedetectionwarning
DROPFILES
dshow
DSTINVERT
DSurface
DTexture
DUMMYUNIONNAME
Dutil
DVASPECT
@ -398,12 +431,15 @@ EData
Edid
EDITKEYBOARD
EDITSHORTCUTS
EDITTEXT
EFile
ekus
emmintrin
Emoji
ENABLEDELAYEDEXPANSION
ENABLEDPOPUP
ENABLETAB
ENABLETEMPLATE
encodedlaunch
encryptor
endpointvolume
@ -423,8 +459,10 @@ ERRORTITLE
erwrite
ESettings
esrp
ETDT
etl
etw
eula
eurochange
eventlog
eventvwr
@ -454,6 +492,7 @@ exsb
exstyle
EXTENDEDKEY
EXTENDEDVERBS
EXTRALIGHT
EXTRINSICPROPERTIES
eyetracker
FANCYZONESDRAWLAYOUTTEST
@ -464,12 +503,14 @@ fff
FILEEXPLORER
FILEFLAGS
FILEFLAGSMASK
FILEINFOSIG
FILELOCKSMITH
FILELOCKSMITHCONTEXTMENU
FILELOCKSMITHEXT
FILELOCKSMITHLIBINTEROP
FILEMUSTEXIST
FILEOP
FILEOPENDIALOGOPTIONS
FILEOS
FILESUBTYPE
FILESYSPATH
@ -477,9 +518,11 @@ Filetime
FILEVERSION
Filtergraph
Filterkeyboard
FILTERMODE
Filterx
findfast
FIXEDFILEINFO
FIXEDSYS
flac
flyouts
FMask
@ -487,7 +530,10 @@ FOF
FOFX
FOLDERID
folderpath
FONTTYPE
FORCEFILESYSTEM
FORCEMINIMIZE
FORMATDLGORD
formatetc
FORPARSING
FRAMECHANGED
@ -504,18 +550,23 @@ GC'ed
GCLP
gdi
gdiplus
GDIPVER
GDISCALED
GEmoji
GETCLIENTAREAANIMATION
GETCURSEL
GETDESKWALLPAPER
GETDLGCODE
GETDPISCALEDSIZE
getfilesiginforedist
GETICON
GETHOTKEY
GETMINMAXINFO
GETNONCLIENTMETRICS
GETPROPERTYSTOREFLAGS
GETSCREENSAVERRUNNING
GETSECKEY
GETSTICKYKEYS
GETTEXTLENGTH
GHND
GMEM
@ -548,6 +599,7 @@ hbm
hbmp
hbr
HBRBACKGROUND
hbrush
hcblack
HCERTSTORE
HCRYPTHASH
@ -555,6 +607,7 @@ HCRYPTPROV
hcursor
hcwhite
hdc
hdr
hdrop
hdwwiz
Helpline
@ -567,6 +620,7 @@ Hiber
Hiberboot
HIBYTE
hicon
HIDEREADONLY
HIDEWINDOW
Hif
HIMAGELIST
@ -575,10 +629,12 @@ hinst
hinstance
HIWORD
HKCC
HKCOMB
HKCR
HKCU
hkey
HKLM
HKM
HKPD
HKU
HMD
@ -586,9 +642,11 @@ hmenu
hmodule
hmonitor
homljgmgpmcbpjbnjpfijnhipfkiclkd
HORZRES
HORZSIZE
Hostbackdropbrush
hotkeycontrol
HOTKEYF
hotkeys
hotlight
hotspot
@ -616,15 +674,19 @@ hwnd
HWNDFIRST
HWNDLAST
HWNDNEXT
HWNDPARENT
HWNDPREV
hyjiacan
IAI
IBeam
ICONERROR
ICONLOCATION
idc
IDCANCEL
IDD
idl
idlist
IDOK
IDR
IDXGI
ietf
@ -645,12 +707,15 @@ imageresizerinput
imageresizersettings
imagingdevices
ime
INCONTACT
Indo
inetcpl
Infobar
INFOEXAMPLE
Infotip
INITDIALOG
INITGUID
INITTOLOGFONTSTRUCT
inorder
INPC
inproc
@ -733,18 +798,23 @@ lcb
LCIDTo
Lclean
Ldone
Ldr
ldx
LEFTSCROLLBAR
LEFTTEXT
LError
LEVELID
LExit
lhwnd
LIBID
LIMITSIZE
LIMITTEXT
lindex
linkid
LINKOVERLAY
LINQTo
listview
LIVEZOOM
lld
LLKH
llkhf
@ -762,12 +832,15 @@ LOGFONT
LOGFONTW
logon
LOGPIXELSX
LOGPIXELSY
longdate
LONGLONG
LONGNAMES
lowlevel
LOWORD
lparam
LPBITMAPINFOHEADER
LPCFHOOKPROC
LPCITEMIDLIST
LPCLSID
lpcmi
@ -797,12 +870,15 @@ LPTSTR
LPW
lpwcx
lpwndpl
lpv
LReader
LRESULT
LSTATUS
lstrcmp
lstrcmpi
lstrcpyn
lstrlen
LTEXT
LTRB
LTRREADING
luid
@ -812,12 +888,16 @@ LVal
LWA
lwin
LZero
MAGTRANSFORM
majortype
makecab
MAKEINTRESOURCE
MAKEINTRESOURCEA
MAKEINTRESOURCEW
MAKELANGID
MAKELONG
MAKELPARAM
MAKEWPARAM
manifestdependency
MAPPEDTOSAMEKEY
MAPTOSAMESHORTCUT
@ -857,6 +937,7 @@ MINIMIZEBOX
MINIMIZEEND
MINIMIZESTART
miniz
MINMAXINFO
Mip
Miracast
mjpg
@ -870,6 +951,7 @@ mmi
mmsys
mmsystem
mockapi
MODALFRAME
MODESPRUNED
MONITORENUMPROC
MONITORINFO
@ -891,6 +973,7 @@ MRT
mru
msc
mscorlib
msctls
msdata
MSDL
msedge
@ -898,6 +981,7 @@ MSGFLT
msiexec
MSIFASTINSTALL
MSIHANDLE
Msimg
msiquery
MSIRESTARTMANAGERCONTROL
msixbundle
@ -909,6 +993,7 @@ msrc
msstore
mst
msvcp
msvsmon
MTND
MULTIPLEUSE
multizone
@ -958,33 +1043,40 @@ newsgroups
NIF
NLog
NLSTEXT
NMAKE
NNN
NOACTIVATE
NOAGGREGATION
NOASYNC
NOCLIP
NOCLOSEPROCESS
NOCOALESCE
NOCOMM
NOCONFIRMMKDIR
NOCOPYBITS
NOCOPYSECURITYATTRIBS
NOCRLF
nodeca
nodoc
NODRAWCAPTION
NODRAWICON
NOINHERITLAYOUT
NOINTERFACE
NOINVERT
NOLINKINFO
NOMCX
NOMINMAX
NOMIRRORBITMAP
NOMOVE
NONANTIALIASED
nonclient
NONCLIENTMETRICSW
NONELEVATED
NONINFRINGEMENT
nonstd
NOOWNERZORDER
NOPARENTNOTIFY
NOPREFIX
NOREDIRECTIONBITMAP
NOREDRAW
NOREMOVE
@ -997,6 +1089,8 @@ NORMALUSER
NOSEARCH
NOSENDCHANGING
NOSIZE
NOTHOUSANDS
NOTICKS
NOTIFICATIONSDLL
NOTIFYICONDATA
NOTIFYICONDATAW
@ -1006,6 +1100,7 @@ NOTOPMOST
NOTRACK
NOTSRCCOPY
NOTSRCERASE
NOTXORPEN
NOZORDER
NPH
npmjs
@ -1015,6 +1110,8 @@ NTAPI
ntdll
ntfs
NTSTATUS
NTSYSAPI
NULLCURSOR
nullonfailure
numberbox
nwc
@ -1023,6 +1120,7 @@ objidl
ocr
Ocrsettings
odbccp
OEMCONVERT
officehubintl
OFN
ofs
@ -1042,8 +1140,10 @@ ORPHANEDDIALOGTITLE
ORSCANS
oss
ostr
OSVERSIONINFO
OSVERSIONINFOEX
OSVERSIONINFOEXW
OSVERSIONINFOW
osvi
OUTOFCONTEXT
outpin
@ -1053,7 +1153,9 @@ outsettings
OVERLAPPEDWINDOW
overlaywindow
Oversampling
OVERWRITEPROMPT
OWNDC
OWNERDRAWFIXED
Packagemanager
PACL
PAINTSTRUCT
@ -1082,7 +1184,9 @@ PCIDLIST
PCTSTR
PCWSTR
pdbs
PDEVMODE
pdisp
PDLL
pdo
pdto
pdtobj
@ -1090,6 +1194,8 @@ pdw
Peb
PElems
Pels
PELSHEIGHT
PELSWIDTH
PERCEIVEDFLAG
perfmon
pesi
@ -1116,9 +1222,13 @@ ploc
ploca
plocm
pluginsmodel
PMAGTRANSFORM
PMSIHANDLE
pnid
PNMLINK
Pnp
POINTERID
POINTERUPDATE
Popups
POPUPWINDOW
POSITIONITEM
@ -1164,6 +1274,7 @@ PROCESSENTRY
PROCESSKEY
processthreadsapi
PROCESSTRACE
procmon
PRODEXT
PRODUCTVERSION
Progman
@ -1174,6 +1285,7 @@ PROPERTYKEY
propkey
PROPVARIANT
propvarutil
PRTL
prvpane
psapi
pscid
@ -1192,6 +1304,7 @@ PSYSTEM
psz
ptb
ptc
PTCHAR
ptd
PTOKEN
PToy
@ -1223,6 +1336,8 @@ RAWMODE
RAWPATH
rbhid
rclsid
RCZOOMIT
RDW
READMODE
READOBJECTS
recents
@ -1325,6 +1440,7 @@ SCID
Scip
scipbe
Scode
SCREENFONTS
screensaver
screenshots
scrollviewer
@ -1333,16 +1449,27 @@ SDKDDK
sdns
searchterm
SEARCHUI
SECONDARYDISPLAY
secpol
SELCHANGE
SENDCHANGE
sendvirtualinput
serverside
SETBUDDYINT
SETCONTEXT
SETCURSEL
setcursor
SETFOCUS
SETFOREGROUND
SETHOTKEY
SETICON
SETLOWPOWERACTIVE
SETPOWEROFFACTIVE
SETRANGE
SETREDRAW
SETRULES
SETSCREENSAVEACTIVE
SETSTICKYKEYS
SETTEXT
SETTINGCHANGE
SETTINGSCHANGED
@ -1352,6 +1479,7 @@ setvariable
SETWORKAREA
sfgao
SFGAOF
SHACF
SHANDLE
sharpkeys
SHCNE
@ -1389,6 +1517,7 @@ shortsplit
showcolorname
SHOWDEFAULT
SHOWELEVATIONPROMPT
SHOWMAGNIFIEDCURSOR
SHOWMAXIMIZED
SHOWMINIMIZED
SHOWMINNOACTIVE
@ -1463,6 +1592,7 @@ STATICEDGE
STATSTG
stdafx
STDAPI
stdc
stdcpplatest
STDMETHODCALLTYPE
STDMETHODIMP
@ -1470,8 +1600,10 @@ STGC
STGM
STGMEDIUM
sticpl
STICKYKEYS
stl
storelogo
stprintf
streamjsonrpc
STRINGIZE
stringtable
@ -1480,12 +1612,14 @@ Strm
strret
strsafe
strutil
stscanf
sttngs
Stubless
STYLECHANGED
STYLECHANGING
subkeys
sublang
SUBMODULEUPDATE
subquery
Superbar
sut
@ -1516,6 +1650,7 @@ SYSKEYUP
SYSLIB
SYSMENU
SYSTEMAPPS
SYSTEMMODAL
SYSTEMTIME
tailwindcss
tapp
@ -1530,9 +1665,18 @@ targetver
taskkill
taskschd
TCHAR
TCIF
TCITEM
TCN
Tcollab
tcs
tcscat
tcschr
tcscmp
tcscpy
tcsdup
tcslen
tcsrchr
TCustom
tdbuild
TDefault
@ -1543,6 +1687,7 @@ testprocess
TEXCOORD
TEXTEXTRACTOR
TEXTINCLUDE
tfopen
tgz
themeresources
THH
@ -1556,6 +1701,7 @@ timedate
timediff
timeunion
timeutil
TITLEBARINFO
Titlecase
tkcontrols
tkconverters
@ -1576,6 +1722,7 @@ touchpad
TRACEHANDLE
tracelogging
tracerpt
trackbar
trafficmanager
traies
transicc
@ -1586,6 +1733,7 @@ trx
tsa
Tsd
TServer
tstoi
TStr
tweakme
TWF
@ -1594,8 +1742,10 @@ TYPEKEYBOARD
TYPEMOUSE
TYPESHORTCUT
UAC
UACUI
UAL
uap
UBR
UCallback
udit
uefi
@ -1609,6 +1759,7 @@ ums
uncompilable
UNCPRIORITY
UNDNAME
unhiding
UNICODETEXT
uninstantiated
uniquifier
@ -1622,9 +1773,13 @@ unregistering
unremapped
unvirtualized
unwide
unzoom
UOffset
UOI
Updatelayout
UPDATENOW
UPDATEREGISTRY
updown
UPGRADINGPRODUCTCODE
Uptool
urld
@ -1639,7 +1794,7 @@ USRDLL
UType
uuidv
uwp
Uxtheme
uxtheme
vabdq
validmodulename
valuegenerator
@ -1650,6 +1805,7 @@ vcgtq
VCINSTALLDIR
Vcpkg
VCRT
VCENTER
vcruntime
vcvars
VDesktop
@ -1660,6 +1816,7 @@ VERBW
VERIFYCONTEXT
verrsrc
VERSIONINFO
VERTRES
VERTSIZE
VFT
vget
@ -1669,6 +1826,7 @@ VIDCAP
VIDEOINFOHEADER
viewmodel
vih
VIRTKEY
VIRTUALDESK
VISEGRADRELAY
visiblecolorformats
@ -1695,6 +1853,7 @@ vsonline
vstemplate
vstest
VSTHRD
vstprintf
VSTT
vswhere
Vtbl
@ -1711,6 +1870,7 @@ wcsicmp
wcsncpy
wcsnicmp
WDA
wdm
wdp
wdupenv
webbrowsers
@ -1731,6 +1891,7 @@ windef
windir
WINDOWCREATED
WINDOWEDGE
WINDOWINFO
WINDOWNAME
WINDOWPLACEMENT
WINDOWPOSCHANGED
@ -1847,4 +2008,7 @@ ZEROINIT
zonable
zoneset
Zoneszonabletester
Zoomin
zoomit
ZOOMITX
zzz

4
.github/actions/spell-check/patterns.txt поставляемый
Просмотреть файл

@ -231,3 +231,7 @@ _SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING
# ignore long runs of a single character:
\b([A-Za-z])\g{-1}{3,}\b
# ZoomIt menu items with accelerator keys
E&xit
St&yle

Просмотреть файл

@ -211,6 +211,10 @@
"PowerToys.ShortcutGuide.exe",
"PowerToys.ShortcutGuideModuleInterface.dll",
"PowerToys.ZoomIt.exe",
"PowerToys.ZoomItModuleInterface.dll",
"PowerToys.ZoomItSettingsInterop.dll",
"WinUI3Apps\\PowerToys.Settings.dll",
"WinUI3Apps\\PowerToys.Settings.exe"
],

Просмотреть файл

@ -130,6 +130,8 @@ Find My Mouse is based on Raymond Chen's SuperSonar.
Crop And Lock is based on the original work of Robert Mikhayelyan, with Program Manager support from [@kevinguo305](https://github.com/kevinguo305) - Kevin Guo.
ZoomIt's Video Recording Session code is based on Robert Mikhayelyan's https://github.com/robmikh/capturevideosample code.
### Microsoft InVEST team
This amazing team helped PowerToys develop PowerToys Run and Keyboard manager as well as update our Settings to v2. @alekhyareddy28, @arjunbalgovind, @jyuwono @laviusmotileng-ms, @ryanbodrug-microsoft, @saahmedm, @somil55, @traies, @udit3333
@ -169,6 +171,14 @@ Other contributors:
* Paul Schmitt - WWL
* And many other Users!
## ZoomIt original contributors
ZoomIt source code was originally implemented by [Sysinternals](https://sysinternals.com):
- [@markrussinovich](https://github.com/markrussinovich) - Mark Russinovich
- [@foxmsft](https://github.com/foxmsft) - Alex Mihaiuc
- [@johnstep](https://github.com/johnstep) - John Stephens
## PowerToys core team
- [@crutkas](https://github.com/crutkas/) - Clint Rutkas - Lead

Просмотреть файл

@ -977,6 +977,50 @@ _If you want to find diagnostic data events in the source code, these two links
</tr>
</table>
### ZoomIt
<table style="width:100%">
<tr>
<th>Event Name</th>
<th>Description</th>
</tr>
<tr>
<td>Microsoft.PowerToys.ZoomIt_EnableZoomIt</td>
<td>Triggered when ZoomIt is enabled/disabled.</td>
</tr>
<tr>
<td>Microsoft.PowerToys.ZoomIt_Started</td>
<td>Triggered when the ZoomIt process starts.</td>
</tr>
<tr>
<td>Microsoft.PowerToys.ZoomIt_ActivateBreak</td>
<td>Triggered when the Break mode is entered.</td>
</tr>
<tr>
<td>Microsoft.PowerToys.ZoomIt_ActivateDraw</td>
<td>Triggered when the Draw mode is entered.</td>
</tr>
<tr>
<td>Microsoft.PowerToys.ZoomIt_ActivateZoom</td>
<td>Triggered when the Zoom mode is entered.</td>
</tr>
<tr>
<td>Microsoft.PowerToys.ZoomIt_ActivateLiveZoom</td>
<td>Triggered when the Live Zoom mode is entered.</td>
</tr>
<tr>
<td>Microsoft.PowerToys.ZoomIt_ActivateDemoType</td>
<td>Triggered when the DemoType mode is entered.</td>
</tr>
<tr>
<td>Microsoft.PowerToys.ZoomIt_ActivateRecord</td>
<td>Triggered when the Record mode is entered.</td>
</tr>
<tr>
<td>Microsoft.PowerToys.ZoomIt_ActivateSnip</td>
<td>Triggered when the Snip mode is entered.</td>
</tr>
</table>
<!-- back up of table
<table style="width:100%">

Просмотреть файл

@ -628,6 +628,14 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AdvancedPaste.UnitTests", "
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AdvancedPaste.FuzzTests", "src\modules\AdvancedPaste\AdvancedPaste.FuzzTests\AdvancedPaste.FuzzTests.csproj", "{7F5B9557-5878-4438-A721-3E28296BA193}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ZoomIt", "ZoomIt", "{DD6E12FE-5509-4ABC-ACC2-3D6DC98A238C}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ZoomIt", "src\modules\ZoomIt\ZoomIt\ZoomIt.vcxproj", "{0A84F764-3A88-44CD-AA96-41BDBD48627B}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ZoomItModuleInterface", "src\modules\ZoomIt\ZoomItModuleInterface\ZoomItModuleInterface.vcxproj", "{E4585179-2AC1-4D5F-A3FF-CFC5392F694C}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ZoomItSettingsInterop", "src\modules\ZoomIt\ZoomItSettingsInterop\ZoomItSettingsInterop.vcxproj", "{CA7D8106-30B9-4AEC-9D05-B69B31B8C461}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|ARM64 = Debug|ARM64
@ -2790,6 +2798,42 @@ Global
{7F5B9557-5878-4438-A721-3E28296BA193}.Release|x64.Build.0 = Release|x64
{7F5B9557-5878-4438-A721-3E28296BA193}.Release|x86.ActiveCfg = Release|x64
{7F5B9557-5878-4438-A721-3E28296BA193}.Release|x86.Build.0 = Release|x64
{0A84F764-3A88-44CD-AA96-41BDBD48627B}.Debug|ARM64.ActiveCfg = Debug|ARM64
{0A84F764-3A88-44CD-AA96-41BDBD48627B}.Debug|ARM64.Build.0 = Debug|ARM64
{0A84F764-3A88-44CD-AA96-41BDBD48627B}.Debug|x64.ActiveCfg = Debug|x64
{0A84F764-3A88-44CD-AA96-41BDBD48627B}.Debug|x64.Build.0 = Debug|x64
{0A84F764-3A88-44CD-AA96-41BDBD48627B}.Debug|x86.ActiveCfg = Debug|x64
{0A84F764-3A88-44CD-AA96-41BDBD48627B}.Debug|x86.Build.0 = Debug|x64
{0A84F764-3A88-44CD-AA96-41BDBD48627B}.Release|ARM64.ActiveCfg = Release|ARM64
{0A84F764-3A88-44CD-AA96-41BDBD48627B}.Release|ARM64.Build.0 = Release|ARM64
{0A84F764-3A88-44CD-AA96-41BDBD48627B}.Release|x64.ActiveCfg = Release|x64
{0A84F764-3A88-44CD-AA96-41BDBD48627B}.Release|x64.Build.0 = Release|x64
{0A84F764-3A88-44CD-AA96-41BDBD48627B}.Release|x86.ActiveCfg = Release|x64
{0A84F764-3A88-44CD-AA96-41BDBD48627B}.Release|x86.Build.0 = Release|x64
{E4585179-2AC1-4D5F-A3FF-CFC5392F694C}.Debug|ARM64.ActiveCfg = Debug|ARM64
{E4585179-2AC1-4D5F-A3FF-CFC5392F694C}.Debug|ARM64.Build.0 = Debug|ARM64
{E4585179-2AC1-4D5F-A3FF-CFC5392F694C}.Debug|x64.ActiveCfg = Debug|x64
{E4585179-2AC1-4D5F-A3FF-CFC5392F694C}.Debug|x64.Build.0 = Debug|x64
{E4585179-2AC1-4D5F-A3FF-CFC5392F694C}.Debug|x86.ActiveCfg = Debug|x64
{E4585179-2AC1-4D5F-A3FF-CFC5392F694C}.Debug|x86.Build.0 = Debug|x64
{E4585179-2AC1-4D5F-A3FF-CFC5392F694C}.Release|ARM64.ActiveCfg = Release|ARM64
{E4585179-2AC1-4D5F-A3FF-CFC5392F694C}.Release|ARM64.Build.0 = Release|ARM64
{E4585179-2AC1-4D5F-A3FF-CFC5392F694C}.Release|x64.ActiveCfg = Release|x64
{E4585179-2AC1-4D5F-A3FF-CFC5392F694C}.Release|x64.Build.0 = Release|x64
{E4585179-2AC1-4D5F-A3FF-CFC5392F694C}.Release|x86.ActiveCfg = Release|x64
{E4585179-2AC1-4D5F-A3FF-CFC5392F694C}.Release|x86.Build.0 = Release|x64
{CA7D8106-30B9-4AEC-9D05-B69B31B8C461}.Debug|ARM64.ActiveCfg = Debug|ARM64
{CA7D8106-30B9-4AEC-9D05-B69B31B8C461}.Debug|ARM64.Build.0 = Debug|ARM64
{CA7D8106-30B9-4AEC-9D05-B69B31B8C461}.Debug|x64.ActiveCfg = Debug|x64
{CA7D8106-30B9-4AEC-9D05-B69B31B8C461}.Debug|x64.Build.0 = Debug|x64
{CA7D8106-30B9-4AEC-9D05-B69B31B8C461}.Debug|x86.ActiveCfg = Debug|x64
{CA7D8106-30B9-4AEC-9D05-B69B31B8C461}.Debug|x86.Build.0 = Debug|x64
{CA7D8106-30B9-4AEC-9D05-B69B31B8C461}.Release|ARM64.ActiveCfg = Release|ARM64
{CA7D8106-30B9-4AEC-9D05-B69B31B8C461}.Release|ARM64.Build.0 = Release|ARM64
{CA7D8106-30B9-4AEC-9D05-B69B31B8C461}.Release|x64.ActiveCfg = Release|x64
{CA7D8106-30B9-4AEC-9D05-B69B31B8C461}.Release|x64.Build.0 = Release|x64
{CA7D8106-30B9-4AEC-9D05-B69B31B8C461}.Release|x86.ActiveCfg = Release|x64
{CA7D8106-30B9-4AEC-9D05-B69B31B8C461}.Release|x86.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -3021,6 +3065,10 @@ Global
{0DB0F63A-D2F8-4DA3-A650-2D0B8724218E} = {CA716AE6-FE5C-40AC-BB8F-2C87912687AC}
{D5E5F5EA-1B6C-4A73-88BE-304F36C9E4EE} = {9873BA05-4C41-4819-9283-CF45D795431B}
{7F5B9557-5878-4438-A721-3E28296BA193} = {9873BA05-4C41-4819-9283-CF45D795431B}
{DD6E12FE-5509-4ABC-ACC2-3D6DC98A238C} = {4574FDD0-F61D-4376-98BF-E5A1262C11EC}
{0A84F764-3A88-44CD-AA96-41BDBD48627B} = {DD6E12FE-5509-4ABC-ACC2-3D6DC98A238C}
{E4585179-2AC1-4D5F-A3FF-CFC5392F694C} = {DD6E12FE-5509-4ABC-ACC2-3D6DC98A238C}
{CA7D8106-30B9-4AEC-9D05-B69B31B8C461} = {DD6E12FE-5509-4ABC-ACC2-3D6DC98A238C}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {C3A2F9D1-7930-4EF4-A6FC-7EE0A99821D0}

Просмотреть файл

@ -18,7 +18,7 @@ Microsoft PowerToys is a set of utilities for power users to tune and streamline
| [New+](https://aka.ms/PowerToysOverview_NewPlus) | [Peek](https://aka.ms/PowerToysOverview_Peek) | [Paste as Plain Text](https://aka.ms/PowerToysOverview_PastePlain) |
| [PowerRename](https://aka.ms/PowerToysOverview_PowerRename) | [PowerToys Run](https://aka.ms/PowerToysOverview_PowerToysRun) | [Quick Accent](https://aka.ms/PowerToysOverview_QuickAccent) |
| [Registry Preview](https://aka.ms/PowerToysOverview_RegistryPreview) | [Screen Ruler](https://aka.ms/PowerToysOverview_ScreenRuler) | [Shortcut Guide](https://aka.ms/PowerToysOverview_ShortcutGuide) |
| [Text Extractor](https://aka.ms/PowerToysOverview_TextExtractor) | [Workspaces](https://aka.ms/PowerToysOverview_Workspaces) |
| [Text Extractor](https://aka.ms/PowerToysOverview_TextExtractor) | [Workspaces](https://aka.ms/PowerToysOverview_Workspaces) | [ZoomIt](https://aka.ms/PowerToysOverview_PowerToysOverview_ZoomIt) |
## Installing and running Microsoft PowerToys

Просмотреть файл

@ -1128,7 +1128,7 @@ UINT __stdcall TerminateProcessesCA(MSIHANDLE hInstall)
}
processes.resize(bytes / sizeof(processes[0]));
std::array<std::wstring_view, 37> processesToTerminate = {
std::array<std::wstring_view, 38> processesToTerminate = {
L"PowerToys.PowerLauncher.exe",
L"PowerToys.Settings.exe",
L"PowerToys.AdvancedPaste.exe",
@ -1165,6 +1165,7 @@ UINT __stdcall TerminateProcessesCA(MSIHANDLE hInstall)
L"PowerToys.WorkspacesLauncherUI.exe",
L"PowerToys.WorkspacesEditor.exe",
L"PowerToys.WorkspacesWindowArranger.exe",
L"PowerToys.ZoomIt.exe",
L"PowerToys.exe",
};

Просмотреть файл

@ -31,6 +31,7 @@ namespace Common.UI
Dashboard,
AdvancedPaste,
Workspaces,
ZoomIt,
}
private static string SettingsWindowNameToString(SettingsWindow value)
@ -77,6 +78,8 @@ namespace Common.UI
return "AdvancedPaste";
case SettingsWindow.Workspaces:
return "Workspaces";
case SettingsWindow.ZoomIt:
return "ZoomIt";
default:
{
return string.Empty;

Просмотреть файл

@ -128,6 +128,10 @@ namespace winrt::PowerToys::GPOWrapper::implementation
{
return static_cast<GpoRuleConfigured>(powertoys_gpo::getConfiguredAdvancedPasteEnabledValue());
}
GpoRuleConfigured GPOWrapper::GetConfiguredZoomItEnabledValue()
{
return static_cast<GpoRuleConfigured>(powertoys_gpo::getConfiguredZoomItEnabledValue());
}
GpoRuleConfigured GPOWrapper::GetConfiguredMouseWithoutBordersEnabledValue()
{
return static_cast<GpoRuleConfigured>(powertoys_gpo::getConfiguredMouseWithoutBordersEnabledValue());

Просмотреть файл

@ -39,6 +39,7 @@ namespace winrt::PowerToys::GPOWrapper::implementation
static GpoRuleConfigured GetConfiguredShortcutGuideEnabledValue();
static GpoRuleConfigured GetConfiguredTextExtractorEnabledValue();
static GpoRuleConfigured GetConfiguredAdvancedPasteEnabledValue();
static GpoRuleConfigured GetConfiguredZoomItEnabledValue();
static GpoRuleConfigured GetConfiguredPeekEnabledValue();
static GpoRuleConfigured GetDisableNewUpdateToastValue();
static GpoRuleConfigured GetDisableAutomaticUpdateDownloadValue();

Просмотреть файл

@ -43,6 +43,7 @@ namespace PowerToys
static GpoRuleConfigured GetConfiguredShortcutGuideEnabledValue();
static GpoRuleConfigured GetConfiguredTextExtractorEnabledValue();
static GpoRuleConfigured GetConfiguredAdvancedPasteEnabledValue();
static GpoRuleConfigured GetConfiguredZoomItEnabledValue();
static GpoRuleConfigured GetConfiguredPeekEnabledValue();
static GpoRuleConfigured GetDisableNewUpdateToastValue();
static GpoRuleConfigured GetDisableAutomaticUpdateDownloadValue();

Просмотреть файл

@ -32,5 +32,6 @@ namespace ManagedCommon
ShortcutGuide,
PowerOCR,
Workspaces,
ZoomIt,
}
}

Просмотреть файл

@ -331,6 +331,15 @@ namespace PowerToysSettings
return static_cast<int>(m_json.GetNamedObject(L"properties").GetNamedObject(property_name).GetNamedNumber(L"value"));
}
std::optional<unsigned int> PowerToyValues::get_uint_value(std::wstring_view property_name) const
{
if (!has_property(m_json, property_name, json::JsonValueType::Number))
{
return std::nullopt;
}
return static_cast<unsigned int>(m_json.GetNamedObject(L"properties").GetNamedObject(property_name).GetNamedNumber(L"value"));
}
std::optional<std::wstring> PowerToyValues::get_string_value(std::wstring_view property_name) const
{
if (!has_property(m_json, property_name, json::JsonValueType::String))

Просмотреть файл

@ -83,6 +83,7 @@ namespace PowerToysSettings
std::optional<bool> get_bool_value(std::wstring_view property_name) const;
std::optional<int> get_int_value(std::wstring_view property_name) const;
std::optional<unsigned int> get_uint_value(std::wstring_view property_name) const;
std::optional<std::wstring> get_string_value(std::wstring_view property_name) const;
std::optional<json::JsonObject> get_json(std::wstring_view property_name) const;
json::JsonObject get_raw_json();

Просмотреть файл

@ -124,6 +124,10 @@ namespace CommonSharedConstants
const wchar_t SHOW_ENVIRONMENT_VARIABLES_EVENT[] = L"Local\\PowerToysEnvironmentVariables-ShowEnvironmentVariablesEvent-1021f616-e951-4d64-b231-a8f972159978";
const wchar_t SHOW_ENVIRONMENT_VARIABLES_ADMIN_EVENT[] = L"Local\\PowerToysEnvironmentVariables-EnvironmentVariablesAdminEvent-8c95d2ad-047c-49a2-9e8b-b4656326cfb2";
// Path to the events used by ZoomIt
const wchar_t ZOOMIT_REFRESH_SETTINGS_EVENT[] = L"Local\\PowerToysZoomIt-RefreshSettingsEvent-f053a563-d519-4b0d-8152-a54489c13324";
const wchar_t ZOOMIT_EXIT_EVENT[] = L"Local\\PowerToysZoomIt-ExitEvent-36641ce6-df02-4eac-abea-a3fbf9138220";
// Max DWORD for key code to disable keys.
const DWORD VK_DISABLED = 0x100;
}

Просмотреть файл

@ -76,6 +76,7 @@ struct LogSettings
inline const static std::wstring workspacesWindowArrangerLogPath = L"workspaces-window-arranger-log.txt";
inline const static std::string workspacesSnapshotToolLoggerName = "workspaces-snapshot-tool";
inline const static std::wstring workspacesSnapshotToolLogPath = L"workspaces-snapshot-tool-log.txt";
inline const static std::string zoomItLoggerName = "zoom-it";
inline const static int retention = 30;
std::wstring logLevel;
LogSettings();

Просмотреть файл

@ -0,0 +1,75 @@
Sysinternals Software License Terms
These license terms are an agreement between Sysinternals (a wholly owned subsidiary of Microsoft Corporation) and you. Please read them. They apply to the software you are downloading from technet.microsoft.com/sysinternals, which includes the media on which you received it, if any. The terms also apply to any Sysinternals
* updates,
* supplements,
* Internet-based services,
* and support services
for this software, unless other terms accompany those items. If so, those terms apply.
BY USING THE SOFTWARE, YOU ACCEPT THESE TERMS. IF YOU DO NOT ACCEPT THEM, DO NOT USE THE SOFTWARE.
If you comply with these license terms, you have the rights below.
Installation and User Rights
You may install and use any number of copies of the software on your devices.
Scope of License
The software is licensed, not sold. This agreement only gives you some rights to use the software. Sysinternals reserves all other rights. Unless applicable law gives you more rights despite this limitation, you may use the software only as expressly permitted in this agreement. In doing so, you must comply with any technical limitations in the software that only allow you to use it in certain ways. You may not
* work around any technical limitations in the software;
* reverse engineer, decompile or disassemble the software, except and only to the extent that applicable law expressly permits, despite this limitation;
* make more copies of the software than specified in this agreement or allowed by applicable law, despite this limitation;
* publish the software for others to copy;
* rent, lease or lend the software;
* transfer the software or this agreement to any third party; or
* use the software for commercial software hosting services.
Sensitive Information
Please be aware that, similar to other debug tools that capture “process state” information, files saved by Sysinternals tools may include personally identifiable or other sensitive information (such as usernames, passwords, paths to files accessed, and paths to registry accessed). By using this software, you acknowledge that you are aware of this and take sole responsibility for any personally identifiable or other sensitive information provided to Microsoft or any other party through your use of the software.
Documentation
Any person that has valid access to your computer or internal network may copy and use the documentation for your internal, reference purposes.
Export Restrictions
The software is subject to United States export laws and regulations. You must comply with all domestic and international export laws and regulations that apply to the software. These laws include restrictions on destinations, end users and end use. For additional information, see www.microsoft.com/exporting .
Support Services
Because this software is "as is," we may not provide support services for it.
Entire Agreement
This agreement, and the terms for supplements, updates, Internet-based services and support services that you use, are the entire agreement for the software and support services.
Applicable Law
United States . If you acquired the software in the United States , Washington state law governs the interpretation of this agreement and applies to claims for breach of it, regardless of conflict of laws principles. The laws of the state where you live govern all other claims, including claims under state consumer protection laws, unfair competition laws, and in tort.
Outside the United States . If you acquired the software in any other country, the laws of that country apply.
Legal Effect
This agreement describes certain legal rights. You may have other rights under the laws of your country. You may also have rights with respect to the party from whom you acquired the software. This agreement does not change your rights under the laws of your country if the laws of your country do not permit it to do so.
Disclaimer of Warranty
The software is licensed "as-is." You bear the risk of using it. Sysinternals gives no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this agreement cannot change. To the extent permitted under your local laws, sysinternals excludes the implied warranties of merchantability, fitness for a particular purpose and non-infringement.
Limitation on and Exclusion of Remedies and Damages
You can recover from sysinternals and its suppliers only direct damages up to U.S. $5.00. You cannot recover any other damages, including consequential, lost profits, special, indirect or incidental damages.
This limitation applies to
* anything related to the software, services, content (including code) on third party Internet sites, or third party programs; and
* claims for breach of contract, breach of warranty, guarantee or condition, strict liability, negligence, or other tort to the extent permitted by applicable law.
It also applies even if Sysinternals knew or should have known about the possibility of the damages. The above limitation or exclusion may not apply to you because your country may not allow the exclusion or limitation of incidental, consequential or other damages.
Please note: As this software is distributed in Quebec , Canada , some of the clauses in this agreement are provided below in French.
Remarque : Ce logiciel étant distribué au Québec, Canada, certaines des clauses dans ce contrat sont fournies ci-dessous en français.
EXONÉRATION DE GARANTIE. Le logiciel visé par une licence est offert « tel quel ». Toute utilisation de ce logiciel est à votre seule risque et péril. Sysinternals n'accorde aucune autre garantie expresse. Vous pouvez bénéficier de droits additionnels en vertu du droit local sur la protection dues consommateurs, que ce contrat ne peut modifier. La ou elles sont permises par le droit locale, les garanties implicites de qualité marchande, d'adéquation à un usage particulier et d'absence de contrefaçon sont exclues.
LIMITATION DES DOMMAGES-INTÉRÊTS ET EXCLUSION DE RESPONSABILITÉ POUR LES DOMMAGES. Vous pouvez obtenir de Sysinternals et de ses fournisseurs une indemnisation en cas de dommages directs uniquement à hauteur de 5,00 $ US. Vous ne pouvez prétendre à aucune indemnisation pour les autres dommages, y compris les dommages spéciaux, indirects ou accessoires et pertes de bénéfices.
Cette limitation concerne :
tout ce qui est relié au logiciel, aux services ou au contenu (y compris le code) figurant sur des sites Internet tiers ou dans des programmes tiers ; et
les réclamations au titre de violation de contrat ou de garantie, ou au titre de responsabilité stricte, de négligence ou d'une autre faute dans la limite autorisée par la loi en vigueur.
Elle s'applique également, même si Sysinternals connaissait ou devrait connaître l'éventualité d'un tel dommage. Si votre pays n'autorise pas l'exclusion ou la limitation de responsabilité pour les dommages indirects, accessoires ou de quelque nature que ce soit, il se peut que la limitation ou l'exclusion ci-dessus ne s'appliquera pas à votre égard.
EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous pourriez avoir d'autres droits prévus par les lois de votre pays. Le présent contrat ne modifie pas les droits que vous confèrent les lois de votre pays si celles-ci ne le permettent pas.

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Просмотреть файл

@ -0,0 +1,17 @@
#ifdef __cplusplus
extern "C" {
#endif
BOOL ShowEulaW( const TCHAR * ToolName, int *argc, PWCHAR argv[] );
BOOL ShowEula( const TCHAR * ToolName, int *argc, TCHAR *argv[] );
DWORD ShowEulaConsole();
void ShowEulaConsoleNoPrompt();
BOOL IsIoTEdition();
BOOL IsRemoteOnlyEdition();
BOOL IsRunningRemotely();
BOOL IsEulaAccepted(const TCHAR * ToolName, int *argc, PTCHAR argv[]);
#ifdef __cplusplus
}
#endif

Просмотреть файл

@ -0,0 +1,76 @@
{\rtf1\ansi\ansicpg1252\deff0\nouicompat\deflang1033{\fonttbl{\f0\fswiss\fprq2\fcharset0 Tahoma;}{\f1\fnil\fcharset0 Calibri;}}
{\colortbl ;\red0\green0\blue255;\red0\green0\blue0;}
{\*\generator Riched20 10.0.10240}\viewkind4\uc1
\pard\brdrb\brdrs\brdrw10\brsp20 \sb120\sa120\b\f0\fs24 SYSINTERNALS SOFTWARE LICENSE TERMS\fs28\par
\pard\sb120\sa120\b0\fs19 These license terms are an agreement between Sysinternals (a wholly owned subsidiary of Microsoft Corporation) and you. Please read them. They apply to the software you are downloading from Sysinternals.com, which includes the media on which you received it, if any. The terms also apply to any Sysinternals\par
\pard\fi-363\li720\sb120\sa120\tx720\'b7\tab updates,\par
\pard\fi-363\li720\sb120\sa120\'b7\tab supplements,\par
\'b7\tab Internet-based services, and \par
\'b7\tab support services\par
\pard\sb120\sa120 for this software, unless other terms accompany those items. If so, those terms apply.\par
\b BY USING THE SOFTWARE, YOU ACCEPT THESE TERMS. IF YOU DO NOT ACCEPT THEM, DO NOT USE THE SOFTWARE.\par
\pard\brdrt\brdrs\brdrw10\brsp20 \sb120\sa120 If you comply with these license terms, you have the rights below.\par
\pard\fi-357\li357\sb120\sa120\tx360\fs20 1.\tab\fs19 INSTALLATION AND USE RIGHTS. \b0 You may install and use any number of copies of the software on your devices.\b\par
\caps\fs20 2.\tab\fs19 Scope of License\caps0 .\b0 The software is licensed, not sold. This agreement only gives you some rights to use the software. Sysinternals reserves all other rights. Unless applicable law gives you more rights despite this limitation, you may use the software only as expressly permitted in this agreement. In doing so, you must comply with any technical limitations in the software that only allow you to use it in certain ways. You may not\b\par
\pard\fi-363\li720\sb120\sa120\tx720\b0\'b7\tab work around any technical limitations in the binary versions of the software;\par
\pard\fi-363\li720\sb120\sa120\'b7\tab reverse engineer, decompile or disassemble the binary versions of the software, except and only to the extent that applicable law expressly permits, despite this limitation;\par
\'b7\tab make more copies of the software than specified in this agreement or allowed by applicable law, despite this limitation;\par
\'b7\tab publish the software for others to copy;\par
\'b7\tab rent, lease or lend the software;\par
\'b7\tab transfer the software or this agreement to any third party; or\par
\'b7\tab use the software for commercial software hosting services.\par
\pard\fi-357\li357\sb120\sa120\tx360\b\fs20 3.\tab SENSITIVE INFORMATION. \b0 Please be aware that, similar to other debug tools that capture \ldblquote process state\rdblquote information, files saved by Sysinternals tools may include personally identifiable or other sensitive information (such as usernames, passwords, paths to files accessed, and paths to registry accessed). By using this software, you acknowledge that you are aware of this and take sole responsibility for any personally identifiable or other sensitive information provided to Microsoft or any other party through your use of the software.\b\par
5. \tab\fs19 DOCUMENTATION.\b0 Any person that has valid access to your computer or internal network may copy and use the documentation for your internal, reference purposes.\b\par
\caps\fs20 6.\tab\fs19 Export Restrictions\caps0 .\b0 The software is subject to United States export laws and regulations. You must comply with all domestic and international export laws and regulations that apply to the software. These laws include restrictions on destinations, end users and end use. For additional information, see {\cf1\ul{\field{\*\fldinst{HYPERLINK www.microsoft.com/exporting }}{\fldrslt{www.microsoft.com/exporting}}}}\cf1\ul\f0\fs19 <{{\field{\*\fldinst{HYPERLINK "http://www.microsoft.com/exporting"}}{\fldrslt{http://www.microsoft.com/exporting}}}}\f0\fs19 >\cf0\ulnone .\b\par
\caps\fs20 7.\tab\fs19 SUPPORT SERVICES.\caps0 \b0 Because this software is "as is," we may not provide support services for it.\b\par
\caps\fs20 8.\tab\fs19 Entire Agreement.\b0\caps0 This agreement, and the terms for supplements, updates, Internet-based services and support services that you use, are the entire agreement for the software and support services.\par
\pard\keepn\fi-360\li360\sb120\sa120\tx360\cf2\b\caps\fs20 9.\tab\fs19 Applicable Law\caps0 .\par
\pard\fi-363\li720\sb120\sa120\tx720\cf0\fs20 a.\tab\fs19 United States.\b0 If you acquired the software in the United States, Washington state law governs the interpretation of this agreement and applies to claims for breach of it, regardless of conflict of laws principles. The laws of the state where you live govern all other claims, including claims under state consumer protection laws, unfair competition laws, and in tort.\b\par
\pard\fi-363\li720\sb120\sa120\fs20 b.\tab\fs19 Outside the United States.\b0 If you acquired the software in any other country, the laws of that country apply.\b\par
\pard\fi-357\li357\sb120\sa120\tx360\caps\fs20 10.\tab\fs19 Legal Effect.\b0\caps0 This agreement describes certain legal rights. You may have other rights under the laws of your country. You may also have rights with respect to the party from whom you acquired the software. This agreement does not change your rights under the laws of your country if the laws of your country do not permit it to do so.\b\caps\par
\fs20 11.\tab\fs19 Disclaimer of Warranty.\caps0 \caps The software is licensed "as-is." You bear the risk of using it. SYSINTERNALS gives no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this agreement cannot change. To the extent permitted under your local laws, SYSINTERNALS excludes the implied warranties of merchantability, fitness for a particular purpose and non-infringement.\par
\pard\fi-360\li360\sb120\sa120\tx360\fs20 12.\tab\fs19 Limitation on and Exclusion of Remedies and Damages. You can recover from SYSINTERNALS and its suppliers only direct damages up to U.S. $5.00. You cannot recover any other damages, including consequential, lost profits, special, indirect or incidental damages.\par
\pard\li357\sb120\sa120\b0\caps0 This limitation applies to\par
\pard\fi-363\li720\sb120\sa120\tx720\'b7\tab anything related to the software, services, content (including code) on third party Internet sites, or third party programs; and\par
\pard\fi-363\li720\sb120\sa120\'b7\tab claims for breach of contract, breach of warranty, guarantee or condition, strict liability, negligence, or other tort to the extent permitted by applicable law.\par
\pard\li360\sb120\sa120 It also applies even if Sysinternals knew or should have known about the possibility of the damages. The above limitation or exclusion may not apply to you because your country may not allow the exclusion or limitation of incidental, consequential or other damages.\par
\pard\b Please note: As this software is distributed in Quebec, Canada, some of the clauses in this agreement are provided below in French.\par
\pard\sb240\lang1036 Remarque : Ce logiciel \'e9tant distribu\'e9 au Qu\'e9bec, Canada, certaines des clauses dans ce contrat sont fournies ci-dessous en fran\'e7ais.\par
\pard\sb120\sa120 EXON\'c9RATION DE GARANTIE.\b0 Le logiciel vis\'e9 par une licence est offert \'ab tel quel \'bb. Toute utilisation de ce logiciel est \'e0 votre seule risque et p\'e9ril. Sysinternals n'accorde aucune autre garantie expresse. Vous pouvez b\'e9n\'e9ficier de droits additionnels en vertu du droit local sur la protection dues consommateurs, que ce contrat ne peut modifier. La ou elles sont permises par le droit locale, les garanties implicites de qualit\'e9 marchande, d'ad\'e9quation \'e0 un usage particulier et d'absence de contrefa\'e7on sont exclues.\par
\pard\keepn\sb120\sa120\b LIMITATION DES DOMMAGES-INT\'c9R\'caTS ET EXCLUSION DE RESPONSABILIT\'c9 POUR LES DOMMAGES.\b0 Vous pouvez obtenir de Sysinternals et de ses fournisseurs une indemnisation en cas de dommages directs uniquement \'e0 hauteur de 5,00 $ US. Vous ne pouvez pr\'e9tendre \'e0 aucune indemnisation pour les autres dommages, y compris les dommages sp\'e9ciaux, indirects ou accessoires et pertes de b\'e9n\'e9fices.\par
\lang1033 Cette limitation concerne :\par
\pard\keepn\fi-360\li720\sb120\sa120\tx720\lang1036\'b7\tab tout ce qui est reli\'e9 au logiciel, aux services ou au contenu (y compris le code) figurant sur des sites Internet tiers ou dans des programmes tiers ; et\par
\pard\fi-363\li720\sb120\sa120\tx720\'b7\tab les r\'e9clamations au titre de violation de contrat ou de garantie, ou au titre de responsabilit\'e9 stricte, de n\'e9gligence ou d'une autre faute dans la limite autoris\'e9e par la loi en vigueur.\par
\pard\sb120\sa120 Elle s'applique \'e9galement, m\'eame si Sysinternals connaissait ou devrait conna\'eetre l'\'e9ventualit\'e9 d'un tel dommage. Si votre pays n'autorise pas l'exclusion ou la limitation de responsabilit\'e9 pour les dommages indirects, accessoires ou de quelque nature que ce soit, il se peut que la limitation ou l'exclusion ci-dessus ne s'appliquera pas \'e0 votre \'e9gard.\par
\b EFFET JURIDIQUE.\b0 Le pr\'e9sent contrat d\'e9crit certains droits juridiques. Vous pourriez avoir d'autres droits pr\'e9vus par les lois de votre pays. Le pr\'e9sent contrat ne modifie pas les droits que vous conf\'e8rent les lois de votre pays si celles-ci ne le permettent pas.\b\par
\pard\b0\fs20\lang1033\par
\pard\sa200\sl276\slmult1\f1\fs22\lang9\par
}

Просмотреть файл

@ -0,0 +1,24 @@
#include <Windows.h>
#include "WindowsVersions.h"
// Declared in wdm.h
typedef NTSYSAPI NTSTATUS (NTAPI *RtlGetVersionType)( PRTL_OSVERSIONINFOW );
DWORD GetWindowsBuild( DWORD* revision )
{
if( revision ) {
DWORD size = sizeof( *revision );
if( RegGetValueW( HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", L"UBR", RRF_RT_REG_DWORD, NULL, revision, &size ) != ERROR_SUCCESS ) {
*revision = 0;
}
}
RtlGetVersionType pRtlGetVersion = reinterpret_cast<RtlGetVersionType>(GetProcAddress( GetModuleHandleW( L"ntdll.dll" ), "RtlGetVersion" ));
RTL_OSVERSIONINFOW version;
pRtlGetVersion( &version );
return version.dwBuildNumber;
}

Просмотреть файл

@ -0,0 +1,32 @@
//----------------------------------------------------------------------
//
// WindowsVersions.h
//
// Provides helpers for Windows builds and versions.
//
//----------------------------------------------------------------------
#pragma once
#define BUILD_WINDOWS_SERVER_2008 6003
#define BUILD_WINDOWS_SERVER_2008_R2 7601
#define BUILD_WINDOWS_SERVER_2012 9200
#define BUILD_WINDOWS_8_1 9600
#define BUILD_WINDOWS_SERVER_2012_R2 9600
#define BUILD_WINDOWS_10_1507 10240
#define BUILD_WINDOWS_10_1607 14393
#define BUILD_WINDOWS_SERVER_2016 14393
#define BUILD_WINDOWS_10_1809 17763
#define BUILD_WINDOWS_SERVER_2019 17763
#define BUILD_WINDOWS_10_1903 18362
#define BUILD_WINDOWS_10_1909 18363
#define BUILD_WINDOWS_10_2004 19041
#define BUILD_WINDOWS_10_20H2 19042
#define BUILD_WINDOWS_SERVER_20H2 19042
#define BUILD_WINDOWS_10_21H1 19043
#define BUILD_WINDOWS_10_21H2 19044
#define BUILD_WINDOWS_SERVER_2022 20348
#define BUILD_WINDOWS_11_21H2 22000
#define BUILD_WINDOWS_11_22H2 22621
DWORD GetWindowsBuild( DWORD* revision );

Просмотреть файл

@ -0,0 +1,74 @@
//=========================================================================-==
//
// dll.c
//
// DLL support functions
//
//============================================================================
#include <windows.h>
#include <assert.h>
#include <tchar.h>
#include <stdlib.h>
#include "dll.h"
#ifndef LOAD_LIBRARY_SEARCH_SYSTEM32
#define LOAD_LIBRARY_SEARCH_SYSTEM32 0x800
#endif
//=========================================================================-==
//
// ExtendedFlagsSupported
//
// Returns TRUE if running on Windows 7 or later and FALSE otherwise
//
//============================================================================
static BOOLEAN ExtendedFlagsSupported()
{
OSVERSIONINFO osInfo;
BOOLEAN rc = FALSE;
ZeroMemory(&osInfo, sizeof(OSVERSIONINFO));
osInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
#pragma warning ( disable : 4996 ) // deprecated in favour of version helper functions which we can't use
if (GetVersionEx(&osInfo) && (osInfo.dwMajorVersion > 6 || (osInfo.dwMajorVersion == 6 && osInfo.dwMinorVersion > 0)))
rc = TRUE;
#pragma warning ( default : 4996 )
return rc;
}
//=========================================================================-==
//
// LoadLibrarySafe
//
// Loads a DLL from the system folder in a way that mitigates DLL spoofing /
// side-loading attacks
//
//============================================================================
HMODULE LoadLibrarySafe(LPCTSTR libraryName, DLL_LOAD_LOCATION location)
{
HMODULE hMod = NULL;
if (NULL == libraryName || location <= DLL_LOAD_LOCATION_MIN || location >= DLL_LOAD_LOCATION_MAX) {
SetLastError(ERROR_INVALID_PARAMETER);
return NULL;
}
// LOAD_LIBRARY_SEARCH_SYSTEM32 is only supported on Window 7 or later. On earlier SKUs we could use a fully
// qualified path to the system folder but specifying a path causes Ldr to skip SxS file redirection. This can
// cause the wrong library to be loaded if the application is using a manifest that defines a specific version
// of Microsoft.Windows.Common-Controls when loading comctl32.dll
if (DLL_LOAD_LOCATION_SYSTEM == location) {
DWORD flags = ExtendedFlagsSupported() ? LOAD_LIBRARY_SEARCH_SYSTEM32 : 0;
hMod = LoadLibraryEx(libraryName, NULL, flags);
}
return hMod;
}

Просмотреть файл

@ -0,0 +1,26 @@
//=========================================================================-==
//
// dll.h
//
// DLL support functions
//
//============================================================================
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
typedef enum
{
DLL_LOAD_LOCATION_MIN = 0,
DLL_LOAD_LOCATION_SYSTEM = 1,
DLL_LOAD_LOCATION_MAX
} DLL_LOAD_LOCATION, *PDLL_LOAD_LOCATION;
HMODULE LoadLibrarySafe(LPCTSTR libraryName, DLL_LOAD_LOCATION location);
#ifdef __cplusplus
}
#endif

Просмотреть файл

@ -53,6 +53,7 @@ namespace powertoys_gpo {
const std::wstring POLICY_CONFIGURE_ENABLED_SHORTCUT_GUIDE = L"ConfigureEnabledUtilityShortcutGuide";
const std::wstring POLICY_CONFIGURE_ENABLED_TEXT_EXTRACTOR = L"ConfigureEnabledUtilityTextExtractor";
const std::wstring POLICY_CONFIGURE_ENABLED_ADVANCED_PASTE = L"ConfigureEnabledUtilityAdvancedPaste";
const std::wstring POLICY_CONFIGURE_ENABLED_ZOOM_IT = L"ConfigureEnabledUtilityZoomIt";
const std::wstring POLICY_CONFIGURE_ENABLED_REGISTRY_PREVIEW = L"ConfigureEnabledUtilityRegistryPreview";
const std::wstring POLICY_CONFIGURE_ENABLED_MOUSE_WITHOUT_BORDERS = L"ConfigureEnabledUtilityMouseWithoutBorders";
const std::wstring POLICY_CONFIGURE_ENABLED_PEEK = L"ConfigureEnabledUtilityPeek";
@ -413,6 +414,11 @@ namespace powertoys_gpo {
return getUtilityEnabledValue(POLICY_CONFIGURE_ENABLED_WORKSPACES);
}
inline gpo_rule_configured_t getConfiguredZoomItEnabledValue()
{
return getUtilityEnabledValue(POLICY_CONFIGURE_ENABLED_ZOOM_IT);
}
inline gpo_rule_configured_t getConfiguredMouseWithoutBordersEnabledValue()
{
return getUtilityEnabledValue(POLICY_CONFIGURE_ENABLED_MOUSE_WITHOUT_BORDERS);

Просмотреть файл

@ -23,6 +23,7 @@
<definition name="SUPPORTED_POWERTOYS_0_84_0" displayName="$(string.SUPPORTED_POWERTOYS_0_84_0)"/>
<definition name="SUPPORTED_POWERTOYS_0_85_0" displayName="$(string.SUPPORTED_POWERTOYS_0_85_0)"/>
<definition name="SUPPORTED_POWERTOYS_0_86_0" displayName="$(string.SUPPORTED_POWERTOYS_0_86_0)"/>
<definition name="SUPPORTED_POWERTOYS_0_88_0" displayName="$(string.SUPPORTED_POWERTOYS_0_88_0)"/>
<definition name="SUPPORTED_POWERTOYS_0_64_0_TO_0_87_1" displayName="$(string.SUPPORTED_POWERTOYS_0_64_0_TO_0_87_1)"/>
</definitions>
</supportedOn>
@ -454,6 +455,16 @@
<decimal value="0" />
</disabledValue>
</policy>
<policy name="ConfigureEnabledUtilityZoomIt" class="Both" displayName="$(string.ConfigureEnabledUtilityZoomIt)" explainText="$(string.ConfigureEnabledUtilityDescription)" key="Software\Policies\PowerToys" valueName="ConfigureEnabledUtilityZoomIt">
<parentCategory ref="PowerToys" />
<supportedOn ref="SUPPORTED_POWERTOYS_0_88_0" />
<enabledValue>
<decimal value="1" />
</enabledValue>
<disabledValue>
<decimal value="0" />
</disabledValue>
</policy>
<policy name="DisablePerUserInstallation" class="Machine" displayName="$(string.DisablePerUserInstallation)" explainText="$(string.DisablePerUserInstallationDescription)" key="Software\Policies\PowerToys" valueName="PerUserInstallationDisabled">
<parentCategory ref="InstallerUpdates" />
<supportedOn ref="SUPPORTED_POWERTOYS_0_69_0" />

Просмотреть файл

@ -30,6 +30,7 @@
<string id="SUPPORTED_POWERTOYS_0_84_0">PowerToys version 0.84.0 or later</string>
<string id="SUPPORTED_POWERTOYS_0_85_0">PowerToys version 0.85.0 or later</string>
<string id="SUPPORTED_POWERTOYS_0_86_0">PowerToys version 0.86.0 or later</string>
<string id="SUPPORTED_POWERTOYS_0_88_0">PowerToys version 0.88.0 or later</string>
<string id="SUPPORTED_POWERTOYS_0_64_0_TO_0_87_1">From PowerToys version 0.64.0 until PowerToys version 0.87.1</string>
<string id="ConfigureAllUtilityGlobalEnabledStateDescription">This policy configures the enabled state for all PowerToys utilities.
@ -247,6 +248,7 @@ If you don't configure this policy, the user takes control over the setting and
<string id="ConfigureEnabledUtilityShortcutGuide">Shortcut Guide: Configure enabled state</string>
<string id="ConfigureEnabledUtilityTextExtractor">Text Extractor: Configure enabled state</string>
<string id="ConfigureEnabledUtilityVideoConferenceMute">Video Conference Mute: Configure enabled state</string>
<string id="ConfigureEnabledUtilityZoomIt">Zoom It: Configure enabled state</string>
<string id="DisablePerUserInstallation">Disable per-user installation</string>
<string id="DisableAutomaticUpdateDownload">Disable automatic downloads</string>
<string id="DoNotShowWhatsNewAfterUpdates">Do not show the release notes after updates</string>

Просмотреть файл

@ -159,7 +159,7 @@
<Import Project="..\..\..\..\deps\spdlog.props" />
<ImportGroup Label="ExtensionTargets">
<Import Project="..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.targets')" />
<Import Project="..\..\..\..\packages\robmikh.common.0.0.22-beta\build\native\robmikh.common.targets" Condition="Exists('..\..\..\..\packages\robmikh.common.0.0.22-beta\build\native\robmikh.common.targets')" />
<Import Project="..\..\..\..\packages\robmikh.common.0.0.23-beta\build\native\robmikh.common.targets" Condition="Exists('..\..\..\..\packages\robmikh.common.0.0.23-beta\build\native\robmikh.common.targets')" />
<Import Project="..\..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.231216.1\build\native\Microsoft.Windows.ImplementationLibrary.targets" Condition="Exists('..\..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.231216.1\build\native\Microsoft.Windows.ImplementationLibrary.targets')" />
</ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
@ -168,7 +168,7 @@
</PropertyGroup>
<Error Condition="!Exists('..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.props'))" />
<Error Condition="!Exists('..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.targets'))" />
<Error Condition="!Exists('..\..\..\..\packages\robmikh.common.0.0.22-beta\build\native\robmikh.common.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\robmikh.common.0.0.22-beta\build\native\robmikh.common.targets'))" />
<Error Condition="!Exists('..\..\..\..\packages\robmikh.common.0.0.23-beta\build\native\robmikh.common.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\robmikh.common.0.0.23-beta\build\native\robmikh.common.targets'))" />
<Error Condition="!Exists('..\..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.231216.1\build\native\Microsoft.Windows.ImplementationLibrary.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.231216.1\build\native\Microsoft.Windows.ImplementationLibrary.targets'))" />
</Target>
</Project>

Просмотреть файл

@ -2,5 +2,5 @@
<packages>
<package id="Microsoft.Windows.CppWinRT" version="2.0.240111.5" targetFramework="native" />
<package id="Microsoft.Windows.ImplementationLibrary" version="1.0.231216.1" targetFramework="native" />
<package id="robmikh.common" version="0.0.22-beta" targetFramework="native" />
<package id="robmikh.common" version="0.0.23-beta" targetFramework="native" />
</packages>

Просмотреть файл

@ -52,13 +52,13 @@
// robmikh.common
#include <robmikh.common/composition.interop.h>
#include <robmikh.common/direct3d11.interop.h>
#include <robmikh.common/d3dHelpers.h>
#include <robmikh.common/d3d11Helpers.h>
#include <robmikh.common/graphics.interop.h>
// robmikh.common needs to be updated to support newer versions of C++/WinRT https://github.com/robmikh/robmikh.common/issues/2
// Applying workaround from https://github.com/robmikh/Win32CaptureSample/commit/fc758e343ca886795b05af5003d9a3bb85ff4da2
// #include <robmikh.common/dispatcherQueue.desktop.interop.h>
#include "DispatcherQueue.desktop.interop.h"
#include <robmikh.common/d3dHelpers.desktop.h>
#include <robmikh.common/d3d11Helpers.desktop.h>
#include <robmikh.common/composition.desktop.interop.h>
#include <robmikh.common/hwnd.interop.h>
#include <robmikh.common/capture.desktop.interop.h>

Просмотреть файл

@ -102,7 +102,7 @@
<ImportGroup Label="ExtensionTargets">
<Import Project="..\..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.211019.2\build\native\Microsoft.Windows.ImplementationLibrary.targets" Condition="Exists('..\..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.211019.2\build\native\Microsoft.Windows.ImplementationLibrary.targets')" />
<Import Project="..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.targets')" />
<Import Project="..\..\..\..\packages\robmikh.common.0.0.22-beta\build\native\robmikh.common.targets" Condition="Exists('..\..\..\..\packages\robmikh.common.0.0.22-beta\build\native\robmikh.common.targets')" />
<Import Project="..\..\..\..\packages\robmikh.common.0.0.23-beta\build\native\robmikh.common.targets" Condition="Exists('..\..\..\..\packages\robmikh.common.0.0.23-beta\build\native\robmikh.common.targets')" />
<Import Project="..\..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.231216.1\build\native\Microsoft.Windows.ImplementationLibrary.targets" Condition="Exists('..\..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.231216.1\build\native\Microsoft.Windows.ImplementationLibrary.targets')" />
</ImportGroup>
<Import Project="..\..\..\..\deps\spdlog.props" />
@ -112,7 +112,7 @@
</PropertyGroup>
<Error Condition="!Exists('..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.props'))" />
<Error Condition="!Exists('..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.targets'))" />
<Error Condition="!Exists('..\..\..\..\packages\robmikh.common.0.0.22-beta\build\native\robmikh.common.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\robmikh.common.0.0.22-beta\build\native\robmikh.common.targets'))" />
<Error Condition="!Exists('..\..\..\..\packages\robmikh.common.0.0.23-beta\build\native\robmikh.common.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\robmikh.common.0.0.23-beta\build\native\robmikh.common.targets'))" />
<Error Condition="!Exists('..\..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.231216.1\build\native\Microsoft.Windows.ImplementationLibrary.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.231216.1\build\native\Microsoft.Windows.ImplementationLibrary.targets'))" />
</Target>
</Project>

Просмотреть файл

@ -0,0 +1,168 @@
#include "pch.h"
#include "AudioSampleGenerator.h"
#include "CaptureFrameWait.h"
extern TCHAR g_MicrophoneDeviceId[];
namespace winrt
{
using namespace Windows::Foundation;
using namespace Windows::Storage;
using namespace Windows::Storage::Streams;
using namespace Windows::Media;
using namespace Windows::Media::Audio;
using namespace Windows::Media::Capture;
using namespace Windows::Media::Core;
using namespace Windows::Media::Render;
using namespace Windows::Media::MediaProperties;
using namespace Windows::Media::Devices;
using namespace Windows::Devices::Enumeration;
}
AudioSampleGenerator::AudioSampleGenerator()
{
m_audioEvent.create(wil::EventOptions::ManualReset);
m_endEvent.create(wil::EventOptions::ManualReset);
m_asyncInitialized.create(wil::EventOptions::ManualReset);
}
AudioSampleGenerator::~AudioSampleGenerator()
{
Stop();
if (m_started.load())
{
m_audioGraph.Close();
}
}
winrt::IAsyncAction AudioSampleGenerator::InitializeAsync()
{
auto expected = false;
if (m_initialized.compare_exchange_strong(expected, true))
{
// Initialize the audio graph
auto audioGraphSettings = winrt::AudioGraphSettings(winrt::AudioRenderCategory::Media);
auto audioGraphResult = co_await winrt::AudioGraph::CreateAsync(audioGraphSettings);
if (audioGraphResult.Status() != winrt::AudioGraphCreationStatus::Success)
{
throw winrt::hresult_error(E_FAIL, L"Failed to initialize AudioGraph!");
}
m_audioGraph = audioGraphResult.Graph();
// Initialize the selected microphone
auto defaultMicrophoneId = winrt::MediaDevice::GetDefaultAudioCaptureId(winrt::AudioDeviceRole::Default);
auto microphoneId = (g_MicrophoneDeviceId[0] == 0) ? defaultMicrophoneId : winrt::to_hstring(g_MicrophoneDeviceId);
auto microphone = co_await winrt::DeviceInformation::CreateFromIdAsync(microphoneId);
// Initialize audio input and output nodes
auto inputNodeResult = co_await m_audioGraph.CreateDeviceInputNodeAsync(winrt::MediaCategory::Media, m_audioGraph.EncodingProperties(), microphone);
if (inputNodeResult.Status() != winrt::AudioDeviceNodeCreationStatus::Success && microphoneId != defaultMicrophoneId)
{
// If the selected microphone failed, try again with the default
microphone = co_await winrt::DeviceInformation::CreateFromIdAsync(defaultMicrophoneId);
inputNodeResult = co_await m_audioGraph.CreateDeviceInputNodeAsync(winrt::MediaCategory::Media, m_audioGraph.EncodingProperties(), microphone);
}
if (inputNodeResult.Status() != winrt::AudioDeviceNodeCreationStatus::Success)
{
throw winrt::hresult_error(E_FAIL, L"Failed to initialize input audio node!");
}
m_audioInputNode = inputNodeResult.DeviceInputNode();
m_audioOutputNode = m_audioGraph.CreateFrameOutputNode();
// Hookup audio nodes
m_audioInputNode.AddOutgoingConnection(m_audioOutputNode);
m_audioGraph.QuantumStarted({ this, &AudioSampleGenerator::OnAudioQuantumStarted });
m_asyncInitialized.SetEvent();
}
}
winrt::AudioEncodingProperties AudioSampleGenerator::GetEncodingProperties()
{
CheckInitialized();
return m_audioOutputNode.EncodingProperties();
}
std::optional<winrt::MediaStreamSample> AudioSampleGenerator::TryGetNextSample()
{
CheckInitialized();
CheckStarted();
{
auto lock = m_lock.lock_exclusive();
if (m_samples.empty() && m_endEvent.is_signaled())
{
return std::nullopt;
}
else if (!m_samples.empty())
{
std::optional result(m_samples.front());
m_samples.pop_front();
return result;
}
}
m_audioEvent.ResetEvent();
std::vector<HANDLE> events = { m_endEvent.get(), m_audioEvent.get() };
auto waitResult = WaitForMultipleObjectsEx(static_cast<DWORD>(events.size()), events.data(), false, INFINITE, false);
auto eventIndex = -1;
switch (waitResult)
{
case WAIT_OBJECT_0:
case WAIT_OBJECT_0 + 1:
eventIndex = waitResult - WAIT_OBJECT_0;
break;
}
WINRT_VERIFY(eventIndex >= 0);
auto signaledEvent = events[eventIndex];
if (signaledEvent == m_endEvent.get())
{
return std::nullopt;
}
else
{
auto lock = m_lock.lock_exclusive();
std::optional result(m_samples.front());
m_samples.pop_front();
return result;
}
}
void AudioSampleGenerator::Start()
{
CheckInitialized();
auto expected = false;
if (m_started.compare_exchange_strong(expected, true))
{
m_audioGraph.Start();
}
}
void AudioSampleGenerator::Stop()
{
CheckInitialized();
if (m_started.load())
{
m_asyncInitialized.wait();
m_audioGraph.Stop();
m_endEvent.SetEvent();
}
}
void AudioSampleGenerator::OnAudioQuantumStarted(winrt::AudioGraph const& sender, winrt::IInspectable const& args)
{
{
auto lock = m_lock.lock_exclusive();
auto frame = m_audioOutputNode.GetFrame();
std::optional<winrt::TimeSpan> timestamp = frame.RelativeTime();
auto audioBuffer = frame.LockBuffer(winrt::AudioBufferAccessMode::Read);
auto sampleBuffer = winrt::Buffer::CreateCopyFromMemoryBuffer(audioBuffer);
sampleBuffer.Length(audioBuffer.Length());
auto sample = winrt::MediaStreamSample::CreateFromBuffer(sampleBuffer, timestamp.value());
m_samples.push_back(sample);
}
m_audioEvent.SetEvent();
}

Просмотреть файл

@ -0,0 +1,48 @@
#pragma once
class AudioSampleGenerator
{
public:
AudioSampleGenerator();
~AudioSampleGenerator();
winrt::Windows::Foundation::IAsyncAction InitializeAsync();
winrt::Windows::Media::MediaProperties::AudioEncodingProperties GetEncodingProperties();
std::optional<winrt::Windows::Media::Core::MediaStreamSample> TryGetNextSample();
void Start();
void Stop();
private:
void OnAudioQuantumStarted(
winrt::Windows::Media::Audio::AudioGraph const& sender,
winrt::Windows::Foundation::IInspectable const& args);
void CheckInitialized()
{
if (!m_initialized.load())
{
throw winrt::hresult_error(E_FAIL, L"Must initialize audio sample generator before use!");
}
}
void CheckStarted()
{
if (!m_started.load())
{
throw winrt::hresult_error(E_FAIL, L"Must start audio sample generator before calling this method!");
}
}
private:
winrt::Windows::Media::Audio::AudioGraph m_audioGraph{ nullptr };
winrt::Windows::Media::Audio::AudioDeviceInputNode m_audioInputNode{ nullptr };
winrt::Windows::Media::Audio::AudioFrameOutputNode m_audioOutputNode{ nullptr };
wil::srwlock m_lock;
wil::unique_event m_audioEvent;
wil::unique_event m_endEvent;
wil::unique_event m_asyncInitialized;
std::deque<winrt::Windows::Media::Core::MediaStreamSample> m_samples;
std::atomic<bool> m_initialized = false;
std::atomic<bool> m_started = false;
};

Просмотреть файл

@ -0,0 +1,147 @@
//==============================================================================
//
// Zoomit
// Sysinternals - www.sysinternals.com
//
// Video capture code derived from https://github.com/robmikh/capturevideosample
//
//==============================================================================
#include "pch.h"
#include "CaptureFrameWait.h"
namespace winrt
{
using namespace Windows::Foundation;
using namespace Windows::Graphics;
using namespace Windows::Graphics::Capture;
using namespace Windows::Graphics::DirectX;
using namespace Windows::Graphics::DirectX::Direct3D11;
using namespace Windows::Storage;
using namespace Windows::UI::Composition;
}
namespace util
{
using namespace robmikh::common::uwp;
}
//----------------------------------------------------------------------------
//
// CaptureFrameWait::CaptureFrameWait
//
//----------------------------------------------------------------------------
CaptureFrameWait::CaptureFrameWait(
winrt::IDirect3DDevice const& device,
winrt::GraphicsCaptureItem const& item,
winrt::SizeInt32 const& size)
{
m_device = device;
m_item = item;
m_nextFrameEvent = wil::shared_event(wil::EventOptions::ManualReset);
m_endEvent = wil::shared_event(wil::EventOptions::ManualReset);
m_closedEvent = wil::shared_event(wil::EventOptions::ManualReset);
m_framePool = winrt::Direct3D11CaptureFramePool::CreateFreeThreaded(
m_device,
winrt::DirectXPixelFormat::B8G8R8A8UIntNormalized,
1,
size);
m_session = m_framePool.CreateCaptureSession(m_item);
m_framePool.FrameArrived({ this, &CaptureFrameWait::OnFrameArrived });
m_session.StartCapture();
}
//----------------------------------------------------------------------------
//
// CaptureFrameWait::~CaptureFrameWait
//
//----------------------------------------------------------------------------
CaptureFrameWait::~CaptureFrameWait()
{
StopCapture();
// We might end the capture before we ever get another frame.
m_closedEvent.wait(200);
}
//----------------------------------------------------------------------------
//
// CaptureFrameWait::TryGetNextFrame
//
// Fetches next available frame
//
//----------------------------------------------------------------------------
std::optional<CaptureFrame> CaptureFrameWait::TryGetNextFrame()
{
if (m_currentFrame != nullptr)
{
m_currentFrame.Close();
}
m_nextFrameEvent.ResetEvent();
std::vector<HANDLE> events = { m_endEvent.get(), m_nextFrameEvent.get() };
auto waitResult = WaitForMultipleObjectsEx(static_cast<DWORD>(events.size()), events.data(), false, INFINITE, false);
auto eventIndex = -1;
switch (waitResult)
{
case WAIT_OBJECT_0:
case WAIT_OBJECT_0 + 1:
eventIndex = waitResult - WAIT_OBJECT_0;
break;
}
WINRT_VERIFY(eventIndex >= 0);
auto signaledEvent = events[eventIndex];
if (signaledEvent == m_endEvent.get())
{
return std::nullopt;
}
return std::optional<CaptureFrame>(
{
m_currentFrame.Surface(),
m_currentFrame.ContentSize(),
m_currentFrame.SystemRelativeTime(),
});
}
//----------------------------------------------------------------------------
//
// CaptureFrameWait::StopCapture
//
// Stops frame capture and notified any frame waiters
//
//----------------------------------------------------------------------------
void CaptureFrameWait::StopCapture()
{
auto lock = m_lock.lock_exclusive();
m_endEvent.SetEvent();
m_framePool.Close();
m_session.Close();
}
//----------------------------------------------------------------------------
//
// CaptureFrameWait::OnFrameArrived
//
// Callback for new frames
//
//----------------------------------------------------------------------------
void CaptureFrameWait::OnFrameArrived(
winrt::Direct3D11CaptureFramePool const& sender,
winrt::IInspectable const&)
{
auto lock = m_lock.lock_exclusive();
if (m_endEvent.is_signaled())
{
m_closedEvent.SetEvent();
return;
}
auto frame = sender.TryGetNextFrame();
if( frame ) {
m_currentFrame = frame;
m_nextFrameEvent.SetEvent();
}
}

Просмотреть файл

@ -0,0 +1,142 @@
//==============================================================================
//
// Zoomit
// Sysinternals - www.sysinternals.com
//
// Video capture code derived from https://github.com/robmikh/capturevideosample
//
//==============================================================================
#pragma once
// Must come before C++/WinRT
#include <wil/cppwinrt.h>
// WinRT
#include <winrt/Windows.Foundation.h>
#include <winrt/Windows.Foundation.Collections.h>
#include <winrt/Windows.Foundation.Metadata.h>
#include <winrt/Windows.Foundation.Numerics.h>
#include <winrt/Windows.System.h>
#include <winrt/Windows.UI.h>
#include <winrt/Windows.UI.Composition.h>
#include <winrt/Windows.UI.Composition.Desktop.h>
#include <winrt/Windows.UI.Popups.h>
#include <winrt/Windows.Graphics.Capture.h>
#include <winrt/Windows.Graphics.DirectX.h>
#include <winrt/Windows.Graphics.DirectX.Direct3d11.h>
#include <winrt/Windows.Media.h>
#include <winrt/Windows.Media.Audio.h>
#include <winrt/Windows.Media.Core.h>
#include <winrt/Windows.Media.Render.h>
#include <winrt/Windows.Media.Transcoding.h>
#include <winrt/Windows.Media.MediaProperties.h>
#include <winrt/Windows.Storage.h>
#include <winrt/Windows.Storage.Streams.h>
#include <winrt/Windows.Storage.Pickers.h>
// WIL
#include <wil/resource.h>
// DirectX
#include <d3d11_4.h>
#include <dxgi1_6.h>
#include <d2d1_3.h>
#include <wincodec.h>
// STL
#include <vector>
#include <string>
#include <atomic>
#include <memory>
#include <algorithm>
#include <filesystem>
#include <array>
#include <thread>
#include <functional>
#include <optional>
#include <chrono>
#include <mutex>
#include <deque>
// robmikh.common
#include <robmikh.common/composition.interop.h>
#include <robmikh.common/direct3d11.interop.h>
#include <robmikh.common/d3d11Helpers.h>
#include <robmikh.common/graphics.interop.h>
#include <robmikh.common/dispatcherQueue.desktop.interop.h>
#include <robmikh.common/d3d11Helpers.desktop.h>
#include <robmikh.common/composition.desktop.interop.h>
#include <robmikh.common/hwnd.interop.h>
#include <robmikh.common/capture.desktop.interop.h>
#include <robmikh.common/DesktopWindow.h>
namespace winrt
{
using namespace Windows::Foundation;
using namespace Windows::Foundation::Metadata;
using namespace Windows::Graphics;
using namespace Windows::Graphics::Capture;
using namespace Windows::Graphics::DirectX;
using namespace Windows::Graphics::DirectX::Direct3D11;
using namespace Windows::Storage;
using namespace Windows::UI::Composition;
using namespace Windows::Media::Core;
using namespace Windows::Media::Transcoding;
using namespace Windows::Media::MediaProperties;
}
namespace util
{
using namespace robmikh::common::uwp;
}
struct CaptureFrame
{
winrt::Direct3D11::IDirect3DSurface FrameTexture;
winrt::SizeInt32 ContentSize;
winrt::TimeSpan SystemRelativeTime;
};
class CaptureFrameWait
{
public:
CaptureFrameWait(
winrt::Direct3D11::IDirect3DDevice const& device,
winrt::GraphicsCaptureItem const& item,
winrt::SizeInt32 const& size );
~CaptureFrameWait();
std::optional<CaptureFrame> TryGetNextFrame();
void StopCapture();
void EnableCursorCapture( bool enable = true )
{
if( winrt::ApiInformation::IsPropertyPresent( winrt::name_of<decltype(m_session)>(), L"IsCursorCaptureEnabled" ) )
{
m_session.IsCursorCaptureEnabled( enable );
}
}
void ShowCaptureBorder( bool show = true )
{
if( winrt::ApiInformation::IsPropertyPresent( winrt::name_of<decltype(m_session)>(), L"IsBorderRequired" ) )
{
m_session.IsBorderRequired( show );
}
}
private:
void OnFrameArrived(
winrt::Direct3D11CaptureFramePool const& sender,
winrt::IInspectable const& args );
private:
winrt::Direct3D11::IDirect3DDevice m_device{ nullptr };
winrt::GraphicsCaptureItem m_item{ nullptr };
winrt::Direct3D11CaptureFramePool m_framePool{ nullptr };
winrt::GraphicsCaptureSession m_session{ nullptr };
wil::shared_event m_nextFrameEvent;
wil::shared_event m_endEvent;
wil::shared_event m_closedEvent;
wil::srwlock m_lock;
winrt::Direct3D11CaptureFrame m_currentFrame{ nullptr };
};

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -0,0 +1,26 @@
//============================================================================
//
// Zoomit
// Copyright (C) Mark Russinovich
// Sysinternals - www.sysinternals.com
//
// DemoType allows the presenter to synthesize keystrokes from a script
//
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
//============================================================================
#pragma once
#define MAX_INPUT_SIZE 1048576 // 1 MiB
#define MAX_TYPING_SPEED 10 // ms
#define MIN_TYPING_SPEED 100 // ms
#define ERROR_LOADING_FILE 1
#define NO_FILE_SPECIFIED 2
#define FILE_SIZE_OVERFLOW 3
#define UNKNOWN_FILE_DATA 4
void ResetDemoTypeIndex();
int StartDemoType( const TCHAR* filePath, const DWORD speedSlider, const BOOLEAN userDriven );

Просмотреть файл

@ -0,0 +1,3 @@
#pragma once
#define ZOOMIT_PRODUCT_NAME "PowerToys Sysinternals ZoomIt"

Просмотреть файл

@ -0,0 +1,324 @@
//============================================================================
//
// Process Explorer
// Copyright (C) 1999-2005 Mark Russinovich
// Sysinternals - www.sysinternals.com
//
// Registry.h
//
//============================================================================
#pragma once
typedef enum {
SETTING_TYPE_DWORD,
SETTING_TYPE_BOOLEAN,
SETTING_TYPE_DOUBLE,
SETTING_TYPE_WORD,
SETTING_TYPE_STRING,
SETTING_TYPE_DWORD_ARRAY,
SETTING_TYPE_WORD_ARRAY,
SETTING_TYPE_BINARY
} REG_SETTING_TYPE;
typedef struct {
PCTSTR ValueName;
REG_SETTING_TYPE Type;
DWORD Size; // Optional
PVOID Setting;
double DefaultSetting;
} REG_SETTING, *PREG_SETTING;
class ClassRegistry {
private:
PTCHAR m_KeyName;
HKEY hKey;
public:
ClassRegistry( PCTSTR KeyName )
{
m_KeyName = _tcsdup( KeyName );
hKey = NULL;
}
~ClassRegistry()
{
free( m_KeyName );
}
void ReadRegSettings( PREG_SETTING Settings )
{
PREG_SETTING curSetting;
hKey = NULL;
RegOpenKeyEx(HKEY_CURRENT_USER,
m_KeyName, 0, KEY_READ, &hKey );
curSetting = Settings;
while( curSetting->ValueName ) {
switch( curSetting->Type ) {
case SETTING_TYPE_DWORD:
ReadValue( curSetting->ValueName, static_cast<PDWORD>(curSetting->Setting),
static_cast<DWORD>(curSetting->DefaultSetting));
break;
case SETTING_TYPE_BOOLEAN:
ReadValue( curSetting->ValueName, static_cast<PBOOLEAN>(curSetting->Setting),
static_cast<BOOLEAN>(curSetting->DefaultSetting));
break;
case SETTING_TYPE_DOUBLE:
ReadValue( curSetting->ValueName, static_cast<double *>(curSetting->Setting),
curSetting->DefaultSetting );
break;
case SETTING_TYPE_WORD:
ReadValue( curSetting->ValueName, static_cast<short *>(curSetting->Setting),
static_cast<WORD>(curSetting->DefaultSetting));
break;
case SETTING_TYPE_STRING:
ReadValue( curSetting->ValueName, static_cast<PTCHAR>(curSetting->Setting),
curSetting->Size, reinterpret_cast<PTCHAR>(static_cast<DWORD_PTR>(curSetting->DefaultSetting)));
break;
case SETTING_TYPE_DWORD_ARRAY:
ReadValueArray( curSetting->ValueName, curSetting->Size/sizeof DWORD,
static_cast<PWORD>(curSetting->Setting));
break;
case SETTING_TYPE_WORD_ARRAY:
ReadValueArray( curSetting->ValueName, curSetting->Size/sizeof(short),
static_cast<PWORD>(curSetting->Setting));
break;
case SETTING_TYPE_BINARY:
ReadValueBinary( curSetting->ValueName, static_cast<PBYTE>(curSetting->Setting),
curSetting->Size );
break;
}
curSetting++;
}
if( hKey ) {
RegCloseKey( hKey );
}
}
void WriteRegSettings( PREG_SETTING Settings )
{
PREG_SETTING curSetting;
if( !RegCreateKeyEx(HKEY_CURRENT_USER,
m_KeyName, NULL, NULL, 0, KEY_WRITE, NULL, &hKey, NULL )) {
curSetting = Settings;
while( curSetting->ValueName ) {
switch( curSetting->Type ) {
case SETTING_TYPE_DWORD:
WriteValue( curSetting->ValueName, *static_cast<PDWORD>(curSetting->Setting));
break;
case SETTING_TYPE_BOOLEAN:
WriteValue( curSetting->ValueName, *static_cast<PBOOLEAN>(curSetting->Setting));
break;
case SETTING_TYPE_DOUBLE:
WriteValue( curSetting->ValueName, *static_cast<double *>(curSetting->Setting));
break;
case SETTING_TYPE_WORD:
WriteValue( curSetting->ValueName, *static_cast<short *>(curSetting->Setting));
break;
case SETTING_TYPE_STRING:
WriteValue( curSetting->ValueName, static_cast<PTCHAR>(curSetting->Setting));
break;
case SETTING_TYPE_DWORD_ARRAY:
WriteValueArray( curSetting->ValueName, curSetting->Size/sizeof DWORD,
static_cast<PDWORD>(curSetting->Setting));
break;
case SETTING_TYPE_WORD_ARRAY:
WriteValueArray( curSetting->ValueName, curSetting->Size/sizeof(short),
static_cast<PWORD>(curSetting->Setting));
break;
case SETTING_TYPE_BINARY:
WriteValueBinary( curSetting->ValueName, static_cast<PBYTE>(curSetting->Setting),
curSetting->Size );
break;
}
curSetting++;
}
RegCloseKey( hKey );
}
}
private:
// Reads
void ReadValue( PCTSTR ValueName, PDWORD Value, DWORD Default = 0 )
{
DWORD length = sizeof(DWORD);
if( RegQueryValueEx( hKey, ValueName, NULL, NULL, reinterpret_cast<PBYTE>(Value),
&length )) {
*Value = Default;
}
}
void ReadValue( PCTSTR ValueName, PBOOLEAN Value, BOOLEAN Default = FALSE )
{
DWORD length = sizeof(DWORD);
DWORD val = static_cast<DWORD>(*Value);
if( RegQueryValueEx( hKey, ValueName, NULL, NULL, reinterpret_cast<PBYTE>(&val),
&length )) {
*Value = Default;
} else {
*Value = static_cast<BOOLEAN>(val);
}
}
void ReadValue( PCTSTR ValueName, short *Value, short Default = 0 )
{
DWORD length = sizeof(DWORD);
DWORD val = static_cast<DWORD>(*Value);
if( RegQueryValueEx( hKey, ValueName, NULL, NULL, reinterpret_cast<PBYTE>(&val),
&length )) {
*Value = Default;
} else {
*Value = static_cast<short>(val);
}
}
void ReadValue( PCTSTR ValueName, double *Value, double Default = 0.0 )
{
DWORD length = sizeof(double);
if( RegQueryValueEx( hKey, ValueName, NULL, NULL, reinterpret_cast<PBYTE>(Value),
&length )) {
*Value = Default;
}
}
void ReadValue( PCTSTR ValueName, PTCHAR Value, DWORD Length, PCTSTR Default )
{
if( RegQueryValueEx( hKey, ValueName, NULL, NULL, reinterpret_cast<PBYTE>(Value),
&Length ) && Default ) {
_tcscpy_s( Value, Length, Default );
}
}
void ReadValueBinary( PCTSTR ValueName, PBYTE Value, DWORD Length )
{
RegQueryValueEx( hKey, ValueName, NULL, NULL, Value,
&Length );
}
void ReadValueArray( PCTSTR ValueName, DWORD Number, PDWORD Entries )
{
HKEY hSubKey;
TCHAR subVal[16];
DWORD length;
if( !RegOpenKeyEx(hKey,
ValueName, 0, KEY_READ, &hSubKey )) {
for( DWORD i = 0; i < Number; i++ ) {
length = sizeof(DWORD);
_stprintf_s( subVal, _countof(subVal), _T("%d"), i );
RegQueryValueEx( hSubKey, subVal, NULL, NULL, reinterpret_cast<PBYTE>(&Entries[i]), &length);
}
RegCloseKey( hSubKey );
}
}
void ReadValueArray( PCTSTR ValueName, DWORD Number, PWORD Entries )
{
HKEY hSubKey;
TCHAR subVal[16];
DWORD length;
DWORD val;
if( !RegOpenKeyEx(hKey,
ValueName, 0, KEY_READ, &hSubKey )) {
for( DWORD i = 0; i < Number; i++ ) {
length = sizeof(DWORD);
_stprintf_s( subVal, _countof(subVal), _T("%d"), i );
if( !RegQueryValueEx( hSubKey, subVal, NULL, NULL, reinterpret_cast<PBYTE>(&val), &length)) {
Entries[i] = static_cast<WORD>(val);
}
}
RegCloseKey( hSubKey );
}
}
// Writes
void WriteValue( PCTSTR ValueName, DWORD Value )
{
RegSetValueEx( hKey, ValueName, 0, REG_DWORD, reinterpret_cast<PBYTE>(&Value),
sizeof(DWORD));
}
void WriteValue( PCTSTR ValueName, short Value )
{
DWORD val = static_cast<DWORD>(Value);
RegSetValueEx( hKey, ValueName, 0, REG_DWORD, reinterpret_cast<PBYTE>(&val),
sizeof(DWORD));
}
void WriteValue( PCTSTR ValueName, BOOLEAN Value )
{
DWORD val = static_cast<DWORD>(Value);
RegSetValueEx( hKey, ValueName, 0, REG_DWORD, reinterpret_cast<PBYTE>(&val),
sizeof(DWORD));
}
void WriteValue( PCTSTR ValueName, double Value )
{
RegSetValueEx( hKey, ValueName, 0, REG_BINARY, reinterpret_cast<PBYTE>(&Value),
sizeof(double));
}
void WriteValue( PCTSTR ValueName, PTCHAR Value )
{
RegSetValueEx( hKey, ValueName, 0, REG_SZ, reinterpret_cast<PBYTE>(Value),
static_cast<DWORD>(_tcslen( Value )) * sizeof(TCHAR));
}
void WriteValueBinary( PCTSTR ValueName, PBYTE Value, DWORD Length )
{
RegSetValueEx( hKey, ValueName, 0, REG_BINARY, Value,
Length );
}
void WriteValueArray( PCTSTR ValueName, DWORD Number, PDWORD Entries )
{
HKEY hSubKey;
TCHAR subVal[16];
if( !RegCreateKeyEx(hKey,
ValueName, NULL, NULL, 0, KEY_WRITE, NULL, &hSubKey, NULL )) {
for( DWORD i = 0; i < Number; i++ ) {
_stprintf_s( subVal, _countof(subVal), _T("%d"), i );
if( Entries[i] )
RegSetValueEx( hSubKey, subVal, 0, REG_DWORD, reinterpret_cast<PBYTE>(&Entries[i]), sizeof(DWORD));
else
RegDeleteValue( hSubKey, subVal );
}
RegCloseKey( hSubKey );
}
}
void WriteValueArray( PCTSTR ValueName, DWORD Number, PWORD Entries )
{
HKEY hSubKey;
TCHAR subVal[16];
DWORD val;
if( !RegCreateKeyEx(hKey,
ValueName, NULL, NULL, 0, KEY_WRITE, NULL, &hSubKey, NULL )) {
for( DWORD i = 0; i < Number; i++ ) {
_stprintf_s( subVal, _countof(subVal), _T("%d"), i );
val = static_cast<DWORD>(Entries[i]);
if( Entries[i] )
RegSetValueEx( hSubKey, subVal, 0, REG_DWORD, reinterpret_cast<PBYTE>(&val), sizeof(DWORD));
else
RegDeleteValue( hSubKey, subVal );
}
RegCloseKey( hSubKey );
}
}
};

Просмотреть файл

@ -0,0 +1,269 @@
//==============================================================================
//
// Zoomit
// Sysinternals - www.sysinternals.com
//
// Class to select a recording rectangle and show it while recording
//
//==============================================================================
#include "pch.h"
#include "SelectRectangle.h"
#include "Utility.h"
#include "WindowsVersions.h"
//----------------------------------------------------------------------------
//
// SelectRectangle::Start
//
//----------------------------------------------------------------------------
bool SelectRectangle::Start( HWND ownerWindow, bool fullMonitor )
{
WNDCLASSW windowClass{};
windowClass.lpfnWndProc = []( HWND window, UINT message, WPARAM wordParam, LPARAM longParam ) -> LRESULT
{
if( message == WM_NCCREATE )
{
auto createStruct = reinterpret_cast<LPCREATESTRUCT>(longParam);
SetWindowLongPtrW( window, GWLP_USERDATA, reinterpret_cast<LONG_PTR>(createStruct->lpCreateParams) );
return TRUE;
}
auto self = reinterpret_cast<SelectRectangle*>(GetWindowLongPtrW( window, GWLP_USERDATA ));
return self->WindowProc( window, message, wordParam, longParam );
};
windowClass.hInstance = GetModuleHandle( nullptr );
windowClass.hCursor = LoadCursorW( nullptr, IDC_CROSS );
windowClass.hbrBackground = static_cast<HBRUSH>(GetStockObject( BLACK_BRUSH ));
windowClass.lpszClassName = m_className;
if( RegisterClassW( &windowClass ) == 0 )
{
THROW_LAST_ERROR_IF( GetLastError() != ERROR_CLASS_ALREADY_EXISTS );
WNDCLASSW existingClass{};
THROW_IF_WIN32_BOOL_FALSE( GetClassInfoW( GetModuleHandle( nullptr ), m_className, &existingClass ) );
THROW_LAST_ERROR_IF( existingClass.lpfnWndProc != windowClass.lpfnWndProc );
}
m_cancel = false;
auto rect = GetMonitorRectFromCursor();
m_window = wil::unique_hwnd( CreateWindowExW( WS_EX_LAYERED | WS_EX_TOOLWINDOW | WS_EX_TOPMOST, m_className, nullptr, WS_POPUP,
rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, ownerWindow,
nullptr, nullptr, this ) );
THROW_LAST_ERROR_IF_NULL( m_window.get() );
if( fullMonitor )
{
m_selectedRect = rect;
ShowSelected();
}
else
{
SetLayeredWindowAttributes( m_window.get(), 0, Alpha(), LWA_ALPHA );
}
ShowWindow( m_window.get(), SW_SHOW );
SetForegroundWindow( m_window.get() );
if( !fullMonitor )
{
GetClipCursor( &m_oldClipRect );
ClipCursor( &rect );
m_setClip = true;
}
MSG message;
while( GetMessageW( &message, nullptr, 0, 0 ) != 0 )
{
TranslateMessage( &message );
DispatchMessageW( &message );
if( m_cancel )
{
return false;
}
if( m_selected )
{
break;
}
}
return true;
}
//----------------------------------------------------------------------------
//
// SelectRectangle::Stop
//
//----------------------------------------------------------------------------
void SelectRectangle::Stop()
{
if( m_setClip )
{
ClipCursor( &m_oldClipRect );
m_setClip = false;
}
m_window.reset();
m_selected = false;
m_selectedRect = {};
m_cancel = true;
}
//----------------------------------------------------------------------------
//
// SelectRectangle::ShowSelected
//
//----------------------------------------------------------------------------
void SelectRectangle::ShowSelected()
{
m_selected = true;
// Set the alpha to match the Windows graphics capture API yellow border
// and set the window to be transparent and disabled, so it will be skipped
// for hit testing and as a candidate for the next foreground window.
SetLayeredWindowAttributes( m_window.get(), 0, 191, LWA_ALPHA );
SetWindowLong( m_window.get(), GWL_EXSTYLE, GetWindowLong( m_window.get(), GWL_EXSTYLE ) | WS_EX_TRANSPARENT );
EnableWindow( m_window.get(), FALSE );
POINT point{ m_selectedRect.left, m_selectedRect.top };
auto rect = m_selectedRect;
OffsetRect( &rect, -rect.left, -rect.top );
int width = ScaleForDpi( 2, m_dpi );
// Draw the selection border outside the selected rectangle on builds lower
// than Windows 11 22H2 because the graphics capture API does not skip
// windows if layered, meaning this yellow border will be captured.
if( GetWindowsBuild( nullptr ) < BUILD_WINDOWS_11_22H2 )
{
InflateRect( &rect, width, width );
OffsetRect( &rect, -rect.left, -rect.top );
point.x -= width;
point.y -= width;
}
// Resize the window to the selection rectangle and translate the position.
RECT windowRect;
GetWindowRect( m_window.get(), &windowRect );
point.x += windowRect.left;
point.y += windowRect.top;
MoveWindow( m_window.get(), point.x, point.y, rect.right, rect.bottom, true );
// Use a region to keep everything but the border transparent.
wil::unique_hrgn region{CreateRectRgnIndirect( &rect )};
InflateRect( &rect, -width, -width );
wil::unique_hrgn insideRegion{CreateRectRgnIndirect( &rect )};
CombineRgn( region.get(), region.get(), insideRegion.get(), RGN_XOR );
SetWindowRgn( m_window.get(), region.release(), true );
}
//----------------------------------------------------------------------------
//
// SelectRectangle::UpdateOwner
//
//----------------------------------------------------------------------------
void SelectRectangle::UpdateOwner( HWND window )
{
if( m_window != nullptr )
{
SetWindowLongPtr( m_window.get(), GWLP_HWNDPARENT, reinterpret_cast<LONG_PTR>(window) );
SetWindowPos( m_window.get(), HWND_TOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE );
}
}
//----------------------------------------------------------------------------
//
// SelectRectangle::WindowProc
//
//----------------------------------------------------------------------------
LRESULT SelectRectangle::WindowProc( HWND window, UINT message, WPARAM wordParam, LPARAM longParam )
{
switch( message )
{
case WM_CREATE:
m_dpi = GetDpiForWindowHelper( window );
SetWindowDisplayAffinity( window, WDA_EXCLUDEFROMCAPTURE );
return 0;
case WM_DESTROY:
Stop();
return 0;
case WM_LBUTTONDOWN:
{
SetCapture( window );
m_startPoint = { GET_X_LPARAM( longParam ), GET_Y_LPARAM( longParam ) };
[[fallthrough]];
}
case WM_MOUSEMOVE:
if( GetCapture() == window )
{
RECT rect;
GetClientRect( window, &rect );
POINT point{ GET_X_LPARAM( longParam ), GET_Y_LPARAM( longParam ) };
m_selectedRect = ForceRectInBounds( RectFromPointsMinSize( m_startPoint, point, MinSize() ), rect );
// Use a region to carve out the selected rectangle.
wil::unique_hrgn region{CreateRectRgnIndirect( &m_selectedRect )};
wil::unique_hrgn clientRegion{CreateRectRgnIndirect( &rect )};
CombineRgn( region.get(), region.get(), clientRegion.get(), RGN_XOR );
SetWindowRgn( window, region.release(), true );
}
return 0;
case WM_KEYDOWN:
if( wordParam == VK_ESCAPE )
{
Stop();
}
return 0;
case WM_KILLFOCUS:
if( !m_selected )
{
Stop();
}
return 0;
case WM_LBUTTONUP:
{
if( m_setClip )
{
ClipCursor( &m_oldClipRect );
m_setClip = false;
}
ReleaseCapture();
ShowSelected();
return 0;
}
case WM_NCHITTEST:
if( m_selected )
{
return HTTRANSPARENT;
}
break;
case WM_PAINT:
if( m_selected )
{
PAINTSTRUCT paint;
auto deviceContext = BeginPaint( window, &paint );
RECT rect;
GetClientRect( window, &rect );
// Draw a border matching the Windows graphics capture API border.
// The outer frame is yellow and two logical pixels wide, while the
// inner is black and 1 logical pixel wide.
wil::unique_hbrush brush{CreateSolidBrush( RGB( 255, 222, 0 ) )};
FillRect( deviceContext, &rect, brush.get() );
int width = ScaleForDpi( 1, m_dpi );
InflateRect( &rect, -width, -width );
FillRect( deviceContext, &rect, static_cast<HBRUSH>(GetStockObject( BLACK_BRUSH )) );
EndPaint( window, &paint );
return 0;
}
break;
}
return DefWindowProcW( window, message, wordParam, longParam );
}

Просмотреть файл

@ -0,0 +1,44 @@
//==============================================================================
//
// Zoomit
// Sysinternals - www.sysinternals.com
//
// Class to select a recording rectangle and show it while recording
//
//==============================================================================
#pragma once
#include "pch.h"
class SelectRectangle
{
public:
~SelectRectangle() { Stop(); };
void Alpha( BYTE alpha ) { m_alpha = alpha; }
BYTE Alpha() const { return m_alpha; }
void MinSize( int minSize ) { m_minSize = minSize; }
int MinSize() const { return m_minSize; }
RECT SelectedRect() const { return m_selectedRect; }
bool Start( HWND ownerWindow = nullptr, bool fullMonitor = false );
void Stop();
void UpdateOwner( HWND window );
private:
BYTE m_alpha = 176;
int m_minSize = 34;
RECT m_selectedRect{};
bool m_cancel = false;
const wchar_t* m_className = L"ZoomitSelectRectangle";
UINT m_dpi{};
RECT m_oldClipRect{};
bool m_selected{ false };
bool m_setClip{ false };
POINT m_startPoint{};
wil::unique_hwnd m_window;
void ShowSelected();
LRESULT WindowProc( HWND window, UINT message, WPARAM wordParam, LPARAM longParam );
};

Просмотреть файл

@ -0,0 +1,153 @@
//==============================================================================
//
// Zoomit
// Sysinternals - www.sysinternals.com
//
// Utility functions
//
//==============================================================================
#include "pch.h"
#include "Utility.h"
//----------------------------------------------------------------------------
//
// ForceRectInBounds
//
//----------------------------------------------------------------------------
RECT ForceRectInBounds( RECT rect, const RECT& bounds )
{
if( rect.left < bounds.left )
{
rect.right += bounds.left - rect.left;
rect.left = bounds.left;
}
if( rect.top < bounds.top )
{
rect.bottom += bounds.top - rect.top;
rect.top = bounds.top;
}
if( rect.right > bounds.right )
{
rect.left -= rect.right - bounds.right;
rect.right = bounds.right;
}
if( rect.bottom > bounds.bottom )
{
rect.top -= rect.bottom - bounds.bottom;
rect.bottom = bounds.bottom;
}
return rect;
}
//----------------------------------------------------------------------------
//
// GetDpiForWindow
//
//----------------------------------------------------------------------------
UINT GetDpiForWindowHelper( HWND window )
{
auto function = reinterpret_cast<UINT (WINAPI *)(HWND)>(GetProcAddress( GetModuleHandleW( L"user32.dll" ), "GetDpiForWindow" ));
if( function )
{
return function( window );
}
wil::unique_hdc hdc{GetDC( nullptr )};
return static_cast<UINT>(GetDeviceCaps( hdc.get(), LOGPIXELSX ));
}
//----------------------------------------------------------------------------
//
// GetMonitorRectFromCursor
//
//----------------------------------------------------------------------------
RECT GetMonitorRectFromCursor()
{
POINT point;
GetCursorPos( &point );
MONITORINFO monitorInfo{};
monitorInfo.cbSize = sizeof( monitorInfo );
GetMonitorInfoW( MonitorFromPoint( point, MONITOR_DEFAULTTONEAREST ), &monitorInfo );
return monitorInfo.rcMonitor;
}
//----------------------------------------------------------------------------
//
// RectFromPointsMinSize
//
//----------------------------------------------------------------------------
#ifdef _MSC_VER
// avoid making RectFromPointsMinSize constexpr since that leads to link errors
#pragma warning(push)
#pragma warning(disable: 26497)
#endif
RECT RectFromPointsMinSize( POINT a, POINT b, LONG minSize )
{
RECT rect;
if( a.x <= b.x )
{
rect.left = a.x;
rect.right = b.x + 1;
if( (rect.right - rect.left) < minSize )
{
rect.right = rect.left + minSize;
}
}
else
{
rect.left = b.x;
rect.right = a.x + 1;
if( (rect.right - rect.left) < minSize )
{
rect.left = rect.right - minSize;
}
}
if( a.y <= b.y )
{
rect.top = a.y;
rect.bottom = b.y + 1;
if( (rect.bottom - rect.top) < minSize )
{
rect.bottom = rect.top + minSize;
}
}
else
{
rect.top = b.y;
rect.bottom = a.y + 1;
if( (rect.bottom - rect.top) < minSize )
{
rect.top = rect.bottom - minSize;
}
}
return rect;
}
#ifdef _MSC_VER
#pragma warning(pop)
#endif
//----------------------------------------------------------------------------
//
// ScaleForDpi
//
//----------------------------------------------------------------------------
int ScaleForDpi( int value, UINT dpi )
{
return MulDiv( value, static_cast<int>(dpi), USER_DEFAULT_SCREEN_DPI );
}
//----------------------------------------------------------------------------
//
// ScalePointInRects
//
//----------------------------------------------------------------------------
POINT ScalePointInRects( POINT point, const RECT& source, const RECT& target )
{
const SIZE sourceSize{ source.right - source.left, source.bottom - source.top };
const POINT sourceCenter{ source.left + sourceSize.cx / 2, source.top + sourceSize.cy / 2 };
const SIZE targetSize{ target.right - target.left, target.bottom - target.top };
const POINT targetCenter{ target.left + targetSize.cx / 2, target.top + targetSize.cy / 2 };
return { targetCenter.x + MulDiv( point.x - sourceCenter.x, targetSize.cx, sourceSize.cx ),
targetCenter.y + MulDiv( point.y - sourceCenter.y, targetSize.cy, sourceSize.cy ) };
}

Просмотреть файл

@ -0,0 +1,18 @@
//==============================================================================
//
// Zoomit
// Sysinternals - www.sysinternals.com
//
// Utility functions
//
//==============================================================================
#pragma once
#include "pch.h"
RECT ForceRectInBounds( RECT rect, const RECT& bounds );
UINT GetDpiForWindowHelper( HWND window );
RECT GetMonitorRectFromCursor();
RECT RectFromPointsMinSize( POINT a, POINT b, LONG minSize );
int ScaleForDpi( int value, UINT dpi );
POINT ScalePointInRects( POINT point, const RECT& source, const RECT& target );

Просмотреть файл

@ -0,0 +1,129 @@
//--------------------------------------------------------------------
//
// GetLanguageVersionString
//
// Gets version information for a particular code page.
//
//--------------------------------------------------------------------
#include <stdio.h>
#include "pch.h"
#include "VersionHelper.h"
PTCHAR GetLanguageVersionString(P_VERSION_INFO VersionInfo,
LANGID LanguageId, WORD Charset,
LPCTSTR VersionString)
{
TCHAR szQueryStr[0x100];
PTCHAR pszVerRetVal;
UINT cbReturn;
BOOL fFound = FALSE;
// Format the string
_stprintf_s(szQueryStr, ARRAYSIZE(szQueryStr), _T("\\StringFileInfo\\%04X%04X\\%s"),
LanguageId, Charset,
VersionString);
fFound = VerQueryValue(VersionInfo, szQueryStr,
reinterpret_cast<LPVOID *>(&pszVerRetVal), &cbReturn);
if (!fFound) {
return NULL;
}
else {
return pszVerRetVal;
}
}
//
// explicitly use wide char version
// this is used when show banner in remote session before display eula from console which requires unicode for French
// it's needed for multibyte app
//
PWCHAR GetLanguageVersionStringW(P_VERSION_INFO VersionInfo,
LANGID LanguageId, WORD Charset,
LPCWSTR VersionString)
{
WCHAR szQueryStr[0x100];
PWCHAR pszVerRetVal;
UINT cbReturn;
BOOL fFound = FALSE;
// Format the string
swprintf_s(szQueryStr, ARRAYSIZE(szQueryStr), L"\\StringFileInfo\\%04X%04X\\%s",
LanguageId, Charset,
VersionString);
fFound = VerQueryValueW(VersionInfo, szQueryStr,
reinterpret_cast<LPVOID *>(&pszVerRetVal), &cbReturn);
if (!fFound) {
return NULL;
}
else {
return pszVerRetVal;
}
}
//--------------------------------------------------------------------
//
// GetVersionString
//
// Gets a version string.
//
//--------------------------------------------------------------------
PTCHAR GetVersionString(P_VERSION_INFO VersionInfo,
LPCTSTR VersionString)
{
PTCHAR pszVerRetVal;
P_VERSION_TRANSLATION pTranslation;
VERSION_TRANSLATION translation;
unsigned int length;
//
// Get the language id
//
translation.langID = MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT);
pTranslation = &translation;
VerQueryValue(VersionInfo,
_T("\\VarFileInfo\\Translation"),
reinterpret_cast<PVOID *>(&pTranslation),
&length);
pszVerRetVal = GetLanguageVersionString(VersionInfo,
pTranslation->langID,
pTranslation->charset,
VersionString);
return pszVerRetVal;
}
//
// explicitly use wide char version
// this is used when show banner in remote session before display eula from console which requires unicode for French
// it's needed for multibyte app
//
PWCHAR GetVersionStringW(P_VERSION_INFO VersionInfo,
LPCWSTR VersionString)
{
PWCHAR pszVerRetVal;
P_VERSION_TRANSLATION pTranslation;
VERSION_TRANSLATION translation;
unsigned int length;
//
// Get the language id
//
translation.langID = MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT);
pTranslation = &translation;
VerQueryValueW(VersionInfo,
L"\\VarFileInfo\\Translation",
reinterpret_cast<PVOID *>(&pTranslation),
&length);
pszVerRetVal = GetLanguageVersionStringW(VersionInfo,
pTranslation->langID,
pTranslation->charset,
VersionString);
return pszVerRetVal;
}

Просмотреть файл

@ -0,0 +1,48 @@
//============================================================================
//
// VersionHelper.h
//
// Functions to retrieve version information
//
//============================================================================
#pragma once
#include <windows.h>
#include <tchar.h>
#include "winver.h"
//
// File version information
//
typedef struct {
WORD wLength;
WORD wValueLength;
WORD wType;
WCHAR szKey[16];
WORD Padding1;
VS_FIXEDFILEINFO Value;
} VERSION_INFO, *P_VERSION_INFO;
//
// Version translation
//
typedef struct {
WORD langID; // language ID
WORD charset; // character set (code page)
} VERSION_TRANSLATION, *P_VERSION_TRANSLATION;
PTCHAR GetVersionString(P_VERSION_INFO VersionInfo, LPCTSTR VersionString);
PTCHAR GetLanguageVersionString(P_VERSION_INFO VersionInfo,
LANGID LanguageId,
WORD Charset,
LPCTSTR VersionString);
PWCHAR GetLanguageVersionStringW(P_VERSION_INFO VersionInfo,
LANGID LanguageId, WORD Charset,
LPCWSTR VersionString);
PWCHAR GetVersionStringW(P_VERSION_INFO VersionInfo,
LPCWSTR VersionString);

Просмотреть файл

@ -0,0 +1,391 @@
//==============================================================================
//
// Zoomit
// Sysinternals - www.sysinternals.com
//
// Video capture code derived from https://github.com/robmikh/capturevideosample
//
//==============================================================================
#include "pch.h"
#include "VideoRecordingSession.h"
#include "CaptureFrameWait.h"
extern DWORD g_RecordScaling;
namespace winrt
{
using namespace Windows::Foundation;
using namespace Windows::Graphics;
using namespace Windows::Graphics::Capture;
using namespace Windows::Graphics::DirectX;
using namespace Windows::Graphics::DirectX::Direct3D11;
using namespace Windows::Storage;
using namespace Windows::UI::Composition;
using namespace Windows::Media::Core;
using namespace Windows::Media::Transcoding;
using namespace Windows::Media::MediaProperties;
}
namespace util
{
using namespace robmikh::common::uwp;
}
const float CLEAR_COLOR[] = { 0.0f, 0.0f, 0.0f, 1.0f };
int32_t EnsureEven(int32_t value)
{
if (value % 2 == 0)
{
return value;
}
else
{
return value + 1;
}
}
//----------------------------------------------------------------------------
//
// VideoRecordingSession::VideoRecordingSession
//
//----------------------------------------------------------------------------
VideoRecordingSession::VideoRecordingSession(
winrt::IDirect3DDevice const& device,
winrt::GraphicsCaptureItem const& item,
RECT const cropRect,
uint32_t frameRate,
bool captureAudio,
winrt::Streams::IRandomAccessStream const& stream)
{
m_device = device;
m_d3dDevice = GetDXGIInterfaceFromObject<ID3D11Device>(m_device);
m_d3dDevice->GetImmediateContext(m_d3dContext.put());
m_item = item;
auto itemSize = item.Size();
auto inputWidth = EnsureEven(itemSize.Width);
auto inputHeight = EnsureEven(itemSize.Height);
m_frameWait = std::make_shared<CaptureFrameWait>(m_device, m_item, winrt::SizeInt32{ inputWidth, inputHeight });
auto weakPointer{ std::weak_ptr{ m_frameWait } };
m_itemClosed = item.Closed(winrt::auto_revoke, [weakPointer](auto&, auto&)
{
auto sharedPointer{ weakPointer.lock() };
if (sharedPointer)
{
sharedPointer->StopCapture();
}
});
// Get crop dimension
if( (cropRect.right - cropRect.left) != 0 )
{
m_rcCrop = cropRect;
m_frameWait->ShowCaptureBorder( false );
}
else
{
m_rcCrop.left = 0;
m_rcCrop.top = 0;
m_rcCrop.right = inputWidth;
m_rcCrop.bottom = inputHeight;
}
// Ensure the video is not too small and try to maintain the aspect ratio
constexpr int c_minimumSize = 34;
auto scaledWidth = MulDiv(m_rcCrop.right - m_rcCrop.left, g_RecordScaling, 100);
auto scaledHeight = MulDiv(m_rcCrop.bottom - m_rcCrop.top, g_RecordScaling, 100);
auto outputWidth = scaledWidth;
auto outputHeight = scaledHeight;
if (outputWidth < c_minimumSize)
{
outputWidth = c_minimumSize;
outputHeight = MulDiv(outputHeight, outputWidth, scaledWidth);
}
if (outputHeight < c_minimumSize)
{
outputHeight = c_minimumSize;
outputWidth = MulDiv(outputWidth, outputHeight, scaledHeight);
}
if (outputWidth > inputWidth)
{
outputWidth = inputWidth;
outputHeight = c_minimumSize, MulDiv(outputHeight, scaledWidth, outputWidth);
}
if (outputHeight > inputHeight)
{
outputHeight = inputHeight;
outputWidth = c_minimumSize, MulDiv(outputWidth, scaledHeight, outputHeight);
}
outputWidth = EnsureEven(outputWidth);
outputHeight = EnsureEven(outputHeight);
// Describe out output: H264 video with an MP4 container
m_encodingProfile = winrt::MediaEncodingProfile();
m_encodingProfile.Container().Subtype(L"MPEG4");
auto video = m_encodingProfile.Video();
video.Subtype(L"H264");
video.Width(outputWidth);
video.Height(outputHeight);
video.Bitrate(static_cast<uint32_t>(outputWidth * outputHeight * frameRate * 2 * 0.07));
video.FrameRate().Numerator(frameRate);
video.FrameRate().Denominator(1);
video.PixelAspectRatio().Numerator(1);
video.PixelAspectRatio().Denominator(1);
m_encodingProfile.Video(video);
// if audio capture, set up audio profile
if (captureAudio)
{
auto audio = m_encodingProfile.Audio();
audio = winrt::AudioEncodingProperties::CreateAac(48000, 1, 16);
m_encodingProfile.Audio(audio);
}
// Describe our input: uncompressed BGRA8 buffers
auto properties = winrt::VideoEncodingProperties::CreateUncompressed(
winrt::MediaEncodingSubtypes::Bgra8(),
static_cast<uint32_t>(m_rcCrop.right - m_rcCrop.left),
static_cast<uint32_t>(m_rcCrop.bottom - m_rcCrop.top));
m_videoDescriptor = winrt::VideoStreamDescriptor(properties);
m_stream = stream;
m_previewSwapChain = util::CreateDXGISwapChain(
m_d3dDevice,
static_cast<uint32_t>(m_rcCrop.right - m_rcCrop.left),
static_cast<uint32_t>(m_rcCrop.bottom - m_rcCrop.top),
DXGI_FORMAT_B8G8R8A8_UNORM,
2);
winrt::com_ptr<ID3D11Texture2D> backBuffer;
winrt::check_hresult(m_previewSwapChain->GetBuffer(0, winrt::guid_of<ID3D11Texture2D>(), backBuffer.put_void()));
winrt::check_hresult(m_d3dDevice->CreateRenderTargetView(backBuffer.get(), nullptr, m_renderTargetView.put()));
if( captureAudio ) {
m_audioGenerator = std::make_unique<AudioSampleGenerator>();
}
else {
m_audioGenerator = nullptr;
}
}
//----------------------------------------------------------------------------
//
// VideoRecordingSession::~VideoRecordingSession
//
//----------------------------------------------------------------------------
VideoRecordingSession::~VideoRecordingSession()
{
Close();
}
//----------------------------------------------------------------------------
//
// VideoRecordingSession::StartAsync
//
//----------------------------------------------------------------------------
winrt::IAsyncAction VideoRecordingSession::StartAsync()
{
auto expected = false;
if (m_isRecording.compare_exchange_strong(expected, true))
{
// Create our MediaStreamSource
if(m_audioGenerator) {
co_await m_audioGenerator->InitializeAsync();
m_streamSource = winrt::MediaStreamSource(m_videoDescriptor, winrt::AudioStreamDescriptor(m_audioGenerator->GetEncodingProperties()));
}
else {
m_streamSource = winrt::MediaStreamSource(m_videoDescriptor);
}
m_streamSource.BufferTime(std::chrono::seconds(0));
m_streamSource.Starting({ this, &VideoRecordingSession::OnMediaStreamSourceStarting });
m_streamSource.SampleRequested({ this, &VideoRecordingSession::OnMediaStreamSourceSampleRequested });
// Create our transcoder
m_transcoder = winrt::MediaTranscoder();
m_transcoder.HardwareAccelerationEnabled(true);
auto self = shared_from_this();
// Start encoding
auto transcode = co_await m_transcoder.PrepareMediaStreamSourceTranscodeAsync(m_streamSource, m_stream, m_encodingProfile);
co_await transcode.TranscodeAsync();
}
co_return;
}
//----------------------------------------------------------------------------
//
// VideoRecordingSession::Close
//
//----------------------------------------------------------------------------
void VideoRecordingSession::Close()
{
auto expected = false;
if (m_closed.compare_exchange_strong(expected, true))
{
expected = true;
if (!m_isRecording.compare_exchange_strong(expected, false))
{
CloseInternal();
}
else
{
m_frameWait->StopCapture();
}
}
}
//----------------------------------------------------------------------------
//
// VideoRecordingSession::CloseInternal
//
//----------------------------------------------------------------------------
void VideoRecordingSession::CloseInternal()
{
if(m_audioGenerator) {
m_audioGenerator->Stop();
}
m_frameWait->StopCapture();
m_itemClosed.revoke();
}
//----------------------------------------------------------------------------
//
// VideoRecordingSession::OnMediaStreamSourceStarting
//
//----------------------------------------------------------------------------
void VideoRecordingSession::OnMediaStreamSourceStarting(
winrt::MediaStreamSource const&,
winrt::MediaStreamSourceStartingEventArgs const& args)
{
auto frame = m_frameWait->TryGetNextFrame();
if (frame) {
args.Request().SetActualStartPosition(frame->SystemRelativeTime);
if (m_audioGenerator) {
m_audioGenerator->Start();
}
}
}
//----------------------------------------------------------------------------
//
// VideoRecordingSession::Create
//
//----------------------------------------------------------------------------
std::shared_ptr<VideoRecordingSession> VideoRecordingSession::Create(
winrt::IDirect3DDevice const& device,
winrt::GraphicsCaptureItem const& item,
RECT const& crop,
uint32_t frameRate,
bool captureAudio,
winrt::Streams::IRandomAccessStream const& stream)
{
return std::shared_ptr<VideoRecordingSession>(new VideoRecordingSession(device, item, crop, frameRate, captureAudio, stream));
}
//----------------------------------------------------------------------------
//
// VideoRecordingSession::OnMediaStreamSourceSampleRequested
//
//----------------------------------------------------------------------------
void VideoRecordingSession::OnMediaStreamSourceSampleRequested(
winrt::MediaStreamSource const&,
winrt::MediaStreamSourceSampleRequestedEventArgs const& args)
{
auto request = args.Request();
auto streamDescriptor = request.StreamDescriptor();
if (auto videoStreamDescriptor = streamDescriptor.try_as<winrt::VideoStreamDescriptor>())
{
if (auto frame = m_frameWait->TryGetNextFrame())
{
try
{
auto timeStamp = frame->SystemRelativeTime;
auto contentSize = frame->ContentSize;
auto frameTexture = GetDXGIInterfaceFromObject<ID3D11Texture2D>(frame->FrameTexture);
D3D11_TEXTURE2D_DESC desc = {};
frameTexture->GetDesc(&desc);
winrt::com_ptr<ID3D11Texture2D> backBuffer;
winrt::check_hresult(m_previewSwapChain->GetBuffer(0, winrt::guid_of<ID3D11Texture2D>(), backBuffer.put_void()));
// Use the smaller of the crop size or content size. The content
// size can change while recording, for example by resizing the
// window. This ensures that only valid content is copied.
auto width = min(m_rcCrop.right - m_rcCrop.left, contentSize.Width);
auto height = min(m_rcCrop.bottom - m_rcCrop.top, contentSize.Height);
// Set the content region to copy and clamp the coordinates to the
// texture surface.
D3D11_BOX region = {};
region.left = std::clamp(m_rcCrop.left, static_cast<LONG>(0), static_cast<LONG>(desc.Width));
region.right = std::clamp(m_rcCrop.left + width, static_cast<LONG>(0), static_cast<LONG>(desc.Width));
region.top = std::clamp(m_rcCrop.top, static_cast<LONG>(0), static_cast<LONG>(desc.Height));
region.bottom = std::clamp(m_rcCrop.top + height, static_cast<LONG>(0), static_cast<LONG>(desc.Height));
region.back = 1;
m_d3dContext->ClearRenderTargetView(m_renderTargetView.get(), CLEAR_COLOR);
m_d3dContext->CopySubresourceRegion(
backBuffer.get(),
0,
0, 0, 0,
frameTexture.get(),
0,
&region);
desc = {};
backBuffer->GetDesc(&desc);
desc.Usage = D3D11_USAGE_DEFAULT;
desc.BindFlags = D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_RENDER_TARGET;
desc.CPUAccessFlags = 0;
desc.MiscFlags = 0;
winrt::com_ptr<ID3D11Texture2D> sampleTexture;
winrt::check_hresult(m_d3dDevice->CreateTexture2D(&desc, nullptr, sampleTexture.put()));
m_d3dContext->CopyResource(sampleTexture.get(), backBuffer.get());
auto dxgiSurface = sampleTexture.as<IDXGISurface>();
auto sampleSurface = CreateDirect3DSurface(dxgiSurface.get());
DXGI_PRESENT_PARAMETERS presentParameters{};
winrt::check_hresult(m_previewSwapChain->Present1(0, 0, &presentParameters));
auto sample = winrt::MediaStreamSample::CreateFromDirect3D11Surface(sampleSurface, timeStamp);
request.Sample(sample);
}
catch (winrt::hresult_error const& error)
{
OutputDebugStringW(error.message().c_str());
request.Sample(nullptr);
CloseInternal();
return;
}
}
else
{
request.Sample(nullptr);
CloseInternal();
}
}
else if (auto audioStreamDescriptor = streamDescriptor.try_as<winrt::AudioStreamDescriptor>())
{
if (auto sample = m_audioGenerator->TryGetNextSample())
{
request.Sample(sample.value());
}
else
{
request.Sample(nullptr);
}
}
}

Просмотреть файл

@ -0,0 +1,71 @@
//==============================================================================
//
// Zoomit
// Sysinternals - www.sysinternals.com
//
// Video capture code derived from https://github.com/robmikh/capturevideosample
//
//==============================================================================
#pragma once
#include "CaptureFrameWait.h"
#include "AudioSampleGenerator.h"
#include <d3d11_4.h>
class VideoRecordingSession : public std::enable_shared_from_this<VideoRecordingSession>
{
public:
[[nodiscard]] static std::shared_ptr<VideoRecordingSession> Create(
winrt::Direct3D11::IDirect3DDevice const& device,
winrt::GraphicsCaptureItem const& item,
RECT const& cropRect,
uint32_t frameRate,
bool captureAudio,
winrt::Streams::IRandomAccessStream const& stream);
~VideoRecordingSession();
winrt::IAsyncAction StartAsync();
void EnableCursorCapture(bool enable = true) { m_frameWait->EnableCursorCapture(enable); }
void Close();
private:
VideoRecordingSession(
winrt::Direct3D11::IDirect3DDevice const& device,
winrt::Capture::GraphicsCaptureItem const& item,
RECT const cropRect,
uint32_t frameRate,
bool captureAudio,
winrt::Streams::IRandomAccessStream const& stream);
void CloseInternal();
void OnMediaStreamSourceStarting(
winrt::MediaStreamSource const& sender,
winrt::MediaStreamSourceStartingEventArgs const& args);
void OnMediaStreamSourceSampleRequested(
winrt::MediaStreamSource const& sender,
winrt::MediaStreamSourceSampleRequestedEventArgs const& args);
private:
winrt::Direct3D11::IDirect3DDevice m_device{ nullptr };
winrt::com_ptr<ID3D11Device> m_d3dDevice;
winrt::com_ptr<ID3D11DeviceContext> m_d3dContext;
RECT m_rcCrop;
winrt::GraphicsCaptureItem m_item{ nullptr };
winrt::GraphicsCaptureItem::Closed_revoker m_itemClosed;
std::shared_ptr<CaptureFrameWait> m_frameWait;
winrt::Streams::IRandomAccessStream m_stream{ nullptr };
winrt::MediaEncodingProfile m_encodingProfile{ nullptr };
winrt::VideoStreamDescriptor m_videoDescriptor{ nullptr };
winrt::MediaStreamSource m_streamSource{ nullptr };
winrt::MediaTranscoder m_transcoder{ nullptr };
std::unique_ptr<AudioSampleGenerator> m_audioGenerator;
winrt::com_ptr<IDXGISwapChain1> m_previewSwapChain;
winrt::com_ptr<ID3D11RenderTargetView> m_renderTargetView;
std::atomic<bool> m_isRecording = false;
std::atomic<bool> m_closed = false;
};

Просмотреть файл

@ -0,0 +1,223 @@
//============================================================================
//
// Zoomit
// Copyright (C) Mark Russinovich
// Sysinternals - www.sysinternals.com
//
// Screen zoom and annotation tool.
//
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
//============================================================================
#pragma once
// Ignore getversion deprecation warning
#pragma warning( disable: 4996 )
typedef HRESULT (__stdcall * type_pEnableThemeDialogTexture)(
HWND hwnd,
DWORD dwFlags
);
type_pEnableThemeDialogTexture pEnableThemeDialogTexture;
// For testing anti-aliased bitmap stretching
#define SCALE_GDIPLUS 0
#define SCALE_HALFTONE 0
// sent in mouse message when coming from tablet pen
#define MI_WP_SIGNATURE 0xFF515700
#define ZOOM_LEVEL_MIN 1
#define ZOOM_LEVEL_INIT 2
#define ZOOM_LEVEL_STEP_IN ((float) 1.1)
#define ZOOM_LEVEL_STEP_OUT ((float) 0.8)
#define ZOOM_LEVEL_MAX 32
#define ZOOM_LEVEL_STEP_TIME 20
#define LIVEZOOM_MOVE_REGIONS 8
#define WIN7_VERSION 0x106
#define WIN10_VERSION 0x206
// Time that we'll cache live zoom window to avoid flicker
// of live zooming on Vista/ws2k8
#define LIVEZOOM_WINDOW_TIMEOUT 2*3600*1000
#define MAX_UNDO_HISTORY 32
#define PEN_WIDTH 5
#define MIN_PEN_WIDTH 2
#define MAX_PEN_WIDTH 40
#define MAX_LIVE_PEN_WIDTH 600
#define APPNAME L"ZoomIt"
#define WM_USER_TRAY_ACTIVATE WM_USER+100
#define WM_USER_TYPING_OFF WM_USER+101
#define WM_USER_GET_ZOOM_LEVEL WM_USER+102
#define WM_USER_GET_SOURCE_RECT WM_USER+103
#define WM_USER_SET_ZOOM WM_USER+104
#define WM_USER_STOP_RECORDING WM_USER+105
#define WM_USER_SAVE_CURSOR WM_USER+106
#define WM_USER_RESTORE_CURSOR WM_USER+107
#define WM_USER_MAGNIFY_CURSOR WM_USER+108
#define WM_USER_EXIT_MODE WM_USER+109
#define WM_USER_RELOAD_SETTINGS WM_USER+110
typedef struct _TYPED_KEY {
RECT rc;
struct _TYPED_KEY *Next;
} TYPED_KEY, *P_TYPED_KEY;
typedef struct _DRAW_UNDO {
HDC hDc;
HBITMAP hBitmap;
struct _DRAW_UNDO *Next;
} DRAW_UNDO, *P_DRAW_UNDO;
typedef struct {
TCHAR TabTitle[64];
HWND hPage;
} OPTION_TABS, *P_OPTIONS_TABS;
#define COLOR_RED RGB(255, 0, 0)
#define COLOR_GREEN RGB(0, 255, 0)
#define COLOR_BLUE RGB(0, 0, 255)
#define COLOR_ORANGE RGB(255,128,0)
#define COLOR_YELLOW RGB(255, 255, 0 )
#define COLOR_PINK RGB(255,128,255)
#define COLOR_BLUR RGB(112,112,112)
#define DRAW_RECTANGLE 1
#define DRAW_ELLIPSE 2
#define DRAW_LINE 3
#define DRAW_ARROW 4
#define SHALLOW_ZOOM 1
#define SHALLOW_DESTROY 2
#define LIVE_DRAW_ZOOM 3
#define PEN_COLOR_HIGHLIGHT(Pencolor) (Pencolor >> 24) != 0xFF
typedef BOOL (__stdcall *type_pGetMonitorInfo)(
HMONITOR hMonitor, // handle to display monitor
LPMONITORINFO lpmi // display monitor information
);
typedef HMONITOR (__stdcall *type_MonitorFromPoint)(
POINT pt, // point
DWORD dwFlags // determine return value
);
typedef HRESULT (__stdcall *type_pSHAutoComplete)(
HWND hwndEdit,
DWORD dwFlags
);
// DPI awareness
typedef BOOL (__stdcall *type_pSetProcessDPIAware)(void);
// Live zoom
typedef BOOL (__stdcall *type_pMagSetWindowSource)(HWND hwnd,
RECT rect
);
typedef BOOL (__stdcall *type_pMagSetWindowTransform)(HWND hwnd,
PMAGTRANSFORM pTransform
);
typedef BOOL(__stdcall* type_pMagSetFullscreenTransform)(
float magLevel,
int xOffset,
int yOffset
);
typedef BOOL(__stdcall* type_pMagSetInputTransform)(
BOOL fEnabled,
const LPRECT pRectSource,
const LPRECT pRectDest
);
typedef BOOL (__stdcall *type_pMagShowSystemCursor)(
BOOL fShowCursor
);
typedef BOOL(__stdcall *type_pMagSetWindowFilterList)(
HWND hwnd,
DWORD dwFilterMode,
int count,
HWND* pHWND
);
typedef BOOL (__stdcall *type_pMagInitialize)(VOID);
typedef BOOL(__stdcall *type_pGetPointerType)(
_In_ UINT32 pointerId,
_Out_ POINTER_INPUT_TYPE *pointerType
);
typedef BOOL(__stdcall *type_pGetPointerPenInfo)(
_In_ UINT32 pointerId,
_Out_ POINTER_PEN_INFO *penInfo
);
typedef HRESULT (__stdcall *type_pDwmIsCompositionEnabled)(
BOOL *pfEnabled
);
// opacity
typedef BOOL (__stdcall *type_pSetLayeredWindowAttributes)(
HWND hwnd, // handle to the layered window
COLORREF crKey, // specifies the color key
BYTE bAlpha, // value for the blend function
DWORD dwFlags // action
);
// Presentation mode check
typedef HRESULT (__stdcall *type_pSHQueryUserNotificationState)(
QUERY_USER_NOTIFICATION_STATE *pQueryUserNotificationState
);
typedef BOOL (__stdcall *type_pSystemParametersInfoForDpi)(
UINT uiAction,
UINT uiParam,
PVOID pvParam,
UINT fWinIni,
UINT dpi
);
typedef UINT (__stdcall *type_pGetDpiForWindow)(
HWND hwnd
);
class ComputerGraphicsInit
{
ULONG_PTR m_Token;
public:
ComputerGraphicsInit()
{
Gdiplus::GdiplusStartupOutput startupOut;
Gdiplus::GdiplusStartupInput startupIn;
Gdiplus::GdiplusStartup( &m_Token, &startupIn, &startupOut );
}
~ComputerGraphicsInit()
{
Gdiplus::GdiplusShutdown( m_Token );
}
};
// Direct3D
typedef HRESULT (__stdcall *type_pCreateDirect3D11DeviceFromDXGIDevice)(
IDXGIDevice *dxgiDevice,
IInspectable **graphicsDevice
);
typedef HRESULT (__stdcall *type_pCreateDirect3D11SurfaceFromDXGISurface)(
IDXGISurface *dxgiSurface,
IInspectable **graphicsSurface
);
typedef HRESULT (__stdcall *type_pD3D11CreateDevice)(
IDXGIAdapter *pAdapter,
D3D_DRIVER_TYPE DriverType,
HMODULE Software,
UINT Flags,
const D3D_FEATURE_LEVEL *pFeatureLevels,
UINT FeatureLevels,
UINT SDKVersion,
ID3D11Device **ppDevice,
D3D_FEATURE_LEVEL *pFeatureLevel,
ID3D11DeviceContext **ppImmediateContext
);

Просмотреть файл

@ -0,0 +1 @@
<Configurations active="Default"><Configuration name="Default"><Command val=""></Command><RunMode val="a host path through a shared folder"></RunMode><ShareFolders val=""></ShareFolders><RemoteDebugMonitor val="C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\Remote Debugger\x86\msvsmon.exe"></RemoteDebugMonitor><MonitorName val="VMDebug"></MonitorName><VirtualMachine val=""></VirtualMachine><StartMode val="No"></StartMode><TerminationMode val="No operation"></TerminationMode><CopyFiles val=""></CopyFiles><PreCommandLine val=""></PreCommandLine><PostCommandLine val=""></PostCommandLine></Configuration></Configurations>

Просмотреть файл

@ -0,0 +1,484 @@
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
// version.h and branding.h are different in the Sysinternals repository,
// keep the includes as such, here.
// From $(MSBuildThisFileDirectory)..\..\..\common\version
#include "version.h"
// From $(MSBuildThisFileDirectory)PowerToys
#include "branding.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "winres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (United States) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE
BEGIN
"#include ""winres.h""\r\n"
"\0"
END
3 TEXTINCLUDE
BEGIN
"#include ""binres.rc""\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Cursor
//
NULLCURSOR CURSOR "cursor1.cur"
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
APPICON ICON "appicon.ico"
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION FILE_VERSION
PRODUCTVERSION PRODUCT_VERSION
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x40004L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", COMPANY_NAME
VALUE "FileDescription", FILE_DESCRIPTION
VALUE "FileVersion", FILE_VERSION_STRING
VALUE "InternalName", INTERNAL_NAME
VALUE "LegalCopyright", COPYRIGHT_NOTE
VALUE "OriginalFilename", ORIGINAL_FILENAME
VALUE "ProductName", ZOOMIT_PRODUCT_NAME
VALUE "ProductVersion", PRODUCT_VERSION_STRING
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
OPTIONS DIALOGEX 0, 0, 279, 325
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CLIPSIBLINGS | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_CONTROLPARENT
CAPTION "ZoomIt - Sysinternals: www.sysinternals.com"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
DEFPUSHBUTTON "OK",IDOK,166,306,50,14
PUSHBUTTON "Cancel",IDCANCEL,223,306,50,14
LTEXT "ZoomIt v9.0",IDC_VERSION,42,7,73,10
LTEXT "Copyright <20> 2006-2024 Mark Russinovich",IDC_COPYRIGHT,42,17,166,8
CONTROL "<a HREF=""https://www.sysinternals.com"">Sysinternals - www.sysinternals.com</a>",IDC_LINK,
"SysLink",WS_TABSTOP,42,26,150,9
ICON "APPICON",IDC_STATIC,12,9,20,20
CONTROL "Show tray icon",IDC_SHOW_TRAY_ICON,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,295,105,10
CONTROL "",IDC_TAB,"SysTabControl32",TCS_MULTILINE | WS_TABSTOP,8,46,265,245
CONTROL "Run ZoomIt when Windows starts",IDC_AUTOSTART,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,309,122,10
END
ADVANCED_BREAK DIALOGEX 0, 0, 209, 219
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Advanced Break Options"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
CONTROL "Play Sound on Expiration:",IDC_CHECK_SOUND_FILE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,3,11,98,10,WS_EX_RIGHT
EDITTEXT IDC_SOUND_FILE,61,38,125,12,ES_AUTOHSCROLL | ES_READONLY
PUSHBUTTON "&...",IDC_SOUND_BROWSE,187,38,13,11
COMBOBOX IDC_OPACITY,62,58,38,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
CONTROL "",IDC_TIMER_POS1,"Button",BS_AUTORADIOBUTTON,63,78,10,10
CONTROL "",IDC_TIMER_POS2,"Button",BS_AUTORADIOBUTTON,79,78,10,10
CONTROL "",IDC_TIMER_POS3,"Button",BS_AUTORADIOBUTTON,97,78,10,10
CONTROL "",IDC_TIMER_POS4,"Button",BS_AUTORADIOBUTTON,63,93,10,10
CONTROL "",IDC_TIMER_POS5,"Button",BS_AUTORADIOBUTTON,79,93,10,10
CONTROL "",IDC_TIMER_POS6,"Button",BS_AUTORADIOBUTTON,97,93,10,10
CONTROL "",IDC_TIMER_POS7,"Button",BS_AUTORADIOBUTTON,63,108,10,10
CONTROL "",IDC_TIMER_POS8,"Button",BS_AUTORADIOBUTTON,79,108,10,10
CONTROL "",IDC_TIMER_POS9,"Button",BS_AUTORADIOBUTTON,97,108,10,10
CONTROL "Show background bitmap:",IDC_CHECK_BACKGROUND_FILE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,3,122,99,10,WS_EX_RIGHT
CONTROL "Use faded desktop as background",IDC_STATIC_DESKTOP_BACKGROUND,
"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,46,135,125,10
CONTROL "Use image file as background",IDC_STATIC_BACKGROUND_FILE,
"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,46,149,109,10
EDITTEXT IDC_BACKGROUND_FILE,62,164,125,12,ES_AUTOHSCROLL | ES_READONLY
PUSHBUTTON "&...",IDC_BACKGROUND_BROWSE,188,164,13,11
CONTROL "Scale to screen:",IDC_CHECK_BACKGROUND_STRETCH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,58,180,67,10,WS_EX_RIGHT
DEFPUSHBUTTON "OK",IDOK,97,201,50,14
PUSHBUTTON "Cancel",IDCANCEL,150,201,50,14
LTEXT "Alarm Sound File:",IDC_STATIC_SOUND_FILE,61,26,56,8
LTEXT "Timer Opacity:",IDC_STATIC,8,59,48,8
LTEXT "Timer Position:",IDC_STATIC,8,77,48,8
CONTROL "",IDC_STATIC,"Static",SS_BLACKFRAME | SS_SUNKEN,7,196,193,1,WS_EX_CLIENTEDGE
END
ZOOM DIALOGEX 0, 0, 260, 158
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD | WS_CLIPSIBLINGS | WS_SYSMENU
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
CONTROL "",IDC_HOTKEY,"msctls_hotkey32",WS_BORDER | WS_TABSTOP,59,57,80,12
LTEXT "After toggling ZoomIt you can zoom in with the mouse wheel or up and down arrow keys. Exit zoom mode with Escape or by pressing the right mouse button.",IDC_STATIC,7,6,246,26
LTEXT "Zoom Toggle:",IDC_STATIC,7,59,51,8
CONTROL "",IDC_ZOOM_SLIDER,"msctls_trackbar32",TBS_AUTOTICKS | TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,53,104,150,15,WS_EX_TRANSPARENT
LTEXT "Specify the initial level of magnification when zooming in:",IDC_STATIC,7,91,215,10
LTEXT "1.25",IDC_STATIC,52,122,16,8
LTEXT "1.5",IDC_STATIC,82,122,12,8
LTEXT "1.75",IDC_STATIC,108,122,16,8
LTEXT "2.0",IDC_STATIC,138,122,12,8
LTEXT "3.0",IDC_STATIC,164,122,12,8
LTEXT "4.0",IDC_STATIC,190,122,12,8
CONTROL "Animate zoom in and zoom out:",IDC_ANIMATE_ZOOM,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,7,74,116,10
LTEXT "Copy a zoomed screen with Ctrl+C or save it by typing Ctrl+S. Crop the copy or save region by entering Ctrl+Shift instead of Ctrl.",IDC_STATIC,7,34,246,17
END
DRAW DIALOGEX 0, 0, 260, 228
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD | WS_SYSMENU
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
LTEXT "Once zoomed, toggle drawing mode by pressing the left mouse button. Undo with Ctrl+Z and all drawing by pressing E. Center the cursor with the space bar. Exit drawing mode by pressing the right mouse button.",IDC_STATIC,7,7,246,24
LTEXT "Pen Control ",IDC_PEN_CONTROL,7,38,40,8
LTEXT "Change the pen width by pressing left Ctrl and using the mouse wheel or the up and down arrow keys.",IDC_STATIC,19,48,233,16
LTEXT "Colors",IDC_COLORS,7,70,21,8
LTEXT "Change the pen color by pressing R (red), G (green), B (blue),\nO (orange), Y (yellow) or P (pink).",IDC_STATIC,19,80,233,16
LTEXT "Highlight and Blur",IDC_HIGHLIGHT_AND_BLUR,7,102,58,8
LTEXT "Hold Shift while pressing a color key for a translucent highlighter color. Press X for blur or Shift+X for a stronger blur.",IDC_STATIC,19,113,233,16
LTEXT "Shapes",IDC_SHAPES,7,134,23,8
LTEXT "Draw a line by holding down the Shift key, a rectangle with the Ctrl key, an ellipse with the Tab key and an arrow with Shift+Ctrl.",IDC_STATIC,19,144,233,16
LTEXT "Screen",IDC_SCREEN,7,166,22,8
LTEXT "Clear the screen for a sketch pad by pressing W (white) or K (black). Copy a zoomed screen with Ctrl+C or save it by typing Ctrl+S. Crop the copy or save region by entering Ctrl+Shift instead of Ctrl.",IDC_STATIC,19,176,233,24
CONTROL "",IDC_DRAW_HOTKEY,"msctls_hotkey32",WS_BORDER | WS_TABSTOP,73,207,80,12
LTEXT "Draw w/out Zoom:",IDC_STATIC,7,210,63,11
END
TYPE DIALOGEX 0, 0, 260, 104
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD | WS_SYSMENU
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
LTEXT "Once in drawing mode, type 't' to enter typing mode or shift+'t' to enter typing mode with right-aligned input. Exit typing mode by pressing escape or the left mouse button. Use the mouse wheel or up and down arrow keys to change the font size.",IDC_STATIC,7,7,246,32
LTEXT "The text color is the current drawing color.",IDC_STATIC,7,47,211,9
PUSHBUTTON "&Font",IDC_FONT,112,69,41,14
GROUPBOX "Text Font",IDC_TEXT_FONT,8,61,99,28
END
BREAK DIALOGEX 0, 0, 260, 123
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD | WS_SYSMENU
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
CONTROL "",IDC_BREAK_HOTKEY,"msctls_hotkey32",WS_BORDER | WS_TABSTOP,52,67,80,12
EDITTEXT IDC_TIMER,31,86,31,13,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER
CONTROL "",IDC_SPIN_TIMER,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,45,86,11,12
LTEXT "minutes",IDC_STATIC,67,88,25,8
PUSHBUTTON "&Advanced",IDC_ADVANCED_BREAK,212,102,41,14
LTEXT "Enter timer mode by using the ZoomIt tray icon's Break menu item. Increase and decrease time with the arrow keys. If you Alt-Tab away from the timer window, reactivate it by left-clicking on the ZoomIt tray icon. Exit timer mode with Escape. ",IDC_STATIC,7,7,246,33
LTEXT "Start Timer:",IDC_STATIC,7,70,39,8
LTEXT "Timer:",IDC_STATIC,7,88,20,8
LTEXT "Change the break timer color using the same keys that the drawing color. The break timer font is the same as text font.",IDC_STATIC,7,45,219,20
CONTROL "Show Time Elapsed After Expiration:",IDC_CHECK_SHOW_EXPIRED,
"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,8,104,132,10
END
1543 DIALOGEX 100, 50, 216, 131
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "ZoomIt Font"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
LTEXT "&Font:",1088,6,0,40,9
COMBOBOX 1136,6,10,94,64,CBS_SIMPLE | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | CBS_DISABLENOSCROLL | WS_VSCROLL | WS_TABSTOP
LTEXT "Font St&yle:",1089,108,0,44,9
COMBOBOX 1137,108,10,64,64,CBS_SIMPLE | CBS_DISABLENOSCROLL | WS_VSCROLL | WS_TABSTOP
LTEXT "&Size:",1090,179,0,30,9
COMBOBOX 1138,179,10,32,64,CBS_SIMPLE | CBS_OWNERDRAWFIXED | CBS_SORT | CBS_HASSTRINGS | CBS_DISABLENOSCROLL | WS_VSCROLL | WS_TABSTOP
DEFPUSHBUTTON "OK",IDOK,166,94,45,14,WS_GROUP
PUSHBUTTON "Cancel",IDCANCEL,166,111,45,14,WS_GROUP
GROUPBOX "Sample",1073,7,75,143,51,WS_GROUP
CTEXT "AaBbYyZz",1092,16,88,127,31,SS_NOPREFIX | NOT WS_VISIBLE
END
LIVEZOOM DIALOGEX 0, 0, 260, 134
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD | WS_SYSMENU
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
CONTROL "",IDC_LIVE_HOTKEY,"msctls_hotkey32",WS_BORDER | WS_TABSTOP,69,108,80,12
LTEXT "LiveZoom mode is supported on Windows 7 and higher where window updates show while zoomed. ",IDC_STATIC,7,7,246,18
LTEXT "LiveZoom Toggle:",IDC_STATIC,7,110,62,8
LTEXT "To enter and exit LiveZoom, enter the hotkey specified below.",IDC_STATIC,7,94,218,13
LTEXT "Note that in LiveZoom you must use Ctrl+Up and Ctrl+Down to control the zoom level. To enter drawing mode, use the standard zoom-without-draw hotkey and then escape to go back to LiveZoom.",IDC_STATIC,7,30,246,27
LTEXT "Use LiveDraw to draw and annotate the live desktop. To activate LiveDraw, enter the hotkey with the Shift key in the opposite mode. You can remove LiveDraw annotations by activating LiveDraw and enter the escape key",IDC_STATIC,7,62,246,32
END
RECORD DIALOGEX 0, 0, 260, 169
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD | WS_SYSMENU
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
CONTROL "",IDC_RECORD_HOTKEY,"msctls_hotkey32",WS_BORDER | WS_TABSTOP,61,96,80,12
LTEXT "Record Toggle:",IDC_STATIC,7,98,54,8
LTEXT "Record video of the unzoomed live screen or a static zoomed session by entering the recording hot key and finish the recording by entering it again. ",IDC_STATIC,7,7,246,28
LTEXT "Note: Recording is only available on Windows 10 (version 1903) and higher.",IDC_STATIC,7,77,246,19
LTEXT "Scaling:",IDC_STATIC,30,115,26,8
COMBOBOX IDC_RECORD_SCALING,61,114,26,30,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | CBS_OEMCONVERT | CBS_SORT | WS_VSCROLL | WS_TABSTOP
LTEXT "Frame Rate:",IDC_STATIC,119,115,44,8,NOT WS_VISIBLE
COMBOBOX IDC_RECORD_FRAME_RATE,166,114,42,30,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | CBS_OEMCONVERT | CBS_SORT | NOT WS_VISIBLE | WS_VSCROLL | WS_TABSTOP
LTEXT "To crop the portion of the screen that will be recorded, enter the hotkey with the Shift key in the opposite mode. ",IDC_STATIC,7,32,246,19
LTEXT "To record a specific window, enter the hotkey with the Alt key in the opposite mode.",IDC_STATIC,7,55,246,19
CONTROL "&Capture audio input:",IDC_CAPTURE_AUDIO,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,7,137,83,10
COMBOBOX IDC_MICROPHONE,81,152,172,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
LTEXT "Microphone:",IDC_STATIC,32,154,47,8
END
SNIP DIALOGEX 0, 0, 260, 68
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD | WS_CLIPSIBLINGS | WS_SYSMENU
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
CONTROL "",IDC_SNIP_HOTKEY,"msctls_hotkey32",WS_BORDER | WS_TABSTOP,55,32,80,12
LTEXT "Snip Toggle:",IDC_STATIC,7,33,45,8
LTEXT "Copy a region of the screen to the clipboard or enter the hotkey with the Shift key in the opposite mode to save it to a file. ",IDC_STATIC,7,7,246,19
END
DEMOTYPE DIALOGEX 0, 0, 259, 249
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD | WS_CLIPSIBLINGS | WS_SYSMENU
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
CONTROL "",IDC_DEMOTYPE_HOTKEY,"msctls_hotkey32",WS_BORDER | WS_TABSTOP,74,154,80,12
LTEXT "DemoType toggle:",IDC_STATIC,7,157,63,8
PUSHBUTTON "&...",IDC_DEMOTYPE_BROWSE,231,137,16,13
CONTROL "",IDC_DEMOTYPE_SPEED_SLIDER,"msctls_trackbar32",TBS_AUTOTICKS | TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,52,202,150,11,WS_EX_TRANSPARENT
CONTROL "Drive input with typing:",IDC_DEMOTYPE_USER_DRIVEN,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,7,173,88,10
LTEXT "DemoType typing speed:",IDC_STATIC,7,189,215,10
LTEXT "Slow",IDC_DEMOTYPE_STATIC1,51,213,18,8
LTEXT "Fast",IDC_DEMOTYPE_STATIC2,186,213,17,8
EDITTEXT IDC_DEMOTYPE_FILE,44,137,187,12,ES_AUTOHSCROLL | ES_READONLY
LTEXT "Input file:",IDC_STATIC,7,139,32,8
LTEXT "When you reach the end of the file, ZoomIt will reload the file and start at the beginning. Enter the hotkey with the Shift key in the opposite mode to step back to the last [end].",IDC_STATIC,7,108,248,24
LTEXT "DemoType has ZoomIt type text specified in the input file when you enter the DemoType toggle. Simply separate snippets with the [end] keyword, or you can insert text from the clipboard if it is prefixed with the [start].",IDC_STATIC,7,7,248,24
LTEXT " - Insert pauses with the [pause:n] keyword where 'n' is seconds. ",IDC_STATIC,19,34,212,11
LTEXT "You can have ZoomIt send text automatically, or select the option to drive input with typing. ZoomIt will block keyboard input while sending output.",IDC_STATIC,7,68,248,16
LTEXT "When driving input, hit the space bar to unblock keyboard input at the end of a snippet. In auto mode, control will be returned upon completion.",IDC_STATIC,7,88,248,16
LTEXT "- Send text via the clipboard with [paste] and [/paste]. ",IDC_STATIC,23,45,178,8
LTEXT "- Send keystrokes with [enter], [up], [down], [left], and [right].",IDC_STATIC,23,56,211,8
END
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO
BEGIN
"OPTIONS", DIALOG
BEGIN
RIGHTMARGIN, 273
BOTTOMMARGIN, 320
END
"ADVANCED_BREAK", DIALOG
BEGIN
RIGHTMARGIN, 207
BOTTOMMARGIN, 215
END
"ZOOM", DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 253
TOPMARGIN, 7
BOTTOMMARGIN, 151
END
"DRAW", DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 253
TOPMARGIN, 7
BOTTOMMARGIN, 221
END
"TYPE", DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 253
TOPMARGIN, 7
BOTTOMMARGIN, 97
END
"BREAK", DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 253
TOPMARGIN, 7
BOTTOMMARGIN, 116
END
1543, DIALOG
BEGIN
RIGHTMARGIN, 211
BOTTOMMARGIN, 127
END
"LIVEZOOM", DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 253
TOPMARGIN, 7
BOTTOMMARGIN, 127
END
"RECORD", DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 253
TOPMARGIN, 7
BOTTOMMARGIN, 164
END
"SNIP", DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 253
TOPMARGIN, 7
BOTTOMMARGIN, 61
END
"DEMOTYPE", DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 255
TOPMARGIN, 7
BOTTOMMARGIN, 205
END
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Accelerator
//
ACCELERATORS ACCELERATORS
BEGIN
"C", IDC_COPY, VIRTKEY, CONTROL, NOINVERT
"S", IDC_SAVE, VIRTKEY, CONTROL, NOINVERT
"C", IDC_COPY_CROP, VIRTKEY, SHIFT, CONTROL, NOINVERT
"S", IDC_SAVE_CROP, VIRTKEY, SHIFT, CONTROL, NOINVERT
END
/////////////////////////////////////////////////////////////////////////////
//
// AFX_DIALOG_LAYOUT
//
OPTIONS AFX_DIALOG_LAYOUT
BEGIN
0
END
LIVEZOOM AFX_DIALOG_LAYOUT
BEGIN
0
END
DRAW AFX_DIALOG_LAYOUT
BEGIN
0
END
RECORD AFX_DIALOG_LAYOUT
BEGIN
0
END
TYPE AFX_DIALOG_LAYOUT
BEGIN
0
END
ZOOM AFX_DIALOG_LAYOUT
BEGIN
0
END
SNIP AFX_DIALOG_LAYOUT
BEGIN
0
END
BREAK AFX_DIALOG_LAYOUT
BEGIN
0
END
DEMOTYPE AFX_DIALOG_LAYOUT
BEGIN
0
END
#endif // English (United States) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
#include "binres.rc"
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

Просмотреть файл

@ -0,0 +1,370 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.props')" />
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|ARM64">
<Configuration>Debug</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64">
<Configuration>Release</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{0A84F764-3A88-44CD-AA96-41BDBD48627B}</ProjectGuid>
<RootNamespace>ZoomIt</RootNamespace>
<CppWinRTRootNamespaceAutoMerge>true</CppWinRTRootNamespaceAutoMerge>
<CppWinRTOptimized>true</CppWinRTOptimized>
<CppWinRTGenerateWindowsMetadata>true</CppWinRTGenerateWindowsMetadata>
<TargetName>PowerToys.$(MSBuildProjectName)</TargetName>
</PropertyGroup>
<PropertyGroup Label="Configuration">
<UseOfMfc>false</UseOfMfc>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<GenerateManifest>false</GenerateManifest>
<InterPlatformDir>$(ProjectDir)$(Configuration)\InterPlatform\</InterPlatformDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<GenerateManifest>false</GenerateManifest>
<InterPlatformDir>$(ProjectDir)$(Configuration)\InterPlatform\</InterPlatformDir>
<BinaryDependencyName>RCZOOMIT</BinaryDependencyName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<GenerateManifest>false</GenerateManifest>
<BinaryDependencyName>RCZOOMIT</BinaryDependencyName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<GenerateManifest>false</GenerateManifest>
<InterPlatformDir>$(ProjectDir)$(Configuration)\InterPlatform\</InterPlatformDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<GenerateManifest>false</GenerateManifest>
<InterPlatformDir>$(ProjectDir)$(Configuration)\InterPlatform\</InterPlatformDir>
<BinaryDependencyName>RCZOOMIT</BinaryDependencyName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
<GenerateManifest>false</GenerateManifest>
<BinaryDependencyName>RCZOOMIT</BinaryDependencyName>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<DisableSpecificWarnings>4100;4091;4245</DisableSpecificWarnings>
<AdditionalIncludeDirectories>..\..\..\;$(MSBuildThisFileDirectory)..\..\..\common\sysinternals;%(AdditionalIncludeDirectories);</AdditionalIncludeDirectories>
<PrecompiledHeader>Create</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<LanguageStandard>stdcpplatest</LanguageStandard>
<LanguageStandard_C>stdc17</LanguageStandard_C>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<PreprocessorDefinitions>__ZOOMIT_POWERTOYS__;_UNICODE;UNICODE;WINVER=0x602;NDEBUG;_WIN32_WINNT=0x602;_WIN32_WINDOWS=0x501;WIN32;_WINDOWS;MSVC6=1;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;_M_IX86;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
<AdditionalIncludeDirectories>$(MSBuildThisFileDirectory)..\..\..\common\version;$(MSBuildThisFileDirectory)PowerToys;$(InterPlatformDir)</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
<AdditionalDependencies>Shlwapi.lib;comctl32.lib;odbc32.lib;odbccp32.lib;version.lib;Winmm.lib;gdiplus.lib;Msimg32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<RandomizedBaseAddress>true</RandomizedBaseAddress>
<DataExecutionPrevention>true</DataExecutionPrevention>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<PreprocessorDefinitions>__ZOOMIT_POWERTOYS__;_UNICODE;UNICODE;WINVER=0x602;NDEBUG;_WIN32_WINNT=0x602;_WIN32_WINDOWS=0x501;WIN32;_WINDOWS;MSVC6=1;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;_M_X64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
<AdditionalIncludeDirectories>$(MSBuildThisFileDirectory)..\..\..\common\version;$(MSBuildThisFileDirectory)PowerToys;</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
<AdditionalDependencies>Shlwapi.lib;comctl32.lib;odbc32.lib;odbccp32.lib;version.lib;Winmm.lib;gdiplus.lib;Msimg32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<RandomizedBaseAddress>true</RandomizedBaseAddress>
<FixedBaseAddress />
<DataExecutionPrevention>true</DataExecutionPrevention>
<TargetMachine>MachineX64</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<PreprocessorDefinitions>__ZOOMIT_POWERTOYS__;_UNICODE;UNICODE;WINVER=0x602;NDEBUG;_WIN32_WINNT=0x602;_WIN32_WINDOWS=0x501;WIN32;_WINDOWS;MSVC6=1;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;_M_ARM64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
<AdditionalIncludeDirectories>$(MSBuildThisFileDirectory)..\..\..\common\version;$(MSBuildThisFileDirectory)PowerToys;</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
<AdditionalDependencies>Shlwapi.lib;comctl32.lib;odbc32.lib;odbccp32.lib;version.lib;Winmm.lib;gdiplus.lib;Msimg32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<FixedBaseAddress>
</FixedBaseAddress>
<DataExecutionPrevention>true</DataExecutionPrevention>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>__ZOOMIT_POWERTOYS__;_UNICODE;UNICODE;WINVER=0x0602;_DEBUG;_WIN32_WINNT=0x602.MSVC6;_WIN32_WINDOWS=0x600;WIN32;_WINDOWS;_WIN32_WINNT=0x602;MSVC6=1;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;_M_IX86;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
<AdditionalIncludeDirectories>$(MSBuildThisFileDirectory)..\..\..\common\version;$(MSBuildThisFileDirectory)PowerToys;$(InterPlatformDir)</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
<AdditionalDependencies>Shlwapi.lib;comctl32.lib;odbc32.lib;odbccp32.lib;version.lib;Winmm.lib;gdiplus.lib;Msimg32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention />
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>__ZOOMIT_POWERTOYS__;_UNICODE;UNICODE;WINVER=0x0602;_DEBUG;_WIN32_WINNT=0x602.MSVC6;_WIN32_WINDOWS=0x600;WIN32;_WINDOWS;_WIN32_WINNT=0x602;MSVC6=1;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;_M_X64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
<AdditionalIncludeDirectories>$(MSBuildThisFileDirectory)..\..\..\common\version;$(MSBuildThisFileDirectory)PowerToys;</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
<AdditionalDependencies>Shlwapi.lib;comctl32.lib;odbc32.lib;odbccp32.lib;version.lib;version.lib;Winmm.lib;gdiplus.lib;Msimg32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<UACUIAccess>true</UACUIAccess>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention />
<TargetMachine>MachineX64</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>__ZOOMIT_POWERTOYS__;_UNICODE;UNICODE;WINVER=0x0602;_DEBUG;_WIN32_WINNT=0x602.MSVC6;_WIN32_WINDOWS=0x600;WIN32;_WINDOWS;_WIN32_WINNT=0x602;MSVC6=1;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;_M_ARM64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
<AdditionalIncludeDirectories>$(MSBuildThisFileDirectory)..\..\..\common\version;$(MSBuildThisFileDirectory)PowerToys;</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
<AdditionalDependencies>Shlwapi.lib;comctl32.lib;odbc32.lib;odbccp32.lib;version.lib;Winmm.lib;gdiplus.lib;Msimg32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<UACUIAccess>true</UACUIAccess>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<DataExecutionPrevention>
</DataExecutionPrevention>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="AudioSampleGenerator.cpp">
<MultiProcessorCompilation Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</MultiProcessorCompilation>
<MultiProcessorCompilation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</MultiProcessorCompilation>
<MultiProcessorCompilation Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">false</MultiProcessorCompilation>
<MultiProcessorCompilation Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">false</MultiProcessorCompilation>
<MultiProcessorCompilation Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</MultiProcessorCompilation>
<MultiProcessorCompilation Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</MultiProcessorCompilation>
</ClCompile>
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\common\sysinternals\dll.c">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\common\sysinternals\Eula\eula.c">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\common\sysinternals\WindowsVersions.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="pch.cpp" />
<ClCompile Include="SelectRectangle.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Use</PrecompiledHeader>
</ClCompile>
<ClCompile Include="Utility.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Use</PrecompiledHeader>
</ClCompile>
<ClCompile Include="DemoType.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Use</PrecompiledHeader>
</ClCompile>
<ClCompile Include="VersionHelper.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Use</PrecompiledHeader>
</ClCompile>
<ClCompile Include="VideoRecordingSession.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Use</PrecompiledHeader>
</ClCompile>
<ClCompile Include="Zoomit.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Use</PrecompiledHeader>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="AudioSampleGenerator.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\common\sysinternals\Eula\Eula.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\ZoomItModuleInterface\Trace.h" />
<ClInclude Include="pch.h" />
<ClInclude Include="Registry.h" />
<ClInclude Include="resource.h" />
<ClInclude Include="SelectRectangle.h" />
<ClInclude Include="Utility.h" />
<ClInclude Include="DemoType.h" />
<ClInclude Include="VersionHelper.h" />
<ClInclude Include="VideoRecordingSession.h" />
<ClInclude Include="ZoomIt.h" />
<ClInclude Include="ZoomItSettings.h" />
</ItemGroup>
<ItemGroup>
<Image Include="appicon.ico" />
<Image Include="icon1.ico" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="$(MSBuildThisFileDirectory)..\ZoomItModuleInterface\Trace.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Use</PrecompiledHeader>
</ClCompile>
<ClCompile Include="CaptureFrameWait.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Use</PrecompiledHeader>
</ClCompile>
<None Include="CaptureFrameWait.h" />
<None Include="cursor1.cur" />
<None Include="hand.cur" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="binres.rc">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">true</ExcludedFromBuild>
</ResourceCompile>
<ResourceCompile Include="ZoomIt.rc" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\common\logger\logger.vcxproj">
<Project>{d9b8fc84-322a-4f9f-bbb9-20915c47ddfd}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\common\SettingsAPI\SettingsAPI.vcxproj">
<Project>{6955446d-23f7-4023-9bb3-8657f904af99}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\common\Telemetry\EtwTrace\EtwTrace.vcxproj">
<Project>{8f021b46-362b-485c-bfba-ccf83e820cbd}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<Import Project="..\..\..\..\deps\spdlog.props" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\..\..\packages\robmikh.common.0.0.23-beta\build\native\robmikh.common.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\robmikh.common.0.0.23-beta\build\native\robmikh.common.targets'))" />
<Error Condition="!Exists('..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.props'))" />
<Error Condition="!Exists('..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.targets'))" />
<Error Condition="!Exists('..\..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.231216.1\build\native\Microsoft.Windows.ImplementationLibrary.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.231216.1\build\native\Microsoft.Windows.ImplementationLibrary.targets'))" />
</Target>
<Import Project="..\..\..\..\packages\robmikh.common.0.0.23-beta\build\native\robmikh.common.targets" Condition="Exists('..\..\..\..\packages\robmikh.common.0.0.23-beta\build\native\robmikh.common.targets')" />
<Import Project="..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.targets')" />
<Import Project="..\..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.231216.1\build\native\Microsoft.Windows.ImplementationLibrary.targets" Condition="Exists('..\..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.231216.1\build\native\Microsoft.Windows.ImplementationLibrary.targets')" />
</Project>

Просмотреть файл

@ -0,0 +1,130 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{73afce48-6609-48fb-86f2-db7b72a1c1ec}</UniqueIdentifier>
<Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{db948f16-61f7-47ab-96c8-57914076a38a}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{e1fa606f-a2e6-40c8-8779-8ca1813d9f01}</UniqueIdentifier>
<Extensions>ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="Zoomit.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="CaptureFrameWait.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="pch.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="SelectRectangle.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Utility.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="AudioSampleGenerator.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="DemoType.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="VersionHelper.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="VideoRecordingSession.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="$(MSBuildThisFileDirectory)..\ZoomItModuleInterface\Trace.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\common\sysinternals\dll.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\common\sysinternals\Eula\eula.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\common\sysinternals\WindowsVersions.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="Registry.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="resource.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="ZoomIt.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="pch.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="SelectRectangle.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Utility.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="AudioSampleGenerator.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="DemoType.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="VersionHelper.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="VideoRecordingSession.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="$(MSBuildThisFileDirectory)..\ZoomItModuleInterface\Trace.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\common\sysinternals\Eula\Eula.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="ZoomItSettings.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Image Include="appicon.ico">
<Filter>Resource Files</Filter>
</Image>
<Image Include="icon1.ico">
<Filter>Resource Files</Filter>
</Image>
</ItemGroup>
<ItemGroup>
<None Include="cursor1.cur">
<Filter>Resource Files</Filter>
</None>
<None Include="hand.cur">
<Filter>Resource Files</Filter>
</None>
<None Include="CaptureFrameWait.h">
<Filter>Header Files</Filter>
</None>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="ZoomIt.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
<ResourceCompile Include="binres.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
<ItemGroup>
<Natvis Include="$(MSBuildThisFileDirectory)..\..\natvis\wil.natvis" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,83 @@
#pragma once
#include "zoomit.h"
#include "Registry.h"
#include "DemoType.h"
DWORD g_ToggleKey = (HOTKEYF_CONTROL << 8)| '1';
DWORD g_LiveZoomToggleKey = ((HOTKEYF_CONTROL) << 8)| '4';
DWORD g_DrawToggleKey = ((HOTKEYF_CONTROL) << 8)| '2';
DWORD g_BreakToggleKey = ((HOTKEYF_CONTROL) << 8)| '3';
DWORD g_DemoTypeToggleKey = ((HOTKEYF_CONTROL) << 8) | '7';
DWORD g_RecordToggleKey = ((HOTKEYF_CONTROL) << 8) | '5';
DWORD g_SnipToggleKey = ((HOTKEYF_CONTROL) << 8) | '6';
DWORD g_ShowExpiredTime = 1;
DWORD g_SliderZoomLevel = 3;
BOOLEAN g_AnimateZoom = TRUE;
DWORD g_PenColor = COLOR_RED;
DWORD g_BreakPenColor = COLOR_RED;
DWORD g_RootPenWidth = PEN_WIDTH;
int g_FontScale = 10;
DWORD g_BreakTimeout = 10;
DWORD g_BreakOpacity = 100;
DWORD g_BreakTimerPosition = 4;
BOOLEAN g_BreakPlaySoundFile = FALSE;
TCHAR g_BreakSoundFile[MAX_PATH] = {0};
BOOLEAN g_BreakShowDesktop = TRUE;
BOOLEAN g_BreakShowBackgroundFile = FALSE;
BOOLEAN g_BreakBackgroundStretch = FALSE;
TCHAR g_BreakBackgroundFile[MAX_PATH] = {0};
BOOLEAN g_OptionsShown = FALSE;
BOOLEAN g_ShowTrayIcon = TRUE;
BOOLEAN g_SnapToGrid = TRUE;
BOOLEAN g_TelescopeZoomOut = TRUE;
BOOLEAN g_BreakOnSecondary = FALSE;
LOGFONT g_LogFont;
BOOLEAN g_DemoTypeUserDriven = false;
TCHAR g_DemoTypeFile[MAX_PATH] = {0};
DWORD g_DemoTypeSpeedSlider = static_cast<int>(((MIN_TYPING_SPEED - MAX_TYPING_SPEED) / 2) + MAX_TYPING_SPEED);
DWORD g_RecordFrameRate = 30;
// Divide by 100 to get actual scaling
DWORD g_RecordScaling = 100;
BOOLEAN g_CaptureAudio = FALSE;
TCHAR g_MicrophoneDeviceId[MAX_PATH] = {0};
REG_SETTING RegSettings[] = {
{ L"ToggleKey", SETTING_TYPE_DWORD, 0, &g_ToggleKey, static_cast<DOUBLE>(g_ToggleKey) },
{ L"LiveZoomToggleKey", SETTING_TYPE_DWORD, 0, &g_LiveZoomToggleKey, static_cast<DOUBLE>(g_LiveZoomToggleKey) },
{ L"DrawToggleKey", SETTING_TYPE_DWORD, 0, &g_DrawToggleKey, static_cast<DOUBLE>(g_DrawToggleKey) },
{ L"RecordToggleKey", SETTING_TYPE_DWORD, 0, &g_RecordToggleKey, static_cast<DOUBLE>(g_RecordToggleKey) },
{ L"SnipToggleKey", SETTING_TYPE_DWORD, 0, &g_SnipToggleKey, static_cast<DOUBLE>(g_SnipToggleKey) },
{ L"PenColor", SETTING_TYPE_DWORD, 0, &g_PenColor, static_cast<DOUBLE>(g_PenColor) },
{ L"PenWidth", SETTING_TYPE_DWORD, 0, &g_RootPenWidth, static_cast<DOUBLE>(g_RootPenWidth) },
{ L"OptionsShown", SETTING_TYPE_BOOLEAN, 0, &g_OptionsShown, static_cast<DOUBLE>(g_OptionsShown) },
{ L"BreakPenColor", SETTING_TYPE_DWORD, 0, &g_BreakPenColor, static_cast<DOUBLE>(g_BreakPenColor) },
{ L"BreakTimerKey", SETTING_TYPE_DWORD, 0, &g_BreakToggleKey, static_cast<DOUBLE>(g_BreakToggleKey) },
{ L"DemoTypeToggleKey", SETTING_TYPE_DWORD, 0, &g_DemoTypeToggleKey, static_cast<DOUBLE>(g_DemoTypeToggleKey) },
{ L"DemoTypeFile", SETTING_TYPE_STRING, sizeof( g_DemoTypeFile ), g_DemoTypeFile, static_cast<DOUBLE>(0) },
{ L"DemoTypeSpeedSlider", SETTING_TYPE_DWORD, 0, &g_DemoTypeSpeedSlider, static_cast<DOUBLE>(g_DemoTypeSpeedSlider) },
{ L"DemoTypeUserDrivenMode", SETTING_TYPE_BOOLEAN, 0, &g_DemoTypeUserDriven, static_cast<DOUBLE>(g_DemoTypeUserDriven) },
{ L"BreakTimeout", SETTING_TYPE_DWORD, 0, &g_BreakTimeout, static_cast<DOUBLE>(g_BreakTimeout) },
{ L"BreakOpacity", SETTING_TYPE_DWORD, 0, &g_BreakOpacity, static_cast<DOUBLE>(g_BreakOpacity) },
{ L"BreakPlaySoundFile", SETTING_TYPE_BOOLEAN, 0, &g_BreakPlaySoundFile, static_cast<DOUBLE>(0) },
{ L"BreakSoundFile", SETTING_TYPE_STRING, sizeof(g_BreakSoundFile), g_BreakSoundFile, static_cast<DOUBLE>(0) },
{ L"BreakShowBackgroundFile", SETTING_TYPE_BOOLEAN, 0, &g_BreakShowBackgroundFile, static_cast<DOUBLE>(g_BreakShowBackgroundFile) },
{ L"BreakBackgroundStretch", SETTING_TYPE_BOOLEAN, 0, &g_BreakBackgroundStretch,static_cast<DOUBLE>(g_BreakBackgroundStretch) },
{ L"BreakBackgroundFile", SETTING_TYPE_STRING, sizeof(g_BreakBackgroundFile), g_BreakBackgroundFile, static_cast<DOUBLE>(0) },
{ L"BreakTimerPosition", SETTING_TYPE_DWORD, 0, &g_BreakTimerPosition, static_cast<DOUBLE>(g_BreakTimerPosition) },
{ L"BreakShowDesktop", SETTING_TYPE_BOOLEAN, 0, &g_BreakShowDesktop, static_cast<DOUBLE>(g_BreakShowDesktop) },
{ L"BreakOnSecondary", SETTING_TYPE_BOOLEAN, 0, &g_BreakOnSecondary,static_cast<DOUBLE>(g_BreakOnSecondary) },
{ L"FontScale", SETTING_TYPE_DWORD, 0, &g_FontScale, static_cast<DOUBLE>(g_FontScale) },
{ L"ShowExpiredTime", SETTING_TYPE_BOOLEAN, 0, &g_ShowExpiredTime, static_cast<DOUBLE>(g_ShowExpiredTime) },
{ L"ShowTrayIcon", SETTING_TYPE_BOOLEAN, 0, &g_ShowTrayIcon, static_cast<DOUBLE>(g_ShowTrayIcon) },
{ L"AnimnateZoom", SETTING_TYPE_BOOLEAN, 0, &g_AnimateZoom, static_cast<DOUBLE>(g_AnimateZoom) },
{ L"TelescopeZoomOut", SETTING_TYPE_BOOLEAN, 0, &g_TelescopeZoomOut, static_cast<DOUBLE>(g_TelescopeZoomOut) },
{ L"SnapToGrid", SETTING_TYPE_BOOLEAN, 0, &g_SnapToGrid, static_cast<DOUBLE>(g_SnapToGrid) },
{ L"ZoominSliderLevel", SETTING_TYPE_DWORD, 0, &g_SliderZoomLevel, static_cast<DOUBLE>(g_SliderZoomLevel) },
{ L"Font", SETTING_TYPE_BINARY, sizeof g_LogFont, &g_LogFont, static_cast<DOUBLE>(0) },
{ L"RecordFrameRate", SETTING_TYPE_DWORD, 0, &g_RecordFrameRate, static_cast<DOUBLE>(g_RecordFrameRate) },
{ L"RecordScaling", SETTING_TYPE_DWORD, 0, &g_RecordScaling, static_cast<DOUBLE>(g_RecordScaling) },
{ L"CaptureAudio", SETTING_TYPE_BOOLEAN, 0, &g_CaptureAudio, static_cast<DOUBLE>(g_CaptureAudio) },
{ L"MicrophoneDeviceId", SETTING_TYPE_STRING, sizeof(g_MicrophoneDeviceId), g_MicrophoneDeviceId, static_cast<DOUBLE>(0) },
{ NULL, SETTING_TYPE_DWORD, 0, NULL, static_cast<DOUBLE>(0) }
};

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly
xmlns="urn:schemas-microsoft-com:asm.v1"
manifestVersion="1.0">
<assemblyIdentity
name="ZoomIt"
version="1.0.0.0"
type="win32"
processorArchitecture="*"/>
<description>Sysinternals Zoomit</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
type="win32"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"/>
</dependentAssembly>
</dependency>
<trustInfo>
<security>
<requestedPrivileges>
<requestedExecutionLevel
level="asInvoker" />
</requestedPrivileges>
</security>
</trustInfo>
<application>
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">per monitor</dpiAware>
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2</dpiAwareness>
</windowsSettings>
</application>
</assembly>

Двоичные данные
src/modules/ZoomIt/ZoomIt/appicon.ico Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 82 KiB

Просмотреть файл

@ -0,0 +1,18 @@
//
// This file allows for CPU architecture dependencies
#ifdef _M_IX86
//
// x86
//
// To prevent Visual Studio dependency tracking logic from assuming that the x64 .res depend on the .exe that contain them, trick it with the macros
// The .rc's included below will be touched every time any of the .exe's mentioned in them is rebuilt thus guaranteeing the Win32 .rc will be recompiled too
#include "Dependency-x64.rc"
RCZOOMIT64 BINRES MOVEABLE PURE RCZOOMIT_x64_path
#endif
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "ZoomIt.exe.manifest"

Двоичные данные
src/modules/ZoomIt/ZoomIt/cursor1.cur Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 326 B

Двоичные данные
src/modules/ZoomIt/ZoomIt/drawingc.cur Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 326 B

Двоичные данные
src/modules/ZoomIt/ZoomIt/icon1.ico Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 766 B

Просмотреть файл

@ -0,0 +1,58 @@
# Microsoft Developer Studio Generated NMAKE File, Based on procmon.dsp
!IF "$(CFG)" == ""
CFG=release
!MESSAGE No configuration specified. Defaulting to procmon - Release.
!ENDIF
!IF "$(CFG)" != "release" && "$(CFG)" != "debug"
!MESSAGE Invalid configuration "$(CFG)" specified.
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE CFG="release"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "release"
!MESSAGE "debug"
!MESSAGE
!ERROR An invalid configuration is specified.
!ENDIF
!IF "$(OS)" == "Windows_NT"
NULL=
!ELSE
NULL=nul
!ENDIF
!IF "$(CFG)" == "release"
ALL : SUBMODULEUPDATE ZOOMITX64 ZOOMIT64A ZOOMIT32
ZOOMITX64:
msbuild.exe -m ZoomIt.sln /p:Configuration=Release /p:Platform=x64
ZOOMIT64A:
msbuild.exe -m ZoomIt.sln /p:Configuration=Release /p:Platform=ARM64
ZOOMIT32:
msbuild.exe -m ZoomIt.sln /p:Configuration=Release /p:Platform=Win32
!ELSEIF "$(CFG)" == "debug"
ALL : SUBMODULEUPDATE ZOOMITX64 ZOOMIT64A ZOOMIT32
ZOOMITX64:
msbuild.exe -m ZoomIt.sln /p:Configuration=Debug /p:Platform=x64
ZOOMIT64A:
msbuild.exe -m ZoomIt.sln /p:Configuration=Debug /p:Platform=ARM64
ZOOMIT32:
msbuild.exe -m ZoomIt.sln /p:Configuration=Debug /p:Platform=Win32
!ENDIF
SUBMODULEUPDATE:
if not exist modules\Build\.git call modules\update.cmd

Просмотреть файл

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Windows.CppWinRT" version="2.0.240111.5" targetFramework="native" />
<package id="Microsoft.Windows.ImplementationLibrary" version="1.0.231216.1" targetFramework="native" />
<package id="robmikh.common" version="0.0.23-beta" targetFramework="native" />
</packages>

Просмотреть файл

@ -0,0 +1 @@
#include "pch.h"

Просмотреть файл

@ -0,0 +1,97 @@
#pragma once
#include <windows.h>
#include <windowsx.h>
#include <commctrl.h>
#include <WinUser.h>
#include <shlobj.h>
#include <tchar.h>
#include <wincodec.h>
#include <magnification.h>
#include <Uxtheme.h>
#include <math.h>
#include <shellapi.h>
#include <shlwapi.h>
#include <stdio.h>
#include "Eula/eula.h"
#include "registry.h"
#include "resource.h"
#include "dll.h"
#define GDIPVER 0x0110
#include <gdiplus.h>
// Must come before C++/WinRT
#include <wil/cppwinrt.h>
#include <wincodec.h>
// WinRT
#include <winrt/Windows.Foundation.h>
#include <winrt/Windows.Foundation.Collections.h>
#include <winrt/Windows.Foundation.Metadata.h>
#include <winrt/Windows.Foundation.Numerics.h>
#include <winrt/Windows.System.h>
#include <winrt/Windows.UI.h>
#include <winrt/Windows.UI.Composition.h>
#include <winrt/Windows.UI.Composition.Desktop.h>
#include <winrt/Windows.UI.Popups.h>
#include <winrt/Windows.Graphics.Capture.h>
#include <winrt/Windows.Graphics.Imaging.h>
#include <winrt/Windows.Graphics.DirectX.h>
#include <winrt/Windows.Graphics.DirectX.Direct3d11.h>
#include <winrt/Windows.Media.h>
#include <winrt/Windows.Media.Core.h>
#include <winrt/Windows.Media.Transcoding.h>
#include <winrt/Windows.Media.MediaProperties.h>
#include <winrt/Windows.Media.Devices.h>
#include <winrt/Windows.Storage.h>
#include <winrt/Windows.Storage.Streams.h>
#include <winrt/Windows.Storage.Pickers.h>
#include <winrt/Windows.Devices.Enumeration.h>
#include <filesystem>
// Direct3D wrappers to avoid implicitly linking to d3d11.dll; must come before declaration
#define CreateDirect3D11DeviceFromDXGIDevice WrapCreateDirect3D11DeviceFromDXGIDevice
#define CreateDirect3D11SurfaceFromDXGISurface WrapCreateDirect3D11SurfaceFromDXGISurface
#define D3D11CreateDevice WrapD3D11CreateDevice
#include "VideoRecordingSession.h"
#include "SelectRectangle.h"
#include "DemoType.h"
#include "versionhelper.h"
// WIL
#include <wil/com.h>
#include <wil/resource.h>
// DirectX
#include <d3d11_4.h>
#include <dxgi1_6.h>
#include <d2d1_3.h>
// STL
#include <vector>
#include <string>
#include <list>
#include <atomic>
#include <memory>
#include <algorithm>
#include <filesystem>
#include <future>
#include <regex>
#include <fstream>
#include <sstream>
// robmikh.common
#include <robmikh.common/composition.interop.h>
#include <robmikh.common/direct3d11.interop.h>
#include <robmikh.common/d3d11Helpers.h>
#include <robmikh.common/graphics.interop.h>
#include <robmikh.common/dispatcherQueue.desktop.interop.h>
#include <robmikh.common/d3d11Helpers.desktop.h>
#include <robmikh.common/composition.desktop.interop.h>
#include <robmikh.common/hwnd.interop.h>
#include <robmikh.common/capture.desktop.interop.h>
#include <robmikh.common/DesktopWindow.h>

Просмотреть файл

@ -0,0 +1,115 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by ZoomIt.rc
//
//////////////////////////////
// Non-localizable
#define FILE_DESCRIPTION "Sysinternals Screen Magnifier"
#define INTERNAL_NAME "ZoomIt"
#define ORIGINAL_FILENAME "PowerToys.ZoomIt.exe"
// Non-localizable
//////////////////////////////
#define IDC_AUDIO 117
#define IDC_LINK 1000
#define IDC_ALT 1001
#define IDC_CTRL 1002
#define IDC_TOGGLE 1003
#define IDC_OPTIONS 1004
#define IDC_COLOR_PICK 1005
#define IDC_COLOR 1006
#define IDC_DRAW 1007
#define IDC_TITLE 1008
#define IDC_VERSION 1008
#define IDC_ZOOM 1009
#define IDC_DRAWING 1010
#define IDC_BREAK 1011
#define IDC_HOTKEY 1014
#define IDC_DRAW_HOTKEY 1015
#define IDC_HOTKEY2 1015
#define IDC_LIVE_HOTKEY 1015
#define IDC_BREAK_HOTKEY 1016
#define IDC_SOUND_FILE 1017
#define IDC_BACKGROUND_FILE 1018
#define IDC_SPIN 1022
#define IDC_SPIN_TIMER 1023
#define IDC_SOUND_BROWSE 1025
#define IDC_OPACITY 1026
#define IDC_CHECK1 1027
#define IDC_ADVANCED_BREAK 1027
#define IDC_CHECK_SOUND_FILE 1027
#define IDC_CHECK_BACKGROUND_FILE 1028
#define IDC_BACKGROUND_BROWSE 1029
#define IDC_TIMER_POS1 1030
#define IDC_TIMER_POS2 1031
#define IDC_TIMER_POS3 1032
#define IDC_TIMER_POS4 1033
#define IDC_TIMER_POS5 1034
#define IDC_TIMER_POS6 1035
#define IDC_TIMER_POS7 1036
#define IDC_TIMER_POS8 1037
#define IDC_TIMER_POS9 1038
#define IDC_STATIC_SOUND_FILE 1039
#define IDC_EDIT1 1040
#define IDC_STATIC_BACKGROUND_FILE 1040
#define IDC_TYPE 1041
#define IDC_CHECK2 1042
#define IDC_CHECK_SHOW_EXPIRED 1042
#define IDC_TRAY_ICON 1042
#define IDC_HIDE_TRAY_ICON 1042
#define IDC_SHOW_TRAY_ICON 1042
#define IDC_AUTOSTART 1043
#define IDC_CHECK_BACKGROUND_STRETCH 1046
#define IDC_STATIC_DESKTOP_BACKGROUND 1047
#define IDC_STATIC_DESKTOP_BACKGROUND 1047
#define IDC_TAB 1050
#define IDC_FONT 1051
#define IDC_ZOOM_SPIN_TIMER 1052
#define IDC_ZOOM_SPIN 1052
#define IDC_ZOOM_LEVEL 1053
#define IDC_TEXT_FONT 1054
#define IDC_ZOOM_SLIDER 1056
#define IDC_ANIMATE_ZOOM 1057
#define IDC_COMBO1 1058
#define IDC_RECORD_FRAME_RATE 1058
#define IDC_SPIN1 1059
#define IDC_RECORD_FRAME_RATE2 1059
#define IDC_RECORD_SCALING 1059
#define IDC_SNIP_HOTKEY 1060
#define IDC_CAPTURE_AUDIO 1061
#define IDC_MICROPHONE 1062
#define IDC_PEN_CONTROL 1063
#define IDC_COLORS 1064
#define IDC_HIGHLIGHT_AND_BLUR 1065
#define IDC_SHAPES 1066
#define IDC_SCREEN 1067
#define IDC_DEMOTYPE_TEXT 1068
#define IDC_DEMOTYPE_BROWSE 1069
#define IDC_DEMOTYPE_FILE 1070
#define IDC_DEMOTYPE_SPEED_SLIDER 1071
#define IDC_DEMOTYPE_USER_DRIVEN 1072
#define IDC_DEMOTYPE_STATIC1 1073
#define IDC_DEMOTYPE_SLIDER2 1074
#define IDC_DEMOTYPE_STATIC2 1074
#define IDC_COPYRIGHT 1075
#define IDC_PEN_WIDTH 1105
#define IDC_TIMER 1106
#define IDC_SAVE 40002
#define IDC_COPY 40004
#define IDC_RECORD 40006
#define IDC_RECORD_HOTKEY 40007
#define IDC_COPY_CROP 40008
#define IDC_SAVE_CROP 40009
#define IDC_DEMOTYPE_HOTKEY 40011
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 118
#define _APS_NEXT_COMMAND_VALUE 40013
#define _APS_NEXT_CONTROL_VALUE 1076
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

Просмотреть файл

@ -0,0 +1,40 @@
#include <windows.h>
#include "resource.h"
#include "../../../common/version/version.h"
#define APSTUDIO_READONLY_SYMBOLS
#include "winres.h"
#undef APSTUDIO_READONLY_SYMBOLS
1 VERSIONINFO
FILEVERSION FILE_VERSION
PRODUCTVERSION PRODUCT_VERSION
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
#ifdef _DEBUG
FILEFLAGS VS_FF_DEBUG
#else
FILEFLAGS 0x0L
#endif
FILEOS VOS_NT_WINDOWS32
FILETYPE VFT_DLL
FILESUBTYPE VFT2_UNKNOWN
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0" // US English (0x0409), Unicode (0x04B0) charset
BEGIN
VALUE "CompanyName", COMPANY_NAME
VALUE "FileDescription", FILE_DESCRIPTION
VALUE "FileVersion", FILE_VERSION_STRING
VALUE "InternalName", INTERNAL_NAME
VALUE "LegalCopyright", COPYRIGHT_NOTE
VALUE "OriginalFilename", ORIGINAL_FILENAME
VALUE "ProductName", PRODUCT_NAME
VALUE "ProductVersion", PRODUCT_VERSION_STRING
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200 // US English (0x0409), Unicode (1200) charset
END
END

Просмотреть файл

@ -0,0 +1,113 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.props')" />
<PropertyGroup Label="Globals">
<VCProjectVersion>17.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{e4585179-2ac1-4d5f-a3ff-cfc5392f694c}</ProjectGuid>
<RootNamespace>ZoomItModuleInterface</RootNamespace>
<ProjectName>ZoomItModuleInterface</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets">
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<OutDir>..\..\..\..\$(Platform)\$(Configuration)\</OutDir>
<TargetName>PowerToys.ZoomItModuleInterface</TargetName>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>..\;$(SolutionDir)src\common\Telemetry;$(SolutionDir)src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
<ClCompile>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release'">
<ClCompile>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="pch.h" />
<ClInclude Include="resource.h" />
<ClInclude Include="trace.h" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="ZoomItModuleInterface.rc" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="dllmain.cpp" />
<ClCompile Include="pch.cpp">
<PrecompiledHeader Condition="'$(UsePrecompiledHeaders)' != 'false'">Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="trace.cpp" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\common\logger\logger.vcxproj">
<Project>{d9b8fc84-322a-4f9f-bbb9-20915c47ddfd}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\common\SettingsAPI\SettingsAPI.vcxproj">
<Project>{6955446d-23f7-4023-9bb3-8657f904af99}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.targets')" />
<Import Project="..\..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.231216.1\build\native\Microsoft.Windows.ImplementationLibrary.targets" Condition="Exists('..\..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.231216.1\build\native\Microsoft.Windows.ImplementationLibrary.targets')" />
</ImportGroup>
<Import Project="..\..\..\..\deps\spdlog.props" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.props'))" />
<Error Condition="!Exists('..\..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.231216.1\build\native\Microsoft.Windows.ImplementationLibrary.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.231216.1\build\native\Microsoft.Windows.ImplementationLibrary.targets'))" />
</Target>
</Project>

Просмотреть файл

@ -0,0 +1,47 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="resource.h">
<Filter>Resource Files</Filter>
</ClInclude>
<ClInclude Include="pch.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="trace.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="ZoomItModuleInterface.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
<ItemGroup>
<ClCompile Include="dllmain.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="pch.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="trace.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,233 @@
#include "pch.h"
#include <modules/interface/powertoy_module_interface.h>
#include <common/SettingsAPI/settings_objects.h>
#include "trace.h"
#include <common/logger/logger.h>
#include <common/utils/logger_helper.h>
#include <common/utils/resources.h>
#include <common/utils/winapi_error.h>
#include <shellapi.h>
#include <common/interop/shared_constants.h>
namespace NonLocalizable
{
const wchar_t ModulePath[] = L"PowerToys.ZoomIt.exe";
const inline wchar_t ModuleKey[] = L"ZoomIt";
}
BOOL APIENTRY DllMain( HMODULE /*hModule*/,
DWORD ul_reason_for_call,
LPVOID /*lpReserved*/
)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
Trace::RegisterProvider();
break;
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
break;
case DLL_PROCESS_DETACH:
Trace::UnregisterProvider();
break;
}
return TRUE;
}
class ZoomItModuleInterface : public PowertoyModuleIface
{
public:
// Return the localized display name of the powertoy
virtual PCWSTR get_name() override
{
return app_name.c_str();
}
// Return the non localized key of the powertoy, this will be cached by the runner
virtual const wchar_t* get_key() override
{
return app_key.c_str();
}
// Return the configured status for the gpo policy for the module
virtual powertoys_gpo::gpo_rule_configured_t gpo_policy_enabled_configuration() override
{
return powertoys_gpo::getConfiguredZoomItEnabledValue();
}
// Return JSON with the configuration options.
// These are the settings shown on the settings page along with their current values.
virtual bool get_config(wchar_t* buffer, int* buffer_size) override
{
HINSTANCE hinstance = reinterpret_cast<HINSTANCE>(&__ImageBase);
// TODO: Read settings from Registry.
// Create a Settings object.
PowerToysSettings::Settings settings(hinstance, get_name());
return settings.serialize_to_buffer(buffer, buffer_size);
}
// Passes JSON with the configuration settings for the powertoy.
// This is called when the user hits Save on the settings page.
virtual void set_config(const wchar_t*) override
{
try
{
// Parse the input JSON string.
// TODO: Save settings to registry.
}
catch (std::exception&)
{
// Improper JSON.
}
}
// Enable the powertoy
virtual void enable()
{
Logger::info("ZoomIt enabling");
Enable();
}
// Disable the powertoy
virtual void disable()
{
Logger::info("ZoomIt disabling");
Disable(true);
}
// Returns if the powertoy is enabled
virtual bool is_enabled() override
{
return m_enabled;
}
// Destroy the powertoy and free memory
virtual void destroy() override
{
Disable(false);
delete this;
}
ZoomItModuleInterface()
{
app_name = L"ZoomIt";
app_key = NonLocalizable::ModuleKey;
LoggerHelpers::init_logger(app_key, L"ModuleInterface", LogSettings::zoomItLoggerName);
m_reload_settings_event_handle = CreateDefaultEvent(CommonSharedConstants::ZOOMIT_REFRESH_SETTINGS_EVENT);
m_exit_event_handle = CreateDefaultEvent(CommonSharedConstants::ZOOMIT_EXIT_EVENT);
}
private:
bool is_enabled_by_default() const override
{
return false;
}
void Enable()
{
m_enabled = true;
// Log telemetry
Trace::EnableZoomIt(true);
// Pass the PID.
unsigned long powertoys_pid = GetCurrentProcessId();
std::wstring executable_args = L"";
executable_args.append(std::to_wstring(powertoys_pid));
ResetEvent(m_reload_settings_event_handle);
ResetEvent(m_exit_event_handle);
SHELLEXECUTEINFOW sei{ sizeof(sei) };
sei.fMask = { SEE_MASK_NOCLOSEPROCESS | SEE_MASK_FLAG_NO_UI };
sei.lpFile = NonLocalizable::ModulePath;
sei.nShow = SW_SHOWNORMAL;
sei.lpParameters = executable_args.data();
if (ShellExecuteExW(&sei) == false)
{
Logger::error(L"Failed to start zoomIt");
auto message = get_last_error_message(GetLastError());
if (message.has_value())
{
Logger::error(message.value());
}
}
else
{
m_hProcess = sei.hProcess;
}
}
void Disable(bool const traceEvent)
{
m_enabled = false;
// Log telemetry
if (traceEvent)
{
Trace::EnableZoomIt(false);
}
// Tell the ZoomIt process to exit.
SetEvent(m_exit_event_handle);
ResetEvent(m_reload_settings_event_handle);
// Wait for 1.5 seconds for the process to end correctly and stop etw tracer
WaitForSingleObject(m_hProcess, 1500);
// If process is still running, terminate it
if (m_hProcess)
{
TerminateProcess(m_hProcess, 0);
m_hProcess = nullptr;
}
}
bool is_process_running()
{
return WaitForSingleObject(m_hProcess, 0) == WAIT_TIMEOUT;
}
virtual void call_custom_action(const wchar_t* action) override
{
try
{
PowerToysSettings::CustomActionObject action_object =
PowerToysSettings::CustomActionObject::from_json_string(action);
if (action_object.get_name() == L"refresh_settings")
{
SetEvent(m_reload_settings_event_handle);
}
}
catch (std::exception&)
{
Logger::error(L"Failed to parse action. {}", action);
}
}
std::wstring app_name;
std::wstring app_key; //contains the non localized key of the powertoy
bool m_enabled = false;
HANDLE m_hProcess = nullptr;
HANDLE m_reload_settings_event_handle = NULL;
HANDLE m_exit_event_handle = NULL;
};
extern "C" __declspec(dllexport) PowertoyModuleIface* __cdecl powertoy_create()
{
return new ZoomItModuleInterface();
}

Просмотреть файл

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Windows.CppWinRT" version="2.0.240111.5" targetFramework="native" />
</packages>

Просмотреть файл

@ -0,0 +1,5 @@
// pch.cpp: source file corresponding to the pre-compiled header
#include "pch.h"
// When you are using pre-compiled headers, this source file is necessary for compilation to succeed.

Просмотреть файл

@ -0,0 +1,9 @@
#pragma once
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#include <windows.h>
#include <Unknwn.h>
#include <winrt/base.h>
#include <winrt/Windows.Foundation.h>
#include <winrt/Windows.Foundation.Collections.h>
#include <TraceLoggingActivity.h>

Просмотреть файл

@ -0,0 +1,13 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by ZoomItModuleInterface.rc
//////////////////////////////
// Non-localizable
#define FILE_DESCRIPTION "PowerToys ZoomItModuleInterface"
#define INTERNAL_NAME "PowerToys.ZoomItModuleInterface"
#define ORIGINAL_FILENAME "PowerToys.ZoomItModuleInterface.dll"
// Non-localizable
//////////////////////////////

Просмотреть файл

@ -0,0 +1,93 @@
#include "pch.h"
#include "trace.h"
#include <common/Telemetry/TraceBase.h>
TRACELOGGING_DEFINE_PROVIDER(
g_hProvider,
"Microsoft.PowerToys",
// {38e8889b-9731-53f5-e901-e8a7c1753074}
(0x38e8889b, 0x9731, 0x53f5, 0xe9, 0x01, 0xe8, 0xa7, 0xc1, 0x75, 0x30, 0x74),
TraceLoggingOptionProjectTelemetry());
// Log if the user has ZoomIt enabled or disabled
void Trace::EnableZoomIt(const bool enabled) noexcept
{
TraceLoggingWriteWrapper(
g_hProvider,
"ZoomIt_EnableZoomIt",
ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance),
TraceLoggingKeyword(PROJECT_KEYWORD_MEASURE),
TraceLoggingBoolean(enabled, "Enabled"));
}
void Trace::ZoomItStarted() noexcept
{
TraceLoggingWriteWrapper(
g_hProvider,
"ZoomIt_Started",
ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance),
TraceLoggingKeyword(PROJECT_KEYWORD_MEASURE));
}
void Trace::ZoomItActivateBreak() noexcept
{
TraceLoggingWriteWrapper(
g_hProvider,
"ZoomIt_ActivateBreak",
ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance),
TraceLoggingKeyword(PROJECT_KEYWORD_MEASURE));
}
void Trace::ZoomItActivateDraw() noexcept
{
TraceLoggingWriteWrapper(
g_hProvider,
"ZoomIt_ActivateDraw",
ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance),
TraceLoggingKeyword(PROJECT_KEYWORD_MEASURE));
}
void Trace::ZoomItActivateZoom() noexcept
{
TraceLoggingWriteWrapper(
g_hProvider,
"ZoomIt_ActivateZoom",
ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance),
TraceLoggingKeyword(PROJECT_KEYWORD_MEASURE));
}
void Trace::ZoomItActivateLiveZoom() noexcept
{
TraceLoggingWriteWrapper(
g_hProvider,
"ZoomIt_ActivateLiveZoom",
ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance),
TraceLoggingKeyword(PROJECT_KEYWORD_MEASURE));
}
void Trace::ZoomItActivateDemoType() noexcept
{
TraceLoggingWriteWrapper(
g_hProvider,
"ZoomIt_ActivateDemoType",
ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance),
TraceLoggingKeyword(PROJECT_KEYWORD_MEASURE));
}
void Trace::ZoomItActivateRecord() noexcept
{
TraceLoggingWriteWrapper(
g_hProvider,
"ZoomIt_ActivateRecord",
ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance),
TraceLoggingKeyword(PROJECT_KEYWORD_MEASURE));
}
void Trace::ZoomItActivateSnip() noexcept
{
TraceLoggingWriteWrapper(
g_hProvider,
"ZoomIt_ActivateSnip",
ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance),
TraceLoggingKeyword(PROJECT_KEYWORD_MEASURE));
}

Просмотреть файл

@ -0,0 +1,17 @@
#pragma once
#include <common/Telemetry/TraceBase.h>
class Trace : public telemetry::TraceBase
{
public:
// Log if the user has ZoomIt enabled or disabled
static void EnableZoomIt(const bool enabled) noexcept;
static void ZoomItStarted() noexcept;
static void ZoomItActivateBreak() noexcept;
static void ZoomItActivateDraw() noexcept;
static void ZoomItActivateZoom() noexcept;
static void ZoomItActivateLiveZoom() noexcept;
static void ZoomItActivateDemoType() noexcept;
static void ZoomItActivateRecord() noexcept;
static void ZoomItActivateSnip() noexcept;
};

Просмотреть файл

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros" />
<!--
To customize common C++/WinRT project properties:
* right-click the project node
* expand the Common Properties item
* select the C++/WinRT property page
For more advanced scenarios, and complete documentation, please see:
https://github.com/Microsoft/cppwinrt/tree/master/nuget
-->
<PropertyGroup />
<ItemDefinitionGroup />
</Project>

Просмотреть файл

@ -0,0 +1,274 @@
#include "pch.h"
#include "ZoomItSettings.h"
#include "ZoomItSettings.g.cpp"
#include "../ZoomIt/ZoomItSettings.h"
#include <common/SettingsAPI/settings_objects.h>
#include <common/utils/color.h>
#include <map>
#pragma comment(lib, "Crypt32.lib") // For the CryptStringToBinaryW and CryptBinaryToStringW functions
namespace winrt::PowerToys::ZoomItSettingsInterop::implementation
{
ClassRegistry reg(_T("Software\\Sysinternals\\") APPNAME);
const unsigned int SPECIAL_SEMANTICS_SHORTCUT = 1;
const unsigned int SPECIAL_SEMANTICS_COLOR = 2;
const unsigned int SPECIAL_SEMANTICS_LOG_FONT = 3;
std::vector<unsigned char> base64_decode(const std::wstring& base64_string)
{
DWORD binary_len = 0;
// Get the required buffer size for the binary data
if (!CryptStringToBinaryW(base64_string.c_str(), 0, CRYPT_STRING_BASE64, nullptr, &binary_len, nullptr, nullptr))
{
throw std::runtime_error("Error in CryptStringToBinaryW (getting size)");
}
std::vector<unsigned char> binary_data(binary_len);
// Decode the Base64 string into binary data
if (!CryptStringToBinaryW(base64_string.c_str(), 0, CRYPT_STRING_BASE64, binary_data.data(), &binary_len, nullptr, nullptr))
{
throw std::runtime_error("Error in CryptStringToBinaryW (decoding)");
}
return binary_data;
}
std::wstring base64_encode(const unsigned char* data, size_t length)
{
DWORD base64_len = 0;
// Get the required buffer size for Base64 string
if (!CryptBinaryToStringW(data, static_cast<DWORD>(length), CRYPT_STRING_BASE64 | CRYPT_STRING_NOCRLF, nullptr, &base64_len))
{
throw std::runtime_error("Error in CryptBinaryToStringW (getting size)");
}
std::wstring base64_string(base64_len, '\0');
// Encode the binary data to Base64
if (!CryptBinaryToStringW(data, static_cast<DWORD>(length), CRYPT_STRING_BASE64 | CRYPT_STRING_NOCRLF, &base64_string[0], &base64_len))
{
throw std::runtime_error("Error in CryptBinaryToStringW (encoding)");
}
// Resize the wstring to remove any trailing null character.
if (!base64_string.empty() && base64_string.back() == L'\0')
{
base64_string.pop_back();
}
return base64_string;
}
std::map<std::wstring, unsigned int> settings_with_special_semantics = {
{ L"ToggleKey", SPECIAL_SEMANTICS_SHORTCUT },
{ L"LiveZoomToggleKey", SPECIAL_SEMANTICS_SHORTCUT },
{ L"DrawToggleKey", SPECIAL_SEMANTICS_SHORTCUT },
{ L"RecordToggleKey", SPECIAL_SEMANTICS_SHORTCUT },
{ L"SnipToggleKey", SPECIAL_SEMANTICS_SHORTCUT },
{ L"BreakTimerKey", SPECIAL_SEMANTICS_SHORTCUT },
{ L"DemoTypeToggleKey", SPECIAL_SEMANTICS_SHORTCUT },
{ L"PenColor", SPECIAL_SEMANTICS_COLOR },
{ L"BreakPenColor", SPECIAL_SEMANTICS_COLOR },
{ L"Font", SPECIAL_SEMANTICS_LOG_FONT },
};
hstring ZoomItSettings::LoadSettingsJson()
{
PowerToysSettings::PowerToyValues _settings(L"ZoomIt",L"ZoomIt");
reg.ReadRegSettings(RegSettings);
PREG_SETTING curSetting = RegSettings;
while (curSetting->ValueName)
{
switch (curSetting->Type)
{
case SETTING_TYPE_DWORD:
{
auto special_semantics = settings_with_special_semantics.find(curSetting->ValueName);
DWORD value = *static_cast<PDWORD>(curSetting->Setting);
if (special_semantics == settings_with_special_semantics.end())
{
_settings.add_property<DWORD>(curSetting->ValueName, value);
}
else
{
if (special_semantics->second == SPECIAL_SEMANTICS_SHORTCUT)
{
auto hotkey = PowerToysSettings::HotkeyObject::from_settings(
value & (HOTKEYF_EXT << 8), //WIN
value & (HOTKEYF_CONTROL << 8),
value & (HOTKEYF_ALT << 8),
value & (HOTKEYF_SHIFT << 8),
value & 0xFF);
_settings.add_property(curSetting->ValueName, hotkey.get_json());
}
else if (special_semantics->second == SPECIAL_SEMANTICS_COLOR)
{
// PowerToys settings likes colors as #FFFFFF strings.
hstring s = winrt::to_hstring(std::format("#{:02x}{:02x}{:02x}", value & 0xFF, (value >> 8) & 0xFF, (value >> 16) & 0xFF));
_settings.add_property(curSetting->ValueName, s);
}
}
break;
}
case SETTING_TYPE_BOOLEAN:
_settings.add_property<bool>(curSetting->ValueName, *static_cast<PBOOLEAN>(curSetting->Setting));
break;
case SETTING_TYPE_DOUBLE:
assert(false); // ZoomIt doesn't use this type of setting.
break;
case SETTING_TYPE_WORD:
assert(false); // ZoomIt doesn't use this type of setting.
break;
case SETTING_TYPE_STRING:
_settings.add_property<std::wstring>(curSetting->ValueName, static_cast<PTCHAR>(curSetting->Setting));
break;
case SETTING_TYPE_DWORD_ARRAY:
assert(false); // ZoomIt doesn't use this type of setting.
break;
case SETTING_TYPE_WORD_ARRAY:
assert(false); // ZoomIt doesn't use this type of setting.
break;
case SETTING_TYPE_BINARY:
auto special_semantics = settings_with_special_semantics.find(curSetting->ValueName);
if (special_semantics != settings_with_special_semantics.end() && special_semantics->second == SPECIAL_SEMANTICS_LOG_FONT)
{
// This is the font setting. It's a special case where the default value needs to be calculated if it's still 0.
if (g_LogFont.lfFaceName[0] == L'\0')
{
GetObject(GetStockObject(DEFAULT_GUI_FONT), sizeof g_LogFont, &g_LogFont);
g_LogFont.lfWeight = FW_NORMAL;
auto hDc = CreateCompatibleDC(NULL);
g_LogFont.lfHeight = -MulDiv(8, GetDeviceCaps(hDc, LOGPIXELSY), 72);
DeleteDC(hDc);
}
}
// Base64 encoding is likely the best way to serialize a byte array into JSON.
auto encodedFont = base64_encode(static_cast<PBYTE>(curSetting->Setting), curSetting->Size);
_settings.add_property<std::wstring>(curSetting->ValueName, encodedFont);
break;
}
curSetting++;
}
return _settings.get_raw_json().Stringify();
}
void ZoomItSettings::SaveSettingsJson(hstring json)
{
reg.ReadRegSettings(RegSettings);
// Parse the input JSON string.
PowerToysSettings::PowerToyValues valuesFromSettings =
PowerToysSettings::PowerToyValues::from_json_string(json, L"ZoomIt");
PREG_SETTING curSetting = RegSettings;
while (curSetting->ValueName)
{
switch (curSetting->Type)
{
case SETTING_TYPE_DWORD:
{
auto special_semantics = settings_with_special_semantics.find(curSetting->ValueName);
if (special_semantics == settings_with_special_semantics.end())
{
auto possibleValue = valuesFromSettings.get_uint_value(curSetting->ValueName);
if (possibleValue.has_value())
{
*static_cast<PDWORD>(curSetting->Setting) = possibleValue.value();
}
}
else
{
if (special_semantics->second == SPECIAL_SEMANTICS_SHORTCUT)
{
auto possibleValue = valuesFromSettings.get_json(curSetting->ValueName);
if (possibleValue.has_value())
{
auto hotkey = PowerToysSettings::HotkeyObject::from_json(possibleValue.value());
unsigned int value = 0;
value |= hotkey.get_code();
if (hotkey.ctrl_pressed())
{
value |= (HOTKEYF_CONTROL << 8);
}
if (hotkey.alt_pressed())
{
value |= (HOTKEYF_ALT << 8);
}
if (hotkey.shift_pressed())
{
value |= (HOTKEYF_SHIFT << 8);
}
if (hotkey.win_pressed())
{
value |= (HOTKEYF_EXT << 8);
}
*static_cast<PDWORD>(curSetting->Setting) = value;
}
}
else if (special_semantics->second == SPECIAL_SEMANTICS_COLOR)
{
auto possibleValue = valuesFromSettings.get_string_value(curSetting->ValueName);
if (possibleValue.has_value())
{
uint8_t r, g, b;
if (checkValidRGB(possibleValue.value(), &r, &g, &b))
{
*static_cast<PDWORD>(curSetting->Setting) = RGB(r, g, b);
}
}
}
}
break;
}
case SETTING_TYPE_BOOLEAN:
{
auto possibleValue = valuesFromSettings.get_bool_value(curSetting->ValueName);
if (possibleValue.has_value())
{
*static_cast<PBOOLEAN>(curSetting->Setting) = static_cast<BOOLEAN>(possibleValue.value());
}
break;
}
case SETTING_TYPE_DOUBLE:
assert(false); // ZoomIt doesn't use this type of setting.
break;
case SETTING_TYPE_WORD:
assert(false); // ZoomIt doesn't use this type of setting.
break;
case SETTING_TYPE_STRING:
{
auto possibleValue = valuesFromSettings.get_string_value(curSetting->ValueName);
if (possibleValue.has_value())
{
const TCHAR* value = possibleValue.value().c_str();
_tcscpy_s(static_cast<PTCHAR>(curSetting->Setting), curSetting->Size / sizeof(TCHAR), value);
}
break;
}
case SETTING_TYPE_DWORD_ARRAY:
assert(false); // ZoomIt doesn't use this type of setting.
break;
case SETTING_TYPE_WORD_ARRAY:
assert(false); // ZoomIt doesn't use this type of setting.
break;
case SETTING_TYPE_BINARY:
auto possibleValue = valuesFromSettings.get_string_value(curSetting->ValueName);
if (possibleValue.has_value())
{
// Base64 encoding is likely the best way to serialize a byte array into JSON.
auto decodedValue = base64_decode(possibleValue.value());
assert(curSetting->Size == decodedValue.size()); // Should right now only be used for LOGFONT, so let's hard check it to avoid any insecure overflows.
memcpy(static_cast<PBYTE>(curSetting->Setting), decodedValue.data(), decodedValue.size());
}
break;
}
curSetting++;
}
reg.WriteRegSettings(RegSettings);
}
}

Просмотреть файл

@ -0,0 +1,20 @@
#pragma once
#include "ZoomItSettings.g.h"
namespace winrt::PowerToys::ZoomItSettingsInterop::implementation
{
struct ZoomItSettings : ZoomItSettingsT<ZoomItSettings>
{
ZoomItSettings() = default;
static hstring LoadSettingsJson();
static void SaveSettingsJson(hstring json);
};
}
namespace winrt::PowerToys::ZoomItSettingsInterop::factory_implementation
{
struct ZoomItSettings : ZoomItSettingsT<ZoomItSettings, implementation::ZoomItSettings>
{
};
}

Просмотреть файл

@ -0,0 +1,10 @@
namespace PowerToys
{
namespace ZoomItSettingsInterop
{
[default_interface] static runtimeclass ZoomItSettings {
static String LoadSettingsJson();
static void SaveSettingsJson(String json);
}
}
}

Просмотреть файл

@ -0,0 +1,3 @@
EXPORTS
DllCanUnloadNow = WINRT_CanUnloadNow PRIVATE
DllGetActivationFactory = WINRT_GetActivationFactory PRIVATE

Просмотреть файл

@ -0,0 +1,40 @@
#include <windows.h>
#include "resource.h"
#include "../../../common/version/version.h"
#define APSTUDIO_READONLY_SYMBOLS
#include "winres.h"
#undef APSTUDIO_READONLY_SYMBOLS
1 VERSIONINFO
FILEVERSION FILE_VERSION
PRODUCTVERSION PRODUCT_VERSION
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
#ifdef _DEBUG
FILEFLAGS VS_FF_DEBUG
#else
FILEFLAGS 0x0L
#endif
FILEOS VOS_NT_WINDOWS32
FILETYPE VFT_DLL
FILESUBTYPE VFT2_UNKNOWN
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0" // US English (0x0409), Unicode (0x04B0) charset
BEGIN
VALUE "CompanyName", COMPANY_NAME
VALUE "FileDescription", FILE_DESCRIPTION
VALUE "FileVersion", FILE_VERSION_STRING
VALUE "InternalName", INTERNAL_NAME
VALUE "LegalCopyright", COPYRIGHT_NOTE
VALUE "OriginalFilename", ORIGINAL_FILENAME
VALUE "ProductName", PRODUCT_NAME
VALUE "ProductVersion", PRODUCT_VERSION_STRING
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200 // US English (0x0409), Unicode (1200) charset
END
END

Просмотреть файл

@ -0,0 +1,132 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.props')" />
<PropertyGroup Label="Globals">
<CppWinRTOptimized>true</CppWinRTOptimized>
<CppWinRTRootNamespaceAutoMerge>true</CppWinRTRootNamespaceAutoMerge>
<CppWinRTGenerateWindowsMetadata>true</CppWinRTGenerateWindowsMetadata>
<MinimalCoreWin>true</MinimalCoreWin>
<ProjectGuid>{ca7d8106-30B9-4aec-9d05-b69b31b8c461}</ProjectGuid>
<ProjectName>ZoomItSettingsInterop</ProjectName>
<RootNamespace>PowerToys.ZoomItSettingsInterop</RootNamespace>
<DefaultLanguage>en-US</DefaultLanguage>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
<AppContainerApplication>false</AppContainerApplication>
<AppxPackage>false</AppxPackage>
<ApplicationType>Windows Store</ApplicationType>
<ApplicationTypeRevision>10.0</ApplicationTypeRevision>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<GenerateManifest>false</GenerateManifest>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration">
<UseDebugLibraries>true</UseDebugLibraries>
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release'" Label="Configuration">
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets">
<Import Project="PropertySheet.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<TargetName>PowerToys.ZoomItSettingsInterop</TargetName>
<OutDir>..\..\..\..\$(Platform)\$(Configuration)\</OutDir>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
<WarningLevel>Level4</WarningLevel>
<AdditionalOptions>%(AdditionalOptions) /bigobj</AdditionalOptions>
<PreprocessorDefinitions>_WINRT_DLL;WINRT_LEAN_AND_MEAN;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>../../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>$(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
<ModuleDefinitionFile>ZoomItSettingsInterop.def</ModuleDefinitionFile>
<AdditionalDependencies>Shell32.lib;gdi32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
<ClCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release'">
<ClCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="pch.h" />
<ClInclude Include="ZoomItSettings.h">
<DependentUpon>ZoomItSettings.idl</DependentUpon>
</ClInclude>
<ClInclude Include="resource.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="pch.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="ZoomItSettings.cpp">
<DependentUpon>ZoomItSettings.idl</DependentUpon>
</ClCompile>
<ClCompile Include="$(GeneratedFilesDir)module.g.cpp" />
</ItemGroup>
<ItemGroup>
<Midl Include="ZoomItSettings.idl" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<None Include="ZoomItSettingsInterop.def" />
</ItemGroup>
<ItemGroup>
<None Include="PropertySheet.props" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\common\logger\logger.vcxproj">
<Project>{d9b8fc84-322a-4f9f-bbb9-20915c47ddfd}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\common\SettingsAPI\SettingsAPI.vcxproj">
<Project>{6955446d-23f7-4023-9bb3-8657f904af99}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="ZoomItSettingsInterop.rc" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<Import Project="..\..\..\..\deps\spdlog.props" />
<ImportGroup Label="ExtensionTargets">
<Import Project="..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.targets')" />
<Import Project="..\..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.231216.1\build\native\Microsoft.Windows.ImplementationLibrary.targets" Condition="Exists('..\..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.231216.1\build\native\Microsoft.Windows.ImplementationLibrary.targets')" />
</ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.props'))" />
<Error Condition="!Exists('..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.targets'))" />
<Error Condition="!Exists('..\..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.231216.1\build\native\Microsoft.Windows.ImplementationLibrary.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.231216.1\build\native\Microsoft.Windows.ImplementationLibrary.targets'))" />
</Target>
</Project>

Просмотреть файл

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Resources">
<UniqueIdentifier>{de682ddf-17ab-471d-9761-82b42e6baa70}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tga;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
<Filter Include="Generated Files">
<UniqueIdentifier>{c02d42a3-682e-499a-8b28-638a0802d43f}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="pch.cpp" />
<ClCompile Include="$(GeneratedFilesDir)module.g.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="pch.h" />
<ClInclude Include="resource.h" />
</ItemGroup>
<ItemGroup>
<Midl Include="ZoomItSettings.idl" />
</ItemGroup>
<ItemGroup>
<None Include="ZoomItSettingsInterop.def" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<None Include="PropertySheet.props" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="ZoomItSettingsInterop.rc">
<Filter>Resources</Filter>
</ResourceCompile>
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Windows.CppWinRT" version="2.0.240111.5" targetFramework="native" />
<package id="Microsoft.Windows.ImplementationLibrary" version="1.0.231216.1" targetFramework="native" />
</packages>

Просмотреть файл

@ -0,0 +1 @@
#include "pch.h"

Просмотреть файл

@ -0,0 +1,22 @@
#pragma once
#include <windows.h>
#include <commctrl.h>
#include <tchar.h>
#include <magnification.h>
#include <shellapi.h>
#define GDIPVER 0x0110
#include <gdiplus.h>
// DirectX
#include <d3d11_4.h>
#include <dxgi1_6.h>
#include <d2d1_3.h>
// Must come before C++/WinRT
#include <wil/cppwinrt.h>
#include <unknwn.h>
#include <winrt/Windows.Foundation.h>
#include <winrt/Windows.Foundation.Collections.h>

Просмотреть файл

@ -0,0 +1,13 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by ZoomItSettingsInterop.rc
//////////////////////////////
// Non-localizable
#define FILE_DESCRIPTION "PowerToys ZoomItSettingsInterop"
#define INTERNAL_NAME "PowerToys.ZoomItSettingsInterop"
#define ORIGINAL_FILENAME "PowerToys.ZoomItSettingsInterop.dll"
// Non-localizable
//////////////////////////////

Просмотреть файл

@ -173,6 +173,7 @@ int runner(bool isProcessElevated, bool openSettings, std::string settingsWindow
L"PowerToys.CropAndLockModuleInterface.dll",
L"PowerToys.CmdNotFoundModuleInterface.dll",
L"PowerToys.WorkspacesModuleInterface.dll",
L"PowerToys.ZoomItModuleInterface.dll",
};
for (auto moduleSubdir : knownModules)

Просмотреть файл

@ -694,6 +694,8 @@ std::string ESettingsWindowNames_to_string(ESettingsWindowNames value)
return "AdvancedPaste";
case ESettingsWindowNames::NewPlus:
return "NewPlus";
case ESettingsWindowNames::ZoomIt:
return "ZoomIt";
default:
{
Logger::error(L"Can't convert ESettingsWindowNames value={} to string", static_cast<int>(value));
@ -789,6 +791,10 @@ ESettingsWindowNames ESettingsWindowNames_from_string(std::string value)
{
return ESettingsWindowNames::NewPlus;
}
else if (value == "ZoomIt")
{
return ESettingsWindowNames::ZoomIt;
}
else
{
Logger::error(L"Can't convert string value={} to ESettingsWindowNames", winrt::to_hstring(value));

Просмотреть файл

@ -25,6 +25,7 @@ enum class ESettingsWindowNames
EnvironmentVariables,
AdvancedPaste,
NewPlus,
ZoomIt,
};
std::string ESettingsWindowNames_to_string(ESettingsWindowNames value);

Просмотреть файл

@ -480,6 +480,23 @@ namespace Microsoft.PowerToys.Settings.UI.Library
}
}
private bool zoomIt;
[JsonPropertyName("ZoomIt")]
public bool ZoomIt
{
get => zoomIt;
set
{
if (zoomIt != value)
{
LogTelemetryEvent(value);
zoomIt = value;
NotifyChange();
}
}
}
private void NotifyChange()
{
notifyEnabledChangedAction?.Invoke();

Просмотреть файл

@ -19,6 +19,7 @@
<ItemGroup>
<ProjectReference Include="..\..\common\interop\PowerToys.Interop.vcxproj" />
<ProjectReference Include="..\..\modules\ZoomIt\ZoomItSettingsInterop\ZoomItSettingsInterop.vcxproj" />
<ProjectReference Include="..\..\common\ManagedCommon\ManagedCommon.csproj" />
<ProjectReference Include="..\..\common\ManagedTelemetry\Telemetry\ManagedTelemetry.csproj" />
<ProjectReference Include="..\..\modules\MouseUtils\MouseJump.Common\MouseJump.Common.csproj" />

Просмотреть файл

@ -0,0 +1,107 @@
// 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.Text.Json.Serialization;
using Settings.UI.Library.Attributes;
namespace Microsoft.PowerToys.Settings.UI.Library
{
public class ZoomItProperties
{
public ZoomItProperties()
{
}
[CmdConfigureIgnore]
public static HotkeySettings DefaultToggleKey => new HotkeySettings(false, true, false, false, '1'); // Ctrl+1
[CmdConfigureIgnore]
public static HotkeySettings DefaultLiveZoomToggleKey => new HotkeySettings(false, true, false, false, '4'); // Ctrl+4
[CmdConfigureIgnore]
public static HotkeySettings DefaultDrawToggleKey => new HotkeySettings(false, true, false, false, '2'); // Ctrl+2
[CmdConfigureIgnore]
public static HotkeySettings DefaultRecordToggleKey => new HotkeySettings(false, true, false, false, '5'); // Ctrl+5
[CmdConfigureIgnore]
public static HotkeySettings DefaultSnipToggleKey => new HotkeySettings(false, true, false, false, '6'); // Ctrl+6
[CmdConfigureIgnore]
public static HotkeySettings DefaultBreakTimerKey => new HotkeySettings(false, true, false, false, '3'); // Ctrl+3
[CmdConfigureIgnore]
public static HotkeySettings DefaultDemoTypeToggleKey => new HotkeySettings(false, true, false, false, '7'); // Ctrl+7
public KeyboardKeysProperty ToggleKey { get; set; }
public KeyboardKeysProperty LiveZoomToggleKey { get; set; }
public KeyboardKeysProperty DrawToggleKey { get; set; }
public KeyboardKeysProperty RecordToggleKey { get; set; }
public KeyboardKeysProperty SnipToggleKey { get; set; }
public StringProperty PenColor { get; set; }
public IntProperty PenWidth { get; set; }
public StringProperty BreakPenColor { get; set; }
public KeyboardKeysProperty BreakTimerKey { get; set; }
public StringProperty Font { get; set; }
public KeyboardKeysProperty DemoTypeToggleKey { get; set; }
public StringProperty DemoTypeFile { get; set; }
public IntProperty DemoTypeSpeedSlider { get; set; }
public BoolProperty DemoTypeUserDrivenMode { get; set; }
public IntProperty BreakTimeout { get; set; }
public IntProperty BreakOpacity { get; set; }
public BoolProperty BreakPlaySoundFile { get; set; }
public StringProperty BreakSoundFile { get; set; }
public BoolProperty BreakShowBackgroundFile { get; set; }
public BoolProperty BreakBackgroundStretch { get; set; }
public StringProperty BreakBackgroundFile { get; set; }
public IntProperty BreakTimerPosition { get; set; }
public BoolProperty BreakShowDesktop { get; set; }
public BoolProperty BreakOnSecondary { get; set; }
public IntProperty FontScale { get; set; }
public BoolProperty ShowExpiredTime { get; set; }
public BoolProperty ShowTrayIcon { get; set; }
public BoolProperty AnimnateZoom { get; set; }
public BoolProperty TelescopeZoomOut { get; set; }
public BoolProperty SnapToGrid { get; set; }
public IntProperty ZoominSliderLevel { get; set; }
public IntProperty RecordFrameRate { get; set; }
public IntProperty RecordScaling { get; set; }
public BoolProperty CaptureAudio { get; set; }
public StringProperty MicrophoneDeviceId { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,35 @@
// 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.Text.Json.Serialization;
using Microsoft.PowerToys.Settings.UI.Library.Interfaces;
namespace Microsoft.PowerToys.Settings.UI.Library
{
public class ZoomItSettings : BasePTModuleSettings, ISettingsConfig
{
public const string ModuleName = "ZoomIt";
[JsonPropertyName("properties")]
public ZoomItProperties Properties { get; set; }
public ZoomItSettings()
{
Name = ModuleName;
Properties = new ZoomItProperties();
Version = "1.0";
}
public string GetModuleName()
{
return Name;
}
// This can be utilized in the future if the settings.json file is to be modified/deleted.
public bool UpgradeSettingsConfiguration()
{
return false;
}
}
}

Двоичные данные
src/settings-ui/Settings.UI/Assets/Settings/Icons/ZoomIt.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.8 KiB

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше