├── .gitignore ├── LICENSE ├── README-zh.md ├── README.md └── src └── WPFDevelopers.Minimal ├── Directory.Build.props ├── Microsoft.Windows.Shell ├── JumpItem.cs ├── JumpItemRejectionReason.cs ├── JumpItemsRejectedEventArgs.cs ├── JumpItemsRemovedEventArgs.cs ├── JumpList.cs ├── JumpPath.cs ├── JumpTask.cs ├── Microsoft.Windows.Shell.projitems ├── Microsoft.Windows.Shell.shproj ├── Standard │ ├── AC.cs │ ├── APPDOCLISTTYPE.cs │ ├── Assert.cs │ ├── BI.cs │ ├── BITMAPINFO.cs │ ├── BITMAPINFOHEADER.cs │ ├── BLENDFUNCTION.cs │ ├── CHANGEFILTERSTRUCT.cs │ ├── CLSID.cs │ ├── CREATESTRUCT.cs │ ├── CS.cs │ ├── CombineRgnResult.cs │ ├── DOGIF.cs │ ├── DWMFLIP3D.cs │ ├── DWMNCRP.cs │ ├── DWMWA.cs │ ├── DWM_SIT.cs │ ├── DWM_TIMING_INFO.cs │ ├── DeviceCap.cs │ ├── DoubleUtilities.cs │ ├── DpiHelper.cs │ ├── ErrorModes.cs │ ├── FO.cs │ ├── FOF.cs │ ├── Facility.cs │ ├── GCLP.cs │ ├── GPS.cs │ ├── GWL.cs │ ├── HCF.cs │ ├── HIGHCONTRAST.cs │ ├── HRESULT.cs │ ├── HT.cs │ ├── IApplicationDestinations.cs │ ├── IApplicationDocumentLists.cs │ ├── ICustomDestinationList.cs │ ├── IEnumIDList.cs │ ├── IEnumObjects.cs │ ├── IID.cs │ ├── INPUT.cs │ ├── INPUT_TYPE.cs │ ├── IObjectArray.cs │ ├── IObjectCollection.cs │ ├── IObjectWithAppUserModelId.cs │ ├── IObjectWithProgId.cs │ ├── IPropertyStore.cs │ ├── IShellFolder.cs │ ├── IShellItem.cs │ ├── IShellItem2.cs │ ├── IShellItemArray.cs │ ├── IShellLinkW.cs │ ├── ITaskbarList.cs │ ├── ITaskbarList2.cs │ ├── ITaskbarList3.cs │ ├── ITaskbarList4.cs │ ├── KDC.cs │ ├── LOGFONT.cs │ ├── MARGINS.cs │ ├── MF.cs │ ├── MINMAXINFO.cs │ ├── MONITORINFO.cs │ ├── MOUSEEVENTF.cs │ ├── MOUSEINPUT.cs │ ├── MSGFLT.cs │ ├── MSGFLTINFO.cs │ ├── ManagedIStream.cs │ ├── MessageHandler.cs │ ├── MessageWindow.cs │ ├── NIF.cs │ ├── NIIF.cs │ ├── NIM.cs │ ├── NONCLIENTMETRICS.cs │ ├── NOTIFYICONDATA.cs │ ├── NativeMethods.cs │ ├── OLECMDEXECOPT.cs │ ├── OLECMDF.cs │ ├── OLECMDID.cs │ ├── PKEY.cs │ ├── POINT.cs │ ├── PROPVARIANT.cs │ ├── READYSTATE.cs │ ├── RECT.cs │ ├── RGBQUAD.cs │ ├── RGN.cs │ ├── RefPOINT.cs │ ├── RefRECT.cs │ ├── SC.cs │ ├── SFGAO.cs │ ├── SHARD.cs │ ├── SHARDAPPIDINFO.cs │ ├── SHARDAPPIDINFOIDLIST.cs │ ├── SHARDAPPIDINFOLINK.cs │ ├── SHCONTF.cs │ ├── SHFILEOPSTRUCT.cs │ ├── SHGDN.cs │ ├── SIATTRIBFLAGS.cs │ ├── SICHINT.cs │ ├── SIGDN.cs │ ├── SIZE.cs │ ├── SLGP.cs │ ├── SM.cs │ ├── SPI.cs │ ├── SPIF.cs │ ├── STATE_SYSTEM.cs │ ├── STPF.cs │ ├── STR_GPS.cs │ ├── SW.cs │ ├── SWP.cs │ ├── SafeConnectionPointCookie.cs │ ├── SafeDC.cs │ ├── SafeFindHandle.cs │ ├── SafeGdiplusStartupToken.cs │ ├── SafeHBITMAP.cs │ ├── StartupInput.cs │ ├── StartupOutput.cs │ ├── Status.cs │ ├── StockObject.cs │ ├── TBPF.cs │ ├── THB.cs │ ├── THBF.cs │ ├── THUMBBUTTON.cs │ ├── TITLEBARINFO.cs │ ├── TITLEBARINFOEX.cs │ ├── ULW.cs │ ├── UNSIGNED_RATIO.cs │ ├── Utility.cs │ ├── Verify.cs │ ├── WIN32_FIND_DATAW.cs │ ├── WINDOWPLACEMENT.cs │ ├── WINDOWPOS.cs │ ├── WINDOWTHEMEATTRIBUTETYPE.cs │ ├── WM.cs │ ├── WNDCLASSEX.cs │ ├── WS.cs │ ├── WS_EX.cs │ ├── WTA_OPTIONS.cs │ ├── WTNCA.cs │ ├── WVR.cs │ ├── Win32Error.cs │ ├── Win32Value.cs │ ├── WndProc.cs │ └── WndProcHook.cs ├── SystemCommands.cs ├── SystemParameters2.cs ├── TaskbarItemInfo.cs ├── TaskbarItemProgressState.cs ├── ThumbButtonInfo.cs ├── ThumbButtonInfoCollection.cs ├── WindowChrome.cs └── WindowChromeWorker.cs ├── WPFDevelopers.Minimal.Net40 ├── Effects │ └── GrayscaleEffect.ps ├── Properties │ └── AssemblyInfo.cs ├── Themes │ ├── Generic.xaml │ └── Theme.xaml ├── WPFDevelopers.Minimal.Net40.csproj ├── WPFDevelopers.Minimal.Net40.csproj.user └── Window.cs ├── WPFDevelopers.Minimal.Net45x ├── Effects │ └── GrayscaleEffect.ps ├── Properties │ └── AssemblyInfo.cs ├── Themes │ ├── Generic.xaml │ └── Theme.xaml ├── WPFDevelopers.Minimal.Net45x.csproj ├── WPFDevelopers.Minimal.Net45x.csproj.user └── Window.cs ├── WPFDevelopers.Minimal.Sample.Net40 ├── Resources │ └── WPFDevelopers.Minimal.ico ├── WPFDevelopers.Minimal.Sample.Net40.csproj ├── WPFDevelopers.Minimal.Sample.Net40.csproj.user └── WPFDevelopers.Minimal.ico ├── WPFDevelopers.Minimal.Sample.Net45x ├── Resources │ └── WPFDevelopers.Minimal.ico ├── WPFDevelopers.Minimal.Sample.Net45x.csproj ├── WPFDevelopers.Minimal.Sample.Net45x.csproj.user └── WPFDevelopers.Minimal.ico ├── WPFDevelopers.Minimal.Sample.Shared ├── App.xaml ├── App.xaml.cs ├── Converts │ └── StateConvert.cs ├── ExampleViews │ ├── AboutWindow.xaml │ ├── AboutWindow.xaml.cs │ ├── MainView.xaml │ ├── MainView.xaml.cs │ ├── VirtualizingWrapPanelExample.xaml │ └── VirtualizingWrapPanelExample.xaml.cs ├── Light.AmericanRose.xaml ├── Light.Carmine.xaml ├── Models │ ├── HospitalList.cs │ ├── UserModel.cs │ └── ViewModelBase.cs ├── WPFDevelopers.Minimal.Sample.Shared.projitems ├── WPFDevelopers.Minimal.Sample.Shared.shproj ├── WPFDevelopers.Minimal.Sample.Shared.shproj.user └── WPFDevelopers.Minimal.ico ├── WPFDevelopers.Minimal.Shared ├── Controls │ ├── Loading │ │ ├── Loading.cs │ │ └── WPFLoading.cs │ ├── MessageBox │ │ ├── MessageBox.cs │ │ └── WPFMessageBox.cs │ ├── NotifyIcon │ │ ├── NotifyIcon.cs │ │ └── Runtimes │ │ │ ├── Gdi32Interop.cs │ │ │ ├── Interop │ │ │ ├── BITMAPINFO.cs │ │ │ ├── BitmapHandle.cs │ │ │ ├── CommonHandles.cs │ │ │ ├── HandleCollector.cs │ │ │ ├── IconHandle.cs │ │ │ └── WpfSafeHandle.cs │ │ │ ├── Kernel32Interop.cs │ │ │ ├── Shell32 │ │ │ ├── NIFFlags.cs │ │ │ ├── NIIFFlags.cs │ │ │ ├── NISFlags.cs │ │ │ ├── NOTIFYICONDATA.cs │ │ │ ├── NotifyCommand.cs │ │ │ └── NotifyFlags.cs │ │ │ ├── Shell32Interop.cs │ │ │ ├── User32 │ │ │ ├── CS.cs │ │ │ ├── ImageType.cs │ │ │ ├── LoadImageFlags.cs │ │ │ ├── WM.cs │ │ │ ├── WNDCLASSEX.cs │ │ │ ├── WS.cs │ │ │ ├── WS_EX.cs │ │ │ └── WndProc.cs │ │ │ └── User32Interop.cs │ ├── Panel │ │ └── SmallPanel.cs │ ├── ThemeControl │ │ ├── ThemeControl.cs │ │ └── ThemeModel.cs │ └── VirtualizingWrapPanel │ │ └── VirtualizingWrapPanel.cs ├── Converts │ ├── DatePickerToCurrentConverter.cs │ ├── ElementConvert.cs │ └── ObjectNullToVisibilityConverter.cs ├── Effects │ └── GrayscaleEffect.cs ├── Helpers │ ├── ControlHelper.cs │ ├── DatePickerHelper.cs │ ├── ElementHelper.cs │ ├── MaskAdorner.cs │ ├── PasswordBoxHelper.cs │ ├── TextBoxHelper.cs │ ├── ThemeType.cs │ └── ViewModelBase.cs ├── Resources.cs ├── Styles │ ├── Styles.Buttons.xaml │ ├── Styles.CheckBox.xaml │ ├── Styles.ComboBox.xaml │ ├── Styles.ContextMenu.xaml │ ├── Styles.DataGrid.xaml │ ├── Styles.DatePicker.xaml │ ├── Styles.Expander.xaml │ ├── Styles.GridSplitter.xaml │ ├── Styles.GroupBox.xaml │ ├── Styles.Hyperlink.xaml │ ├── Styles.Label.xaml │ ├── Styles.ListBox.xaml │ ├── Styles.ListView.xaml │ ├── Styles.Loading.xaml │ ├── Styles.Menu.xaml │ ├── Styles.MessageBox.xaml │ ├── Styles.PasswordBox.xaml │ ├── Styles.ProgressBar.xaml │ ├── Styles.RadioButton.xaml │ ├── Styles.RepeatButton.xaml │ ├── Styles.ScrollBar.xaml │ ├── Styles.Slider.xaml │ ├── Styles.TabControl.xaml │ ├── Styles.TextBox.xaml │ ├── Styles.ThemeControl.xaml │ ├── Styles.ToggleButton.xaml │ └── Styles.TreeView.xaml ├── Themes │ ├── Basic │ │ ├── Animations.xaml │ │ ├── Colors.xaml │ │ ├── ControlBasic.xaml │ │ ├── Dark.Color.xaml │ │ ├── Font.xaml │ │ ├── Geometrys.xaml │ │ └── Light.Color.xaml │ ├── Dark.Blue.xaml │ ├── Light.Blue.xaml │ ├── Light.Green.xaml │ ├── Light.Orange.xaml │ ├── Light.Pink.xaml │ ├── Light.Purple.xaml │ ├── Light.Red.xaml │ ├── Theme40.txt │ ├── Theme45x.txt │ └── XamlCombine.exe ├── WPFDevelopers.Minimal.Shared.projitems ├── WPFDevelopers.Minimal.Shared.shproj └── WPFDevelopers.Minimal.Shared.shproj.user └── WPFDevelopers.Minimal.sln /.gitignore: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 此 .gitignore 文件已由 Microsoft(R) Visual Studio 自动创建。 3 | ################################################################################ 4 | /src/OutPut 5 | /src/WPFDevelopers.Minimal/.vs 6 | /src/WPFDevelopers.Minimal/Wpf45 7 | /src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Net45x/bin 8 | /src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Sample.Net40/bin 9 | /src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Net40/bin 10 | /src/WPFDevelopers.Minimal/packages 11 | 12 | 13 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 WPFDevelopersOrg 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | $(MSBuildThisFileDirectory).vs\$(SolutionName)\Intermediate\$(MSBuildProjectName)\ 4 | $(MSBuildThisFileDirectory)..\OutPut\ 5 | True 6 | 7 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/JumpItem.cs: -------------------------------------------------------------------------------- 1 | namespace Microsoft.Windows.Shell 2 | { 3 | public abstract class JumpItem 4 | { 5 | internal JumpItem() 6 | { 7 | } 8 | 9 | public string CustomCategory { get; set; } 10 | } 11 | } 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/JumpItemRejectionReason.cs: -------------------------------------------------------------------------------- 1 | namespace Microsoft.Windows.Shell 2 | { 3 | public enum JumpItemRejectionReason 4 | { 5 | None, 6 | InvalidItem, 7 | NoRegisteredHandler, 8 | RemovedByUser 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/JumpItemsRejectedEventArgs.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace Microsoft.Windows.Shell 5 | { 6 | public sealed class JumpItemsRejectedEventArgs : EventArgs 7 | { 8 | public JumpItemsRejectedEventArgs() : this(null, null) 9 | { 10 | } 11 | 12 | public JumpItemsRejectedEventArgs(IList rejectedItems, IList reasons) 13 | { 14 | if ((rejectedItems == null && reasons != null) || (reasons == null && rejectedItems != null) || (rejectedItems != null && reasons != null && rejectedItems.Count != reasons.Count)) 15 | { 16 | throw new ArgumentException("The counts of rejected items doesn't match the count of reasons."); 17 | } 18 | if (rejectedItems != null) 19 | { 20 | this.RejectedItems = new List(rejectedItems).AsReadOnly(); 21 | this.RejectionReasons = new List(reasons).AsReadOnly(); 22 | return; 23 | } 24 | this.RejectedItems = new List().AsReadOnly(); 25 | this.RejectionReasons = new List().AsReadOnly(); 26 | } 27 | 28 | public IList RejectedItems { get; private set; } 29 | 30 | public IList RejectionReasons { get; private set; } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/JumpItemsRemovedEventArgs.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace Microsoft.Windows.Shell 5 | { 6 | public sealed class JumpItemsRemovedEventArgs : EventArgs 7 | { 8 | public JumpItemsRemovedEventArgs() : this(null) 9 | { 10 | } 11 | 12 | public JumpItemsRemovedEventArgs(IList removedItems) 13 | { 14 | if (removedItems != null) 15 | { 16 | this.RemovedItems = new List(removedItems).AsReadOnly(); 17 | return; 18 | } 19 | this.RemovedItems = new List().AsReadOnly(); 20 | } 21 | 22 | public IList RemovedItems { get; private set; } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/JumpPath.cs: -------------------------------------------------------------------------------- 1 | namespace Microsoft.Windows.Shell 2 | { 3 | public class JumpPath : JumpItem 4 | { 5 | public string Path { get; set; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/JumpTask.cs: -------------------------------------------------------------------------------- 1 | namespace Microsoft.Windows.Shell 2 | { 3 | public class JumpTask : JumpItem 4 | { 5 | public string Title { get; set; } 6 | 7 | public string Description { get; set; } 8 | 9 | public string ApplicationPath { get; set; } 10 | 11 | public string Arguments { get; set; } 12 | 13 | public string WorkingDirectory { get; set; } 14 | 15 | public string IconResourcePath { get; set; } 16 | 17 | public int IconResourceIndex { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Microsoft.Windows.Shell.shproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 572d11b9-7ea8-4a04-849a-bb2b0371786f 5 | 14.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/AC.cs: -------------------------------------------------------------------------------- 1 | namespace Standard 2 | { 3 | public enum AC : byte 4 | { 5 | SRC_OVER, 6 | SRC_ALPHA 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/APPDOCLISTTYPE.cs: -------------------------------------------------------------------------------- 1 | namespace Standard 2 | { 3 | public enum APPDOCLISTTYPE 4 | { 5 | ADLT_RECENT, 6 | ADLT_FREQUENT 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/BI.cs: -------------------------------------------------------------------------------- 1 | namespace Standard 2 | { 3 | public enum BI 4 | { 5 | RGB 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/BITMAPINFO.cs: -------------------------------------------------------------------------------- 1 | namespace Standard 2 | { 3 | public struct BITMAPINFO 4 | { 5 | public BITMAPINFOHEADER bmiHeader; 6 | 7 | public RGBQUAD bmiColors; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/BITMAPINFOHEADER.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace Standard 4 | { 5 | [StructLayout(LayoutKind.Sequential, Pack = 2)] 6 | public struct BITMAPINFOHEADER 7 | { 8 | public int biSize; 9 | 10 | public int biWidth; 11 | 12 | public int biHeight; 13 | 14 | public short biPlanes; 15 | 16 | public short biBitCount; 17 | 18 | public BI biCompression; 19 | 20 | public int biSizeImage; 21 | 22 | public int biXPelsPerMeter; 23 | 24 | public int biYPelsPerMeter; 25 | 26 | public int biClrUsed; 27 | 28 | public int biClrImportant; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/BLENDFUNCTION.cs: -------------------------------------------------------------------------------- 1 | namespace Standard 2 | { 3 | public struct BLENDFUNCTION 4 | { 5 | public AC BlendOp; 6 | 7 | public byte BlendFlags; 8 | 9 | public byte SourceConstantAlpha; 10 | 11 | public AC AlphaFormat; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/CHANGEFILTERSTRUCT.cs: -------------------------------------------------------------------------------- 1 | namespace Standard 2 | { 3 | public struct CHANGEFILTERSTRUCT 4 | { 5 | public uint cbSize; 6 | public MSGFLTINFO ExtStatus; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/CLSID.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Standard 4 | { 5 | public static class CLSID 6 | { 7 | public static T CoCreateInstance(string clsid) 8 | { 9 | return (T)((object)Activator.CreateInstance(Type.GetTypeFromCLSID(new Guid(clsid)))); 10 | } 11 | 12 | public const string TaskbarList = "56FDF344-FD6D-11d0-958A-006097C9A090"; 13 | 14 | public const string EnumerableObjectCollection = "2d3468c1-36a7-43b6-ac24-d3f02fd9607a"; 15 | 16 | public const string ShellLink = "00021401-0000-0000-C000-000000000046"; 17 | 18 | public const string DestinationList = "77f10cf0-3db5-4966-b520-b7c54fd35ed6"; 19 | 20 | public const string ApplicationDestinations = "86c14003-4d6b-4ef3-a7b4-0506663b2e68"; 21 | 22 | public const string ApplicationDocumentLists = "86bec222-30f2-47e0-9f25-60d11cd75c28"; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/CREATESTRUCT.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace Standard 5 | { 6 | [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] 7 | public struct CREATESTRUCT 8 | { 9 | public IntPtr lpCreateParams; 10 | 11 | public IntPtr hInstance; 12 | 13 | public IntPtr hMenu; 14 | 15 | public IntPtr hwndParent; 16 | 17 | public int cy; 18 | 19 | public int cx; 20 | 21 | public int y; 22 | 23 | public int x; 24 | 25 | public WS style; 26 | 27 | [MarshalAs(UnmanagedType.LPWStr)] 28 | public string lpszName; 29 | 30 | [MarshalAs(UnmanagedType.LPWStr)] 31 | public string lpszClass; 32 | 33 | public WS_EX dwExStyle; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/CS.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Standard 4 | { 5 | [Flags] 6 | public enum CS : uint 7 | { 8 | VREDRAW = 1U, 9 | HREDRAW = 2U, 10 | DBLCLKS = 8U, 11 | OWNDC = 32U, 12 | CLASSDC = 64U, 13 | PARENTDC = 128U, 14 | NOCLOSE = 512U, 15 | SAVEBITS = 2048U, 16 | BYTEALIGNCLIENT = 4096U, 17 | BYTEALIGNWINDOW = 8192U, 18 | GLOBALCLASS = 16384U, 19 | IME = 65536U, 20 | DROPSHADOW = 131072U 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/CombineRgnResult.cs: -------------------------------------------------------------------------------- 1 | namespace Standard 2 | { 3 | public enum CombineRgnResult 4 | { 5 | ERROR, 6 | NULLREGION, 7 | SIMPLEREGION, 8 | COMPLEXREGION 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/DOGIF.cs: -------------------------------------------------------------------------------- 1 | namespace Standard 2 | { 3 | public enum DOGIF 4 | { 5 | DEFAULT, 6 | TRAVERSE_LINK, 7 | NO_HDROP, 8 | NO_URL = 4, 9 | ONLY_IF_ONE = 8 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/DWMFLIP3D.cs: -------------------------------------------------------------------------------- 1 | namespace Standard 2 | { 3 | public enum DWMFLIP3D 4 | { 5 | DEFAULT, 6 | EXCLUDEBELOW, 7 | EXCLUDEABOVE 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/DWMNCRP.cs: -------------------------------------------------------------------------------- 1 | namespace Standard 2 | { 3 | public enum DWMNCRP 4 | { 5 | USEWINDOWSTYLE, 6 | DISABLED, 7 | ENABLED 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/DWMWA.cs: -------------------------------------------------------------------------------- 1 | namespace Standard 2 | { 3 | public enum DWMWA 4 | { 5 | NCRENDERING_ENABLED = 1, 6 | NCRENDERING_POLICY, 7 | TRANSITIONS_FORCEDISABLED, 8 | ALLOW_NCPAINT, 9 | CAPTION_BUTTON_BOUNDS, 10 | NONCLIENT_RTL_LAYOUT, 11 | FORCE_ICONIC_REPRESENTATION, 12 | FLIP3D_POLICY, 13 | EXTENDED_FRAME_BOUNDS, 14 | HAS_ICONIC_BITMAP, 15 | DISALLOW_PEEK, 16 | EXCLUDED_FROM_PEEK 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/DWM_SIT.cs: -------------------------------------------------------------------------------- 1 | namespace Standard 2 | { 3 | public enum DWM_SIT 4 | { 5 | None, 6 | DISPLAYFRAME 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/DWM_TIMING_INFO.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace Standard 4 | { 5 | [StructLayout(LayoutKind.Sequential, Pack = 1)] 6 | public struct DWM_TIMING_INFO 7 | { 8 | public int cbSize; 9 | 10 | public UNSIGNED_RATIO rateRefresh; 11 | 12 | public ulong qpcRefreshPeriod; 13 | 14 | public UNSIGNED_RATIO rateCompose; 15 | 16 | public ulong qpcVBlank; 17 | 18 | public ulong cRefresh; 19 | 20 | public uint cDXRefresh; 21 | 22 | public ulong qpcCompose; 23 | 24 | public ulong cFrame; 25 | 26 | public uint cDXPresent; 27 | 28 | public ulong cRefreshFrame; 29 | 30 | public ulong cFrameSubmitted; 31 | 32 | public uint cDXPresentSubmitted; 33 | 34 | public ulong cFrameConfirmed; 35 | 36 | public uint cDXPresentConfirmed; 37 | 38 | public ulong cRefreshConfirmed; 39 | 40 | public uint cDXRefreshConfirmed; 41 | 42 | public ulong cFramesLate; 43 | 44 | public uint cFramesOutstanding; 45 | 46 | public ulong cFrameDisplayed; 47 | 48 | public ulong qpcFrameDisplayed; 49 | 50 | public ulong cRefreshFrameDisplayed; 51 | 52 | public ulong cFrameComplete; 53 | 54 | public ulong qpcFrameComplete; 55 | 56 | public ulong cFramePending; 57 | 58 | public ulong qpcFramePending; 59 | 60 | public ulong cFramesDisplayed; 61 | 62 | public ulong cFramesComplete; 63 | 64 | public ulong cFramesPending; 65 | 66 | public ulong cFramesAvailable; 67 | 68 | public ulong cFramesDropped; 69 | 70 | public ulong cFramesMissed; 71 | 72 | public ulong cRefreshNextDisplayed; 73 | 74 | public ulong cRefreshNextPresented; 75 | 76 | public ulong cRefreshesDisplayed; 77 | 78 | public ulong cRefreshesPresented; 79 | 80 | public ulong cRefreshStarted; 81 | 82 | public ulong cPixelsReceived; 83 | 84 | public ulong cPixelsDrawn; 85 | 86 | public ulong cBuffersEmpty; 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/DeviceCap.cs: -------------------------------------------------------------------------------- 1 | namespace Standard 2 | { 3 | public enum DeviceCap 4 | { 5 | BITSPIXEL = 12, 6 | PLANES = 14, 7 | LOGPIXELSX = 88, 8 | LOGPIXELSY = 90 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/DoubleUtilities.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics.CodeAnalysis; 2 | 3 | namespace Standard 4 | { 5 | public static class DoubleUtilities 6 | { 7 | [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 8 | public static bool AreClose(double value1, double value2) 9 | { 10 | if (value1 == value2) 11 | { 12 | return true; 13 | } 14 | double num = value1 - value2; 15 | return num < 1.53E-06 && num > -1.53E-06; 16 | } 17 | 18 | [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 19 | public static bool LessThan(double value1, double value2) 20 | { 21 | return value1 < value2 && !DoubleUtilities.AreClose(value1, value2); 22 | } 23 | 24 | [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 25 | public static bool GreaterThan(double value1, double value2) 26 | { 27 | return value1 > value2 && !DoubleUtilities.AreClose(value1, value2); 28 | } 29 | 30 | [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 31 | public static bool LessThanOrClose(double value1, double value2) 32 | { 33 | return value1 < value2 || DoubleUtilities.AreClose(value1, value2); 34 | } 35 | 36 | [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 37 | public static bool GreaterThanOrClose(double value1, double value2) 38 | { 39 | return value1 > value2 || DoubleUtilities.AreClose(value1, value2); 40 | } 41 | 42 | [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 43 | public static bool IsFinite(double value) 44 | { 45 | return !double.IsNaN(value) && !double.IsInfinity(value); 46 | } 47 | 48 | [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 49 | public static bool IsValidSize(double value) 50 | { 51 | return DoubleUtilities.IsFinite(value) && DoubleUtilities.GreaterThanOrClose(value, 0.0); 52 | } 53 | 54 | private const double Epsilon = 1.53E-06; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/DpiHelper.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics.CodeAnalysis; 2 | using System.Windows; 3 | using System.Windows.Media; 4 | 5 | namespace Standard 6 | { 7 | public static class DpiHelper 8 | { 9 | [SuppressMessage("Microsoft.Performance", "CA1810:InitializeReferenceTypeStaticFieldsInline")] 10 | static DpiHelper() 11 | { 12 | using (SafeDC desktop = SafeDC.GetDesktop()) 13 | { 14 | int deviceCaps = NativeMethods.GetDeviceCaps(desktop, DeviceCap.LOGPIXELSX); 15 | int deviceCaps2 = NativeMethods.GetDeviceCaps(desktop, DeviceCap.LOGPIXELSY); 16 | DpiHelper._transformToDip = Matrix.Identity; 17 | DpiHelper._transformToDip.Scale(96.0 / (double)deviceCaps, 96.0 / (double)deviceCaps2); 18 | DpiHelper._transformToDevice = Matrix.Identity; 19 | DpiHelper._transformToDevice.Scale((double)deviceCaps / 96.0, (double)deviceCaps2 / 96.0); 20 | } 21 | } 22 | 23 | public static Point LogicalPixelsToDevice(Point logicalPoint) 24 | { 25 | return DpiHelper._transformToDevice.Transform(logicalPoint); 26 | } 27 | 28 | public static Point DevicePixelsToLogical(Point devicePoint) 29 | { 30 | return DpiHelper._transformToDip.Transform(devicePoint); 31 | } 32 | 33 | [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 34 | public static Rect LogicalRectToDevice(Rect logicalRectangle) 35 | { 36 | Point point = DpiHelper.LogicalPixelsToDevice(new Point(logicalRectangle.Left, logicalRectangle.Top)); 37 | Point point2 = DpiHelper.LogicalPixelsToDevice(new Point(logicalRectangle.Right, logicalRectangle.Bottom)); 38 | return new Rect(point, point2); 39 | } 40 | 41 | public static Rect DeviceRectToLogical(Rect deviceRectangle) 42 | { 43 | Point point = DpiHelper.DevicePixelsToLogical(new Point(deviceRectangle.Left, deviceRectangle.Top)); 44 | Point point2 = DpiHelper.DevicePixelsToLogical(new Point(deviceRectangle.Right, deviceRectangle.Bottom)); 45 | return new Rect(point, point2); 46 | } 47 | 48 | [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 49 | public static Size LogicalSizeToDevice(Size logicalSize) 50 | { 51 | Point point = DpiHelper.LogicalPixelsToDevice(new Point(logicalSize.Width, logicalSize.Height)); 52 | return new Size 53 | { 54 | Width = point.X, 55 | Height = point.Y 56 | }; 57 | } 58 | 59 | public static Size DeviceSizeToLogical(Size deviceSize) 60 | { 61 | Point point = DpiHelper.DevicePixelsToLogical(new Point(deviceSize.Width, deviceSize.Height)); 62 | return new Size(point.X, point.Y); 63 | } 64 | 65 | private static Matrix _transformToDevice; 66 | 67 | private static Matrix _transformToDip; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/ErrorModes.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Standard 4 | { 5 | [Flags] 6 | public enum ErrorModes 7 | { 8 | Default = 0, 9 | FailCriticalErrors = 1, 10 | NoGpFaultErrorBox = 2, 11 | NoAlignmentFaultExcept = 4, 12 | NoOpenFileErrorBox = 32768 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/FO.cs: -------------------------------------------------------------------------------- 1 | namespace Standard 2 | { 3 | public enum FO 4 | { 5 | MOVE = 1, 6 | COPY, 7 | DELETE, 8 | RENAME 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/FOF.cs: -------------------------------------------------------------------------------- 1 | namespace Standard 2 | { 3 | public enum FOF : ushort 4 | { 5 | MULTIDESTFILES = 1, 6 | CONFIRMMOUSE, 7 | SILENT = 4, 8 | RENAMEONCOLLISION = 8, 9 | NOCONFIRMATION = 16, 10 | WANTMAPPINGHANDLE = 32, 11 | ALLOWUNDO = 64, 12 | FILESONLY = 128, 13 | SIMPLEPROGRESS = 256, 14 | NOCONFIRMMKDIR = 512, 15 | NOERRORUI = 1024, 16 | NOCOPYSECURITYATTRIBS = 2048, 17 | NORECURSION = 4096, 18 | NO_CONNECTED_ELEMENTS = 8192, 19 | WANTNUKEWARNING = 16384, 20 | NORECURSEREPARSE = 32768 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/Facility.cs: -------------------------------------------------------------------------------- 1 | namespace Standard 2 | { 3 | public enum Facility 4 | { 5 | Null, 6 | Rpc, 7 | Dispatch, 8 | Storage, 9 | Itf, 10 | Win32 = 7, 11 | Windows, 12 | Control = 10, 13 | Ese = 3678, 14 | WinCodec = 2200 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/GCLP.cs: -------------------------------------------------------------------------------- 1 | namespace Standard 2 | { 3 | public enum GCLP 4 | { 5 | HBRBACKGROUND = -10 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/GPS.cs: -------------------------------------------------------------------------------- 1 | namespace Standard 2 | { 3 | public enum GPS 4 | { 5 | DEFAULT, 6 | HANDLERPROPERTIESONLY, 7 | READWRITE, 8 | TEMPORARY = 4, 9 | FASTPROPERTIESONLY = 8, 10 | OPENSLOWITEM = 16, 11 | DELAYCREATION = 32, 12 | BESTEFFORT = 64, 13 | NO_OPLOCK = 128, 14 | MASK_VALID = 255 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/GWL.cs: -------------------------------------------------------------------------------- 1 | namespace Standard 2 | { 3 | public enum GWL 4 | { 5 | WNDPROC = -4, 6 | HINSTANCE = -6, 7 | HWNDPARENT = -8, 8 | STYLE = -16, 9 | EXSTYLE = -20, 10 | USERDATA = -21, 11 | ID = -12 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/HCF.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Standard 4 | { 5 | [Flags] 6 | public enum HCF 7 | { 8 | HIGHCONTRASTON = 1, 9 | AVAILABLE = 2, 10 | HOTKEYACTIVE = 4, 11 | CONFIRMHOTKEY = 8, 12 | HOTKEYSOUND = 16, 13 | INDICATOR = 32, 14 | HOTKEYAVAILABLE = 64 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/HIGHCONTRAST.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Standard 4 | { 5 | public struct HIGHCONTRAST 6 | { 7 | public int cbSize; 8 | 9 | public HCF dwFlags; 10 | 11 | public IntPtr lpszDefaultScheme; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/HT.cs: -------------------------------------------------------------------------------- 1 | namespace Standard 2 | { 3 | public enum HT 4 | { 5 | ERROR = -2, 6 | TRANSPARENT, 7 | NOWHERE, 8 | CLIENT, 9 | CAPTION, 10 | SYSMENU, 11 | GROWBOX, 12 | SIZE = 4, 13 | MENU, 14 | HSCROLL, 15 | VSCROLL, 16 | MINBUTTON, 17 | MAXBUTTON, 18 | LEFT, 19 | RIGHT, 20 | TOP, 21 | TOPLEFT, 22 | TOPRIGHT, 23 | BOTTOM, 24 | BOTTOMLEFT, 25 | BOTTOMRIGHT, 26 | BORDER, 27 | REDUCE = 8, 28 | ZOOM, 29 | SIZEFIRST, 30 | SIZELAST = 17, 31 | OBJECT = 19, 32 | CLOSE, 33 | HELP 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/IApplicationDestinations.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace Standard 5 | { 6 | [Guid("12337d35-94c6-48a0-bce7-6a9c69d4d600")] 7 | [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] 8 | [ComImport] 9 | public interface IApplicationDestinations 10 | { 11 | void SetAppID([MarshalAs(UnmanagedType.LPWStr)][In] string pszAppID); 12 | 13 | void RemoveDestination([MarshalAs(UnmanagedType.IUnknown)] object punk); 14 | 15 | void RemoveAllDestinations(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/IApplicationDocumentLists.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace Standard 5 | { 6 | [Guid("3c594f9f-9f30-47a1-979a-c9e83d3d0a06")] 7 | [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] 8 | [ComImport] 9 | public interface IApplicationDocumentLists 10 | { 11 | void SetAppID([MarshalAs(UnmanagedType.LPWStr)] string pszAppID); 12 | 13 | [return: MarshalAs(UnmanagedType.IUnknown)] 14 | object GetList([In] APPDOCLISTTYPE listtype, [In] uint cItemsDesired, [In] ref Guid riid); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/ICustomDestinationList.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace Standard 5 | { 6 | [Guid("6332debf-87b5-4670-90c0-5e57b408a49e")] 7 | [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] 8 | [ComImport] 9 | public interface ICustomDestinationList 10 | { 11 | void SetAppID([MarshalAs(UnmanagedType.LPWStr)][In] string pszAppID); 12 | 13 | [return: MarshalAs(UnmanagedType.Interface)] 14 | object BeginList(out uint pcMaxSlots, [In] ref Guid riid); 15 | 16 | [PreserveSig] 17 | HRESULT AppendCategory([MarshalAs(UnmanagedType.LPWStr)] string pszCategory, IObjectArray poa); 18 | 19 | void AppendKnownCategory(KDC category); 20 | 21 | [PreserveSig] 22 | HRESULT AddUserTasks(IObjectArray poa); 23 | 24 | void CommitList(); 25 | 26 | [return: MarshalAs(UnmanagedType.Interface)] 27 | object GetRemovedDestinations([In] ref Guid riid); 28 | 29 | void DeleteList([MarshalAs(UnmanagedType.LPWStr)] string pszAppID); 30 | 31 | void AbortList(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/IEnumIDList.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace Standard 5 | { 6 | [Guid("000214F2-0000-0000-C000-000000000046")] 7 | [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] 8 | [ComImport] 9 | public interface IEnumIDList 10 | { 11 | [PreserveSig] 12 | HRESULT Next(uint celt, out IntPtr rgelt, out int pceltFetched); 13 | 14 | [PreserveSig] 15 | HRESULT Skip(uint celt); 16 | 17 | void Reset(); 18 | 19 | void Clone([MarshalAs(UnmanagedType.Interface)] out IEnumIDList ppenum); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/IEnumObjects.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace Standard 5 | { 6 | [Guid("2c1c7e2e-2d0e-4059-831e-1e6f82335c2e")] 7 | [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] 8 | [ComImport] 9 | public interface IEnumObjects 10 | { 11 | void Next(uint celt, [In] ref Guid riid, [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.IUnknown, SizeParamIndex = 0)][Out] object[] rgelt, out uint pceltFetched); 12 | 13 | void Skip(uint celt); 14 | 15 | void Reset(); 16 | 17 | IEnumObjects Clone(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/IID.cs: -------------------------------------------------------------------------------- 1 | namespace Standard 2 | { 3 | public static class IID 4 | { 5 | public const string EnumIdList = "000214F2-0000-0000-C000-000000000046"; 6 | 7 | public const string EnumObjects = "2c1c7e2e-2d0e-4059-831e-1e6f82335c2e"; 8 | 9 | public const string HtmlDocument2 = "332C4425-26CB-11D0-B483-00C04FD90119"; 10 | 11 | public const string ModalWindow = "b4db1657-70d7-485e-8e3e-6fcb5a5c1802"; 12 | 13 | public const string ObjectArray = "92CA9DCD-5622-4bba-A805-5E9F541BD8C9"; 14 | 15 | public const string ObjectCollection = "5632b1a4-e38a-400a-928a-d4cd63230295"; 16 | 17 | public const string PropertyNotifySink = "9BFBBC02-EFF1-101A-84ED-00AA00341D07"; 18 | 19 | public const string PropertyStore = "886d8eeb-8cf2-4446-8d02-cdba1dbdcf99"; 20 | 21 | public const string ServiceProvider = "6d5140c1-7436-11ce-8034-00aa006009fa"; 22 | 23 | public const string ShellFolder = "000214E6-0000-0000-C000-000000000046"; 24 | 25 | public const string ShellLink = "000214F9-0000-0000-C000-000000000046"; 26 | 27 | public const string ShellItem = "43826d1e-e718-42ee-bc55-a1e261c37bfe"; 28 | 29 | public const string ShellItem2 = "7e9fb0d3-919f-4307-ab2e-9b1860310c93"; 30 | 31 | public const string ShellItemArray = "B63EA76D-1F85-456F-A19C-48159EFA858B"; 32 | 33 | public const string TaskbarList = "56FDF342-FD6D-11d0-958A-006097C9A090"; 34 | 35 | public const string TaskbarList2 = "602D4995-B13A-429b-A66E-1935E44F4317"; 36 | 37 | public const string Unknown = "00000000-0000-0000-C000-000000000046"; 38 | 39 | public const string ApplicationDestinations = "12337d35-94c6-48a0-bce7-6a9c69d4d600"; 40 | 41 | public const string ApplicationDocumentLists = "3c594f9f-9f30-47a1-979a-c9e83d3d0a06"; 42 | 43 | public const string CustomDestinationList = "6332debf-87b5-4670-90c0-5e57b408a49e"; 44 | 45 | public const string ObjectWithAppUserModelId = "36db0196-9665-46d1-9ba7-d3709eecf9ed"; 46 | 47 | public const string ObjectWithProgId = "71e806fb-8dee-46fc-bf8c-7748a8a1ae13"; 48 | 49 | public const string TaskbarList3 = "ea1afb91-9e28-4b86-90e9-9e9f8a5eefaf"; 50 | 51 | public const string TaskbarList4 = "c43dc798-95d1-4bea-9030-bb99e2983a1a"; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/INPUT.cs: -------------------------------------------------------------------------------- 1 | namespace Standard 2 | { 3 | public struct INPUT 4 | { 5 | public uint type; 6 | 7 | public MOUSEINPUT mi; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/INPUT_TYPE.cs: -------------------------------------------------------------------------------- 1 | namespace Standard 2 | { 3 | public enum INPUT_TYPE : uint 4 | { 5 | MOUSE 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/IObjectArray.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace Standard 5 | { 6 | [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] 7 | [Guid("92CA9DCD-5622-4bba-A805-5E9F541BD8C9")] 8 | [ComImport] 9 | public interface IObjectArray 10 | { 11 | uint GetCount(); 12 | 13 | [return: MarshalAs(UnmanagedType.IUnknown)] 14 | object GetAt([In] uint uiIndex, [In] ref Guid riid); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/IObjectCollection.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace Standard 5 | { 6 | [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] 7 | [Guid("92CA9DCD-5622-4bba-A805-5E9F541BD8C9")] 8 | [ComImport] 9 | public interface IObjectCollection : IObjectArray 10 | { 11 | //new uint GetCount(); 12 | 13 | //[return: MarshalAs(UnmanagedType.IUnknown)] 14 | //object GetAt([In] uint uiIndex, [In] ref Guid riid); 15 | 16 | void AddObject([MarshalAs(UnmanagedType.IUnknown)] object punk); 17 | 18 | void AddFromArray(IObjectArray poaSource); 19 | 20 | void RemoveObjectAt(uint uiIndex); 21 | 22 | void Clear(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/IObjectWithAppUserModelId.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace Standard 5 | { 6 | [Guid("36db0196-9665-46d1-9ba7-d3709eecf9ed")] 7 | [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] 8 | [ComImport] 9 | public interface IObjectWithAppUserModelId 10 | { 11 | void SetAppID([MarshalAs(UnmanagedType.LPWStr)] string pszAppID); 12 | 13 | [return: MarshalAs(UnmanagedType.LPWStr)] 14 | string GetAppID(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/IObjectWithProgId.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace Standard 5 | { 6 | [Guid("71e806fb-8dee-46fc-bf8c-7748a8a1ae13")] 7 | [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] 8 | [ComImport] 9 | public interface IObjectWithProgId 10 | { 11 | void SetProgID([MarshalAs(UnmanagedType.LPWStr)] string pszProgID); 12 | 13 | [return: MarshalAs(UnmanagedType.LPWStr)] 14 | string GetProgID(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/IPropertyStore.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace Standard 5 | { 6 | [Guid("886d8eeb-8cf2-4446-8d02-cdba1dbdcf99")] 7 | [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] 8 | [ComImport] 9 | public interface IPropertyStore 10 | { 11 | uint GetCount(); 12 | 13 | PKEY GetAt(uint iProp); 14 | 15 | void GetValue([In] ref PKEY pkey, [In][Out] PROPVARIANT pv); 16 | 17 | void SetValue([In] ref PKEY pkey, PROPVARIANT pv); 18 | 19 | void Commit(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/IShellFolder.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | using System.Runtime.InteropServices.ComTypes; 4 | 5 | namespace Standard 6 | { 7 | [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] 8 | [Guid("000214E6-0000-0000-C000-000000000046")] 9 | [ComImport] 10 | public interface IShellFolder 11 | { 12 | void ParseDisplayName([In] IntPtr hwnd, [In] IBindCtx pbc, [MarshalAs(UnmanagedType.LPWStr)][In] string pszDisplayName, [In][Out] ref int pchEaten, out IntPtr ppidl, [In][Out] ref uint pdwAttributes); 13 | 14 | IEnumIDList EnumObjects([In] IntPtr hwnd, [In] SHCONTF grfFlags); 15 | 16 | [return: MarshalAs(UnmanagedType.Interface)] 17 | object BindToObject([In] IntPtr pidl, [In] IBindCtx pbc, [In] ref Guid riid); 18 | 19 | [return: MarshalAs(UnmanagedType.Interface)] 20 | object BindToStorage([In] IntPtr pidl, [In] IBindCtx pbc, [In] ref Guid riid); 21 | 22 | [PreserveSig] 23 | HRESULT CompareIDs([In] IntPtr lParam, [In] IntPtr pidl1, [In] IntPtr pidl2); 24 | 25 | [return: MarshalAs(UnmanagedType.Interface)] 26 | object CreateViewObject([In] IntPtr hwndOwner, [In] ref Guid riid); 27 | 28 | void GetAttributesOf([In] uint cidl, [In] IntPtr apidl, [In][Out] ref SFGAO rgfInOut); 29 | 30 | [return: MarshalAs(UnmanagedType.Interface)] 31 | object GetUIObjectOf([In] IntPtr hwndOwner, [In] uint cidl, [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.SysInt, SizeParamIndex = 2)][In] IntPtr apidl, [In] ref Guid riid, [In][Out] ref uint rgfReserved); 32 | 33 | void GetDisplayNameOf([In] IntPtr pidl, [In] SHGDN uFlags, out IntPtr pName); 34 | 35 | void SetNameOf([In] IntPtr hwnd, [In] IntPtr pidl, [MarshalAs(UnmanagedType.LPWStr)][In] string pszName, [In] SHGDN uFlags, out IntPtr ppidlOut); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/IShellItem.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | using System.Runtime.InteropServices.ComTypes; 4 | 5 | namespace Standard 6 | { 7 | [Guid("43826d1e-e718-42ee-bc55-a1e261c37bfe")] 8 | [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] 9 | [ComImport] 10 | public interface IShellItem 11 | { 12 | [return: MarshalAs(UnmanagedType.Interface)] 13 | object BindToHandler(IBindCtx pbc, [In] ref Guid bhid, [In] ref Guid riid); 14 | 15 | IShellItem GetParent(); 16 | 17 | [return: MarshalAs(UnmanagedType.LPWStr)] 18 | string GetDisplayName(SIGDN sigdnName); 19 | 20 | SFGAO GetAttributes(SFGAO sfgaoMask); 21 | 22 | int Compare(IShellItem psi, SICHINT hint); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/IShellItem2.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | using System.Runtime.InteropServices.ComTypes; 4 | 5 | namespace Standard 6 | { 7 | [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] 8 | [Guid("7e9fb0d3-919f-4307-ab2e-9b1860310c93")] 9 | [ComImport] 10 | public interface IShellItem2 : IShellItem 11 | { 12 | [return: MarshalAs(UnmanagedType.Interface)] 13 | object GetPropertyStore(GPS flags, [In] ref Guid riid); 14 | 15 | [return: MarshalAs(UnmanagedType.Interface)] 16 | object GetPropertyStoreWithCreateObject(GPS flags, [MarshalAs(UnmanagedType.IUnknown)] object punkCreateObject, [In] ref Guid riid); 17 | 18 | [return: MarshalAs(UnmanagedType.Interface)] 19 | object GetPropertyStoreForKeys(IntPtr rgKeys, uint cKeys, GPS flags, [In] ref Guid riid); 20 | 21 | [return: MarshalAs(UnmanagedType.Interface)] 22 | object GetPropertyDescriptionList(IntPtr keyType, [In] ref Guid riid); 23 | 24 | void Update(IBindCtx pbc); 25 | 26 | PROPVARIANT GetProperty(IntPtr key); 27 | 28 | Guid GetCLSID(IntPtr key); 29 | 30 | System.Runtime.InteropServices.ComTypes.FILETIME GetFileTime(IntPtr key); 31 | 32 | int GetInt32(IntPtr key); 33 | 34 | [return: MarshalAs(UnmanagedType.LPWStr)] 35 | string GetString(IntPtr key); 36 | 37 | uint GetUInt32(IntPtr key); 38 | 39 | ulong GetUInt64(IntPtr key); 40 | 41 | [return: MarshalAs(UnmanagedType.Bool)] 42 | void GetBool(IntPtr key); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/IShellItemArray.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | using System.Runtime.InteropServices.ComTypes; 4 | 5 | namespace Standard 6 | { 7 | [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] 8 | [Guid("B63EA76D-1F85-456F-A19C-48159EFA858B")] 9 | [ComImport] 10 | public interface IShellItemArray 11 | { 12 | [return: MarshalAs(UnmanagedType.Interface)] 13 | object BindToHandler(IBindCtx pbc, [In] ref Guid rbhid, [In] ref Guid riid); 14 | 15 | [return: MarshalAs(UnmanagedType.Interface)] 16 | object GetPropertyStore(int flags, [In] ref Guid riid); 17 | 18 | [return: MarshalAs(UnmanagedType.Interface)] 19 | object GetPropertyDescriptionList([In] ref PKEY keyType, [In] ref Guid riid); 20 | 21 | uint GetAttributes(SIATTRIBFLAGS dwAttribFlags, uint sfgaoMask); 22 | 23 | uint GetCount(); 24 | 25 | IShellItem GetItemAt(uint dwIndex); 26 | 27 | [return: MarshalAs(UnmanagedType.Interface)] 28 | object EnumItems(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/IShellLinkW.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | using System.Text; 4 | 5 | namespace Standard 6 | { 7 | [Guid("000214F9-0000-0000-C000-000000000046")] 8 | [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] 9 | [ComImport] 10 | public interface IShellLinkW 11 | { 12 | void GetPath([MarshalAs(UnmanagedType.LPWStr)][Out] StringBuilder pszFile, int cchMaxPath, [In][Out] WIN32_FIND_DATAW pfd, SLGP fFlags); 13 | 14 | void GetIDList(out IntPtr ppidl); 15 | 16 | void SetIDList(IntPtr pidl); 17 | 18 | void GetDescription([MarshalAs(UnmanagedType.LPWStr)][Out] StringBuilder pszFile, int cchMaxName); 19 | 20 | void SetDescription([MarshalAs(UnmanagedType.LPWStr)] string pszName); 21 | 22 | void GetWorkingDirectory([MarshalAs(UnmanagedType.LPWStr)][Out] StringBuilder pszDir, int cchMaxPath); 23 | 24 | void SetWorkingDirectory([MarshalAs(UnmanagedType.LPWStr)] string pszDir); 25 | 26 | void GetArguments([MarshalAs(UnmanagedType.LPWStr)][Out] StringBuilder pszArgs, int cchMaxPath); 27 | 28 | void SetArguments([MarshalAs(UnmanagedType.LPWStr)] string pszArgs); 29 | 30 | short GetHotKey(); 31 | 32 | void SetHotKey(short wHotKey); 33 | 34 | uint GetShowCmd(); 35 | 36 | void SetShowCmd(uint iShowCmd); 37 | 38 | void GetIconLocation([MarshalAs(UnmanagedType.LPWStr)][Out] StringBuilder pszIconPath, int cchIconPath, out int piIcon); 39 | 40 | void SetIconLocation([MarshalAs(UnmanagedType.LPWStr)] string pszIconPath, int iIcon); 41 | 42 | void SetRelativePath([MarshalAs(UnmanagedType.LPWStr)] string pszPathRel, uint dwReserved); 43 | 44 | void Resolve(IntPtr hwnd, uint fFlags); 45 | 46 | void SetPath([MarshalAs(UnmanagedType.LPWStr)] string pszFile); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/ITaskbarList.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace Standard 5 | { 6 | [Guid("56FDF342-FD6D-11d0-958A-006097C9A090")] 7 | [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] 8 | [ComImport] 9 | public interface ITaskbarList 10 | { 11 | void HrInit(); 12 | 13 | void AddTab(IntPtr hwnd); 14 | 15 | void DeleteTab(IntPtr hwnd); 16 | 17 | void ActivateTab(IntPtr hwnd); 18 | 19 | void SetActiveAlt(IntPtr hwnd); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/ITaskbarList2.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace Standard 5 | { 6 | [Guid("602D4995-B13A-429b-A66E-1935E44F4317")] 7 | [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] 8 | [ComImport] 9 | public interface ITaskbarList2 : ITaskbarList 10 | { 11 | void MarkFullscreenWindow(IntPtr hwnd, [MarshalAs(UnmanagedType.Bool)] bool fFullscreen); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/ITaskbarList3.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace Standard 5 | { 6 | [Guid("ea1afb91-9e28-4b86-90e9-9e9f8a5eefaf")] 7 | [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] 8 | [ComImport] 9 | public interface ITaskbarList3 : ITaskbarList2, ITaskbarList 10 | { 11 | [PreserveSig] 12 | HRESULT SetProgressValue(IntPtr hwnd, ulong ullCompleted, ulong ullTotal); 13 | 14 | [PreserveSig] 15 | HRESULT SetProgressState(IntPtr hwnd, TBPF tbpFlags); 16 | 17 | [PreserveSig] 18 | HRESULT RegisterTab(IntPtr hwndTab, IntPtr hwndMDI); 19 | 20 | [PreserveSig] 21 | HRESULT UnregisterTab(IntPtr hwndTab); 22 | 23 | [PreserveSig] 24 | HRESULT SetTabOrder(IntPtr hwndTab, IntPtr hwndInsertBefore); 25 | 26 | [PreserveSig] 27 | HRESULT SetTabActive(IntPtr hwndTab, IntPtr hwndMDI, uint dwReserved); 28 | 29 | [PreserveSig] 30 | HRESULT ThumbBarAddButtons(IntPtr hwnd, uint cButtons, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] THUMBBUTTON[] pButtons); 31 | 32 | [PreserveSig] 33 | HRESULT ThumbBarUpdateButtons(IntPtr hwnd, uint cButtons, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] THUMBBUTTON[] pButtons); 34 | 35 | [PreserveSig] 36 | HRESULT ThumbBarSetImageList(IntPtr hwnd, [MarshalAs(UnmanagedType.IUnknown)] object himl); 37 | 38 | [PreserveSig] 39 | HRESULT SetOverlayIcon(IntPtr hwnd, IntPtr hIcon, [MarshalAs(UnmanagedType.LPWStr)] string pszDescription); 40 | 41 | [PreserveSig] 42 | HRESULT SetThumbnailTooltip(IntPtr hwnd, [MarshalAs(UnmanagedType.LPWStr)] string pszTip); 43 | 44 | [PreserveSig] 45 | HRESULT SetThumbnailClip(IntPtr hwnd, RefRECT prcClip); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/ITaskbarList4.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace Standard 5 | { 6 | [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] 7 | [Guid("ea1afb91-9e28-4b86-90e9-9e9f8a5eefaf")] 8 | [ComImport] 9 | public interface ITaskbarList4 : ITaskbarList3, ITaskbarList2, ITaskbarList 10 | { 11 | void SetTabProperties(IntPtr hwndTab, STPF stpFlags); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/KDC.cs: -------------------------------------------------------------------------------- 1 | namespace Standard 2 | { 3 | public enum KDC 4 | { 5 | FREQUENT = 1, 6 | RECENT 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/LOGFONT.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace Standard 4 | { 5 | [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] 6 | public struct LOGFONT 7 | { 8 | public int lfHeight; 9 | 10 | public int lfWidth; 11 | 12 | public int lfEscapement; 13 | 14 | public int lfOrientation; 15 | 16 | public int lfWeight; 17 | 18 | public byte lfItalic; 19 | 20 | public byte lfUnderline; 21 | 22 | public byte lfStrikeOut; 23 | 24 | public byte lfCharSet; 25 | 26 | public byte lfOutPrecision; 27 | 28 | public byte lfClipPrecision; 29 | 30 | public byte lfQuality; 31 | 32 | public byte lfPitchAndFamily; 33 | 34 | [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] 35 | public string lfFaceName; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/MARGINS.cs: -------------------------------------------------------------------------------- 1 | namespace Standard 2 | { 3 | public struct MARGINS 4 | { 5 | public int cxLeftWidth; 6 | 7 | public int cxRightWidth; 8 | 9 | public int cyTopHeight; 10 | 11 | public int cyBottomHeight; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/MF.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Standard 4 | { 5 | [Flags] 6 | public enum MF : uint 7 | { 8 | DOES_NOT_EXIST = 4294967295U, 9 | ENABLED = 0U, 10 | BYCOMMAND = 0U, 11 | GRAYED = 1U, 12 | DISABLED = 2U 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/MINMAXINFO.cs: -------------------------------------------------------------------------------- 1 | namespace Standard 2 | { 3 | public struct MINMAXINFO 4 | { 5 | //public MINMAXINFO(POINT ptReserved, POINT ptMaxSize, POINT ptMaxPosition, POINT ptMinTrackSize, POINT ptMaxTrackSize) 6 | //{ 7 | // this.ptReserved = ptReserved; 8 | // this.ptMaxSize = ptMaxSize; 9 | // this.ptMaxPosition = ptMaxPosition; 10 | // this.ptMinTrackSize = ptMinTrackSize; 11 | // this.ptMaxTrackSize = ptMaxTrackSize; 12 | //} 13 | 14 | public POINT ptReserved; 15 | 16 | public POINT ptMaxSize; 17 | 18 | public POINT ptMaxPosition; 19 | 20 | public POINT ptMinTrackSize; 21 | 22 | public POINT ptMaxTrackSize; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/MONITORINFO.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace Standard 4 | { 5 | [StructLayout(LayoutKind.Sequential)] 6 | public class MONITORINFO 7 | { 8 | public int cbSize = Marshal.SizeOf(typeof(MONITORINFO)); 9 | 10 | public RECT rcMonitor; 11 | 12 | public RECT rcWork; 13 | 14 | public int dwFlags; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/MOUSEEVENTF.cs: -------------------------------------------------------------------------------- 1 | namespace Standard 2 | { 3 | public enum MOUSEEVENTF 4 | { 5 | LEFTDOWN = 2, 6 | LEFTUP = 4 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/MOUSEINPUT.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Standard 4 | { 5 | public struct MOUSEINPUT 6 | { 7 | #pragma warning disable 0649 8 | 9 | public int dx; 10 | 11 | public int dy; 12 | 13 | public int mouseData; 14 | 15 | public int dwFlags; 16 | 17 | public int time; 18 | 19 | public IntPtr dwExtraInfo; 20 | 21 | #pragma warning restore 0649 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/MSGFLT.cs: -------------------------------------------------------------------------------- 1 | namespace Standard 2 | { 3 | public enum MSGFLT 4 | { 5 | RESET, 6 | ALLOW, 7 | DISALLOW 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/MSGFLTINFO.cs: -------------------------------------------------------------------------------- 1 | namespace Standard 2 | { 3 | public enum MSGFLTINFO 4 | { 5 | NONE, 6 | ALREADYALLOWED_FORWND, 7 | ALREADYDISALLOWED_FORWND, 8 | ALLOWED_HIGHER 9 | } 10 | } 11 | 12 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/MessageHandler.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Standard 4 | { 5 | public delegate IntPtr MessageHandler(WM uMsg, IntPtr wParam, IntPtr lParam, out bool handled); 6 | } 7 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/NIF.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Standard 4 | { 5 | [Flags] 6 | public enum NIF : uint 7 | { 8 | MESSAGE = 1U, 9 | ICON = 2U, 10 | TIP = 4U, 11 | STATE = 8U, 12 | INFO = 16U, 13 | GUID = 32U, 14 | REALTIME = 64U, 15 | SHOWTIP = 128U, 16 | XP_MASK = 59U, 17 | VISTA_MASK = 251U 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/NIIF.cs: -------------------------------------------------------------------------------- 1 | namespace Standard 2 | { 3 | public enum NIIF 4 | { 5 | NONE, 6 | INFO, 7 | WARNING, 8 | ERROR, 9 | USER, 10 | NOSOUND = 16, 11 | LARGE_ICON = 32, 12 | NIIF_RESPECT_QUIET_TIME = 128, 13 | XP_ICON_MASK = 15 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/NIM.cs: -------------------------------------------------------------------------------- 1 | namespace Standard 2 | { 3 | public enum NIM : uint 4 | { 5 | ADD, 6 | MODIFY, 7 | DELETE, 8 | SETFOCUS, 9 | SETVERSION 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/NONCLIENTMETRICS.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics.CodeAnalysis; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace Standard 5 | { 6 | public struct NONCLIENTMETRICS 7 | { 8 | [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands")] 9 | public static NONCLIENTMETRICS VistaMetricsStruct 10 | { 11 | get 12 | { 13 | return new NONCLIENTMETRICS 14 | { 15 | cbSize = Marshal.SizeOf(typeof(NONCLIENTMETRICS)) 16 | }; 17 | } 18 | } 19 | 20 | [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands")] 21 | public static NONCLIENTMETRICS XPMetricsStruct 22 | { 23 | get 24 | { 25 | return new NONCLIENTMETRICS 26 | { 27 | cbSize = Marshal.SizeOf(typeof(NONCLIENTMETRICS)) - 4 28 | }; 29 | } 30 | } 31 | 32 | public int cbSize; 33 | 34 | public int iBorderWidth; 35 | 36 | public int iScrollWidth; 37 | 38 | public int iScrollHeight; 39 | 40 | public int iCaptionWidth; 41 | 42 | public int iCaptionHeight; 43 | 44 | public LOGFONT lfCaptionFont; 45 | 46 | public int iSmCaptionWidth; 47 | 48 | public int iSmCaptionHeight; 49 | 50 | public LOGFONT lfSmCaptionFont; 51 | 52 | public int iMenuWidth; 53 | 54 | public int iMenuHeight; 55 | 56 | public LOGFONT lfMenuFont; 57 | 58 | public LOGFONT lfStatusFont; 59 | 60 | public LOGFONT lfMessageFont; 61 | 62 | public int iPaddedBorderWidth; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/NOTIFYICONDATA.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics.CodeAnalysis; 3 | using System.Runtime.InteropServices; 4 | 5 | namespace Standard 6 | { 7 | [SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses")] 8 | [StructLayout(LayoutKind.Sequential)] 9 | public class NOTIFYICONDATA 10 | { 11 | public int cbSize; 12 | 13 | public IntPtr hWnd; 14 | 15 | public int uID; 16 | 17 | public NIF uFlags; 18 | 19 | public int uCallbackMessage; 20 | 21 | public IntPtr hIcon; 22 | 23 | [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)] 24 | public char[] szTip = new char[128]; 25 | 26 | public uint dwState; 27 | 28 | public uint dwStateMask; 29 | 30 | [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] 31 | public char[] szInfo = new char[256]; 32 | 33 | public uint uVersion; 34 | 35 | [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] 36 | public char[] szInfoTitle = new char[64]; 37 | 38 | public uint dwInfoFlags; 39 | 40 | public Guid guidItem; 41 | 42 | private IntPtr hBalloonIcon; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/OLECMDEXECOPT.cs: -------------------------------------------------------------------------------- 1 | namespace Standard 2 | { 3 | public enum OLECMDEXECOPT 4 | { 5 | DODEFAULT, 6 | PROMPTUSER, 7 | DONTPROMPTUSER, 8 | SHOWHELP 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/OLECMDF.cs: -------------------------------------------------------------------------------- 1 | namespace Standard 2 | { 3 | public enum OLECMDF 4 | { 5 | SUPPORTED = 1, 6 | ENABLED, 7 | LATCHED = 4, 8 | NINCHED = 8, 9 | INVISIBLE = 16, 10 | DEFHIDEONCTXTMENU = 32 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/OLECMDID.cs: -------------------------------------------------------------------------------- 1 | namespace Standard 2 | { 3 | public enum OLECMDID 4 | { 5 | OPEN = 1, 6 | NEW, 7 | SAVE, 8 | SAVEAS, 9 | SAVECOPYAS, 10 | PRINT, 11 | PRINTPREVIEW, 12 | PAGESETUP, 13 | SPELL, 14 | PROPERTIES, 15 | CUT, 16 | COPY, 17 | PASTE, 18 | PASTESPECIAL, 19 | UNDO, 20 | REDO, 21 | SELECTALL, 22 | CLEARSELECTION, 23 | ZOOM, 24 | GETZOOMRANGE, 25 | UPDATECOMMANDS, 26 | REFRESH, 27 | STOP, 28 | HIDETOOLBARS, 29 | SETPROGRESSMAX, 30 | SETPROGRESSPOS, 31 | SETPROGRESSTEXT, 32 | SETTITLE, 33 | SETDOWNLOADSTATE, 34 | STOPDOWNLOAD, 35 | ONTOOLBARACTIVATED, 36 | FIND, 37 | DELETE, 38 | HTTPEQUIV, 39 | HTTPEQUIV_DONE, 40 | ENABLE_INTERACTION, 41 | ONUNLOAD, 42 | PROPERTYBAG2, 43 | PREREFRESH, 44 | SHOWSCRIPTERROR, 45 | SHOWMESSAGE, 46 | SHOWFIND, 47 | SHOWPAGESETUP, 48 | SHOWPRINT, 49 | CLOSE, 50 | ALLOWUILESSSAVEAS, 51 | DONTDOWNLOADCSS, 52 | UPDATEPAGESTATUS, 53 | PRINT2, 54 | PRINTPREVIEW2, 55 | SETPRINTTEMPLATE, 56 | GETPRINTTEMPLATE, 57 | PAGEACTIONBLOCKED = 55, 58 | PAGEACTIONUIQUERY, 59 | FOCUSVIEWCONTROLS, 60 | FOCUSVIEWCONTROLSQUERY, 61 | SHOWPAGEACTIONMENU 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/PKEY.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace Standard 5 | { 6 | [StructLayout(LayoutKind.Sequential, Pack = 4)] 7 | public struct PKEY 8 | { 9 | public PKEY(Guid fmtid, uint pid) 10 | { 11 | this._fmtid = fmtid; 12 | this._pid = pid; 13 | } 14 | 15 | private readonly Guid _fmtid; 16 | 17 | private readonly uint _pid; 18 | 19 | public static readonly PKEY Title = new PKEY(new Guid("F29F85E0-4FF9-1068-AB91-08002B27B3D9"), 2U); 20 | 21 | public static readonly PKEY AppUserModel_ID = new PKEY(new Guid("9F4C2855-9F79-4B39-A8D0-E1D42DE1D5F3"), 5U); 22 | 23 | public static readonly PKEY AppUserModel_IsDestListSeparator = new PKEY(new Guid("9F4C2855-9F79-4B39-A8D0-E1D42DE1D5F3"), 6U); 24 | 25 | public static readonly PKEY AppUserModel_RelaunchCommand = new PKEY(new Guid("9F4C2855-9F79-4B39-A8D0-E1D42DE1D5F3"), 2U); 26 | 27 | public static readonly PKEY AppUserModel_RelaunchDisplayNameResource = new PKEY(new Guid("9F4C2855-9F79-4B39-A8D0-E1D42DE1D5F3"), 4U); 28 | 29 | public static readonly PKEY AppUserModel_RelaunchIconResource = new PKEY(new Guid("9F4C2855-9F79-4B39-A8D0-E1D42DE1D5F3"), 3U); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/POINT.cs: -------------------------------------------------------------------------------- 1 | namespace Standard 2 | { 3 | public struct POINT 4 | { 5 | public int x; 6 | 7 | public int y; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/READYSTATE.cs: -------------------------------------------------------------------------------- 1 | namespace Standard 2 | { 3 | public enum READYSTATE 4 | { 5 | UNINITIALIZED, 6 | LOADING, 7 | LOADED, 8 | INTERACTIVE, 9 | COMPLETE 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/RGBQUAD.cs: -------------------------------------------------------------------------------- 1 | namespace Standard 2 | { 3 | public struct RGBQUAD 4 | { 5 | public byte rgbBlue; 6 | 7 | public byte rgbGreen; 8 | 9 | public byte rgbRed; 10 | 11 | public byte rgbReserved; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/RGN.cs: -------------------------------------------------------------------------------- 1 | namespace Standard 2 | { 3 | public enum RGN 4 | { 5 | AND = 1, 6 | OR, 7 | XOR, 8 | DIFF, 9 | COPY 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/RefPOINT.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics.CodeAnalysis; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace Standard 5 | { 6 | [SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses")] 7 | [StructLayout(LayoutKind.Sequential)] 8 | public class RefPOINT 9 | { 10 | public int x; 11 | 12 | public int y; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/SC.cs: -------------------------------------------------------------------------------- 1 | namespace Standard 2 | { 3 | public enum SC 4 | { 5 | SIZE = 61440, 6 | MOVE = 61456, 7 | MINIMIZE = 61472, 8 | MAXIMIZE = 61488, 9 | NEXTWINDOW = 61504, 10 | PREVWINDOW = 61520, 11 | CLOSE = 61536, 12 | VSCROLL = 61552, 13 | HSCROLL = 61568, 14 | MOUSEMENU = 61584, 15 | KEYMENU = 61696, 16 | ARRANGE = 61712, 17 | RESTORE = 61728, 18 | TASKLIST = 61744, 19 | SCREENSAVE = 61760, 20 | HOTKEY = 61776, 21 | DEFAULT = 61792, 22 | MONITORPOWER = 61808, 23 | CONTEXTHELP = 61824, 24 | SEPARATOR = 61455, 25 | F_ISSECURE = 1, 26 | ICON = 61472, 27 | ZOOM = 61488 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/SFGAO.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Standard 4 | { 5 | [Flags] 6 | public enum SFGAO : uint 7 | { 8 | CANCOPY = 1U, 9 | CANMOVE = 2U, 10 | CANLINK = 4U, 11 | STORAGE = 8U, 12 | CANRENAME = 16U, 13 | CANDELETE = 32U, 14 | HASPROPSHEET = 64U, 15 | DROPTARGET = 256U, 16 | CAPABILITYMASK = 375U, 17 | ENCRYPTED = 8192U, 18 | ISSLOW = 16384U, 19 | GHOSTED = 32768U, 20 | LINK = 65536U, 21 | SHARE = 131072U, 22 | READONLY = 262144U, 23 | HIDDEN = 524288U, 24 | DISPLAYATTRMASK = 1032192U, 25 | FILESYSANCESTOR = 268435456U, 26 | FOLDER = 536870912U, 27 | FILESYSTEM = 1073741824U, 28 | HASSUBFOLDER = 2147483648U, 29 | CONTENTSMASK = 2147483648U, 30 | VALIDATE = 16777216U, 31 | REMOVABLE = 33554432U, 32 | COMPRESSED = 67108864U, 33 | BROWSABLE = 134217728U, 34 | NONENUMERATED = 1048576U, 35 | NEWCONTENT = 2097152U, 36 | CANMONIKER = 4194304U, 37 | HASSTORAGE = 4194304U, 38 | STREAM = 4194304U, 39 | STORAGEANCESTOR = 8388608U, 40 | STORAGECAPMASK = 1891958792U, 41 | PKEYSFGAOMASK = 2164539392U 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/SHARD.cs: -------------------------------------------------------------------------------- 1 | namespace Standard 2 | { 3 | public enum SHARD 4 | { 5 | PIDL = 1, 6 | PATHA, 7 | PATHW, 8 | APPIDINFO, 9 | APPIDINFOIDLIST, 10 | LINK, 11 | APPIDINFOLINK 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/SHARDAPPIDINFO.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics.CodeAnalysis; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace Standard 5 | { 6 | [SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses")] 7 | [StructLayout(LayoutKind.Sequential, Pack = 4)] 8 | public class SHARDAPPIDINFO 9 | { 10 | [MarshalAs(UnmanagedType.Interface)] 11 | private object psi; 12 | 13 | [MarshalAs(UnmanagedType.LPWStr)] 14 | private string pszAppID; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/SHARDAPPIDINFOIDLIST.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics.CodeAnalysis; 3 | using System.Runtime.InteropServices; 4 | 5 | namespace Standard 6 | { 7 | [SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses")] 8 | [StructLayout(LayoutKind.Sequential, Pack = 4)] 9 | public class SHARDAPPIDINFOIDLIST 10 | { 11 | private IntPtr pidl; 12 | 13 | [MarshalAs(UnmanagedType.LPWStr)] 14 | private string pszAppID; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/SHARDAPPIDINFOLINK.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics.CodeAnalysis; 3 | using System.Runtime.InteropServices; 4 | 5 | namespace Standard 6 | { 7 | [SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses")] 8 | [StructLayout(LayoutKind.Sequential, Pack = 4)] 9 | public class SHARDAPPIDINFOLINK 10 | { 11 | private IntPtr psl; 12 | 13 | [MarshalAs(UnmanagedType.LPWStr)] 14 | private string pszAppID; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/SHCONTF.cs: -------------------------------------------------------------------------------- 1 | namespace Standard 2 | { 3 | public enum SHCONTF 4 | { 5 | CHECKING_FOR_CHILDREN = 16, 6 | FOLDERS = 32, 7 | NONFOLDERS = 64, 8 | INCLUDEHIDDEN = 128, 9 | INIT_ON_FIRST_NEXT = 256, 10 | NETPRINTERSRCH = 512, 11 | SHAREABLE = 1024, 12 | STORAGE = 2048, 13 | NAVIGATION_ENUM = 4096, 14 | FASTITEMS = 8192, 15 | FLATLIST = 16384, 16 | ENABLE_ASYNC = 32768 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/SHFILEOPSTRUCT.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace Standard 5 | { 6 | [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)] 7 | public struct SHFILEOPSTRUCT 8 | { 9 | public IntPtr hwnd; 10 | 11 | [MarshalAs(UnmanagedType.U4)] 12 | public FO wFunc; 13 | 14 | public string pFrom; 15 | 16 | public string pTo; 17 | 18 | [MarshalAs(UnmanagedType.U2)] 19 | public FOF fFlags; 20 | 21 | [MarshalAs(UnmanagedType.Bool)] 22 | public int fAnyOperationsAborted; 23 | 24 | public IntPtr hNameMappings; 25 | 26 | public string lpszProgressTitle; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/SHGDN.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Standard 4 | { 5 | [Flags] 6 | public enum SHGDN 7 | { 8 | SHGDN_NORMAL = 0, 9 | SHGDN_INFOLDER = 1, 10 | SHGDN_FOREDITING = 4096, 11 | SHGDN_FORADDRESSBAR = 16384, 12 | SHGDN_FORPARSING = 32768 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/SIATTRIBFLAGS.cs: -------------------------------------------------------------------------------- 1 | namespace Standard 2 | { 3 | public enum SIATTRIBFLAGS 4 | { 5 | AND = 1, 6 | OR, 7 | APPCOMPAT 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/SICHINT.cs: -------------------------------------------------------------------------------- 1 | namespace Standard 2 | { 3 | public enum SICHINT : uint 4 | { 5 | DISPLAY, 6 | ALLFIELDS = 2147483648U, 7 | CANONICAL = 268435456U, 8 | TEST_FILESYSPATH_IF_NOT_EQUAL = 536870912U 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/SIGDN.cs: -------------------------------------------------------------------------------- 1 | namespace Standard 2 | { 3 | public enum SIGDN : uint 4 | { 5 | NORMALDISPLAY, 6 | PARENTRELATIVEPARSING = 2147581953U, 7 | DESKTOPABSOLUTEPARSING = 2147647488U, 8 | PARENTRELATIVEEDITING = 2147684353U, 9 | DESKTOPABSOLUTEEDITING = 2147794944U, 10 | FILESYSPATH = 2147844096U, 11 | URL = 2147909632U, 12 | PARENTRELATIVEFORADDRESSBAR = 2147991553U, 13 | PARENTRELATIVE = 2148007937U 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/SIZE.cs: -------------------------------------------------------------------------------- 1 | namespace Standard 2 | { 3 | public struct SIZE 4 | { 5 | public int cx; 6 | 7 | public int cy; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/SLGP.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Standard 4 | { 5 | [Flags] 6 | public enum SLGP 7 | { 8 | SHORTPATH = 1, 9 | UNCPRIORITY = 2, 10 | RAWPATH = 4 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/SM.cs: -------------------------------------------------------------------------------- 1 | namespace Standard 2 | { 3 | public enum SM 4 | { 5 | CXSCREEN, 6 | CYSCREEN, 7 | CXVSCROLL, 8 | CYHSCROLL, 9 | CYCAPTION, 10 | CXBORDER, 11 | CYBORDER, 12 | CXFIXEDFRAME, 13 | CYFIXEDFRAME, 14 | CYVTHUMB, 15 | CXHTHUMB, 16 | CXICON, 17 | CYICON, 18 | CXCURSOR, 19 | CYCURSOR, 20 | CYMENU, 21 | CXFULLSCREEN, 22 | CYFULLSCREEN, 23 | CYKANJIWINDOW, 24 | MOUSEPRESENT, 25 | CYVSCROLL, 26 | CXHSCROLL, 27 | DEBUG, 28 | SWAPBUTTON, 29 | CXMIN = 28, 30 | CYMIN, 31 | CXSIZE, 32 | CYSIZE, 33 | CXFRAME, 34 | CXSIZEFRAME = 32, 35 | CYFRAME, 36 | CYSIZEFRAME = 33, 37 | CXMINTRACK, 38 | CYMINTRACK, 39 | CXDOUBLECLK, 40 | CYDOUBLECLK, 41 | CXICONSPACING, 42 | CYICONSPACING, 43 | MENUDROPALIGNMENT, 44 | PENWINDOWS, 45 | DBCSENABLED, 46 | CMOUSEBUTTONS, 47 | SECURE, 48 | CXEDGE, 49 | CYEDGE, 50 | CXMINSPACING, 51 | CYMINSPACING, 52 | CXSMICON, 53 | CYSMICON, 54 | CYSMCAPTION, 55 | CXSMSIZE, 56 | CYSMSIZE, 57 | CXMENUSIZE, 58 | CYMENUSIZE, 59 | ARRANGE, 60 | CXMINIMIZED, 61 | CYMINIMIZED, 62 | CXMAXTRACK, 63 | CYMAXTRACK, 64 | CXMAXIMIZED, 65 | CYMAXIMIZED, 66 | NETWORK, 67 | CLEANBOOT = 67, 68 | CXDRAG, 69 | CYDRAG, 70 | SHOWSOUNDS, 71 | CXMENUCHECK, 72 | CYMENUCHECK, 73 | SLOWMACHINE, 74 | MIDEASTENABLED, 75 | MOUSEWHEELPRESENT, 76 | XVIRTUALSCREEN, 77 | YVIRTUALSCREEN, 78 | CXVIRTUALSCREEN, 79 | CYVIRTUALSCREEN, 80 | CMONITORS, 81 | SAMEDISPLAYFORMAT, 82 | IMMENABLED, 83 | CXFOCUSBORDER, 84 | CYFOCUSBORDER, 85 | TABLETPC = 86, 86 | MEDIACENTER, 87 | REMOTESESSION = 4096, 88 | REMOTECONTROL = 8193 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/SPIF.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Standard 4 | { 5 | [Flags] 6 | public enum SPIF 7 | { 8 | None = 0, 9 | UPDATEINIFILE = 1, 10 | SENDCHANGE = 2, 11 | SENDWININICHANGE = 2 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/STATE_SYSTEM.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Standard 4 | { 5 | [Flags] 6 | public enum STATE_SYSTEM 7 | { 8 | UNAVAILABLE = 1, 9 | SELECTED = 2, 10 | FOCUSED = 4, 11 | PRESSED = 8, 12 | CHECKED = 16, 13 | MIXED = 32, 14 | INDETERMINATE = 32, 15 | READONLY = 64, 16 | HOTTRACKED = 128, 17 | DEFAULT = 256, 18 | EXPANDED = 512, 19 | COLLAPSED = 1024, 20 | BUSY = 2048, 21 | FLOATING = 4096, 22 | MARQUEED = 8192, 23 | ANIMATED = 16384, 24 | INVISIBLE = 32768, 25 | OFFSCREEN = 65536, 26 | SIZEABLE = 131072, 27 | MOVEABLE = 262144, 28 | SELFVOICING = 524288, 29 | FOCUSABLE = 1048576, 30 | SELECTABLE = 2097152, 31 | LINKED = 4194304, 32 | TRAVERSED = 8388608, 33 | MULTISELECTABLE = 16777216, 34 | EXTSELECTABLE = 33554432, 35 | ALERT_LOW = 67108864, 36 | ALERT_MEDIUM = 134217728, 37 | ALERT_HIGH = 268435456, 38 | PROTECTED = 536870912, 39 | VALID = 1073741823 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/STPF.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Standard 4 | { 5 | [Flags] 6 | public enum STPF 7 | { 8 | NONE = 0, 9 | USEAPPTHUMBNAILALWAYS = 1, 10 | USEAPPTHUMBNAILWHENACTIVE = 2, 11 | USEAPPPEEKALWAYS = 4, 12 | USEAPPPEEKWHENACTIVE = 8 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/STR_GPS.cs: -------------------------------------------------------------------------------- 1 | namespace Standard 2 | { 3 | public static class STR_GPS 4 | { 5 | public const string HANDLERPROPERTIESONLY = "GPS_HANDLERPROPERTIESONLY"; 6 | 7 | public const string FASTPROPERTIESONLY = "GPS_FASTPROPERTIESONLY"; 8 | 9 | public const string OPENSLOWITEM = "GPS_OPENSLOWITEM"; 10 | 11 | public const string DELAYCREATION = "GPS_DELAYCREATION"; 12 | 13 | public const string BESTEFFORT = "GPS_BESTEFFORT"; 14 | 15 | public const string NO_OPLOCK = "GPS_NO_OPLOCK"; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/SW.cs: -------------------------------------------------------------------------------- 1 | namespace Standard 2 | { 3 | public enum SW 4 | { 5 | HIDE, 6 | SHOWNORMAL, 7 | NORMAL = 1, 8 | SHOWMINIMIZED, 9 | SHOWMAXIMIZED, 10 | MAXIMIZE = 3, 11 | SHOWNOACTIVATE, 12 | SHOW, 13 | MINIMIZE, 14 | SHOWMINNOACTIVE, 15 | SHOWNA, 16 | RESTORE, 17 | SHOWDEFAULT, 18 | FORCEMINIMIZE 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/SWP.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Standard 4 | { 5 | [Flags] 6 | public enum SWP 7 | { 8 | ASYNCWINDOWPOS = 16384, 9 | DEFERERASE = 8192, 10 | DRAWFRAME = 32, 11 | FRAMECHANGED = 32, 12 | HIDEWINDOW = 128, 13 | NOACTIVATE = 16, 14 | NOCOPYBITS = 256, 15 | NOMOVE = 2, 16 | NOOWNERZORDER = 512, 17 | NOREDRAW = 8, 18 | NOREPOSITION = 512, 19 | NOSENDCHANGING = 1024, 20 | NOSIZE = 1, 21 | NOZORDER = 4, 22 | SHOWWINDOW = 64 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/SafeConnectionPointCookie.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Win32.SafeHandles; 2 | using System; 3 | using System.Diagnostics.CodeAnalysis; 4 | using System.Runtime.ConstrainedExecution; 5 | using System.Runtime.InteropServices.ComTypes; 6 | 7 | namespace Standard 8 | { 9 | public sealed class SafeConnectionPointCookie : SafeHandleZeroOrMinusOneIsInvalid 10 | { 11 | [SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "IConnectionPoint")] 12 | [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 13 | public SafeConnectionPointCookie(IConnectionPointContainer target, object sink, Guid eventId) : base(true) 14 | { 15 | Verify.IsNotNull(target, "target"); 16 | Verify.IsNotNull(sink, "sink"); 17 | Verify.IsNotDefault(eventId, "eventId"); 18 | this.handle = IntPtr.Zero; 19 | IConnectionPoint connectionPoint = null; 20 | try 21 | { 22 | target.FindConnectionPoint(ref eventId, out connectionPoint); 23 | int num; 24 | connectionPoint.Advise(sink, out num); 25 | if (num == 0) 26 | { 27 | throw new InvalidOperationException("IConnectionPoint::Advise returned an invalid cookie."); 28 | } 29 | this.handle = new IntPtr(num); 30 | this._cp = connectionPoint; 31 | connectionPoint = null; 32 | } 33 | finally 34 | { 35 | Utility.SafeRelease(ref connectionPoint); 36 | } 37 | } 38 | 39 | [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 40 | public void Disconnect() 41 | { 42 | this.ReleaseHandle(); 43 | } 44 | 45 | [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] 46 | #pragma warning disable SYSLIB0004 // Type or member is obsolete 47 | [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)] 48 | #pragma warning restore SYSLIB0004 // Type or member is obsolete 49 | protected override bool ReleaseHandle() 50 | { 51 | bool result; 52 | try 53 | { 54 | if (!this.IsInvalid) 55 | { 56 | int dwCookie = this.handle.ToInt32(); 57 | this.handle = IntPtr.Zero; 58 | try 59 | { 60 | this._cp.Unadvise(dwCookie); 61 | } 62 | finally 63 | { 64 | Utility.SafeRelease(ref this._cp); 65 | } 66 | } 67 | result = true; 68 | } 69 | catch 70 | { 71 | result = false; 72 | } 73 | return result; 74 | } 75 | 76 | private IConnectionPoint _cp; 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/SafeFindHandle.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Win32.SafeHandles; 2 | using System.Security.Permissions; 3 | 4 | namespace Standard 5 | { 6 | public sealed class SafeFindHandle : SafeHandleZeroOrMinusOneIsInvalid 7 | { 8 | #pragma warning disable SYSLIB0003 // Type or member is obsolete 9 | [SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode = true)] 10 | #pragma warning restore SYSLIB0003 // Type or member is obsolete 11 | private SafeFindHandle() : base(true) 12 | { 13 | } 14 | 15 | protected override bool ReleaseHandle() 16 | { 17 | return NativeMethods.FindClose(this.handle); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/SafeGdiplusStartupToken.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Win32.SafeHandles; 2 | using System; 3 | using System.Diagnostics.CodeAnalysis; 4 | using System.Runtime.ConstrainedExecution; 5 | 6 | namespace Standard 7 | { 8 | public sealed class SafeGdiplusStartupToken : SafeHandleZeroOrMinusOneIsInvalid 9 | { 10 | private SafeGdiplusStartupToken() : base(true) 11 | { 12 | } 13 | 14 | #pragma warning disable SYSLIB0004 // Type or member is obsolete 15 | [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)] 16 | #pragma warning restore SYSLIB0004 // Type or member is obsolete 17 | protected override bool ReleaseHandle() 18 | { 19 | Status status = NativeMethods.GdiplusShutdown(this.handle); 20 | return status == Status.Ok; 21 | } 22 | 23 | [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 24 | [SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope")] 25 | [SuppressMessage("Microsoft.Usage", "CA2201:DoNotRaiseReservedExceptionTypes")] 26 | public static SafeGdiplusStartupToken Startup() 27 | { 28 | SafeGdiplusStartupToken safeGdiplusStartupToken = new SafeGdiplusStartupToken(); 29 | IntPtr handle; 30 | StartupOutput startupOutput; 31 | if (NativeMethods.GdiplusStartup(out handle, new StartupInput(), out startupOutput) == Status.Ok) 32 | { 33 | safeGdiplusStartupToken.handle = handle; 34 | return safeGdiplusStartupToken; 35 | } 36 | safeGdiplusStartupToken.Dispose(); 37 | throw new Exception("Unable to initialize GDI+"); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/SafeHBITMAP.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Win32.SafeHandles; 2 | using System.Runtime.ConstrainedExecution; 3 | 4 | namespace Standard 5 | { 6 | public sealed class SafeHBITMAP : SafeHandleZeroOrMinusOneIsInvalid 7 | { 8 | private SafeHBITMAP() : base(true) 9 | { 10 | } 11 | 12 | #pragma warning disable SYSLIB0004 // Type or member is obsolete 13 | [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)] 14 | #pragma warning restore SYSLIB0004 // Type or member is obsolete 15 | protected override bool ReleaseHandle() 16 | { 17 | return NativeMethods.DeleteObject(this.handle); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/StartupInput.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace Standard 5 | { 6 | [StructLayout(LayoutKind.Sequential)] 7 | public class StartupInput 8 | { 9 | public int GdiplusVersion = 1; 10 | 11 | public IntPtr DebugEventCallback; 12 | 13 | public bool SuppressBackgroundThread; 14 | 15 | public bool SuppressExternalCodecs; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/StartupOutput.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Standard 4 | { 5 | public struct StartupOutput 6 | { 7 | public IntPtr hook; 8 | 9 | public IntPtr unhook; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/Status.cs: -------------------------------------------------------------------------------- 1 | namespace Standard 2 | { 3 | public enum Status 4 | { 5 | Ok, 6 | GenericError, 7 | InvalidParameter, 8 | OutOfMemory, 9 | ObjectBusy, 10 | InsufficientBuffer, 11 | NotImplemented, 12 | Win32Error, 13 | WrongState, 14 | Aborted, 15 | FileNotFound, 16 | ValueOverflow, 17 | AccessDenied, 18 | UnknownImageFormat, 19 | FontFamilyNotFound, 20 | FontStyleNotFound, 21 | NotTrueTypeFont, 22 | UnsupportedGdiplusVersion, 23 | GdiplusNotInitialized, 24 | PropertyNotFound, 25 | PropertyNotSupported, 26 | ProfileNotFound 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/StockObject.cs: -------------------------------------------------------------------------------- 1 | namespace Standard 2 | { 3 | public enum StockObject 4 | { 5 | WHITE_BRUSH, 6 | LTGRAY_BRUSH, 7 | GRAY_BRUSH, 8 | DKGRAY_BRUSH, 9 | BLACK_BRUSH, 10 | NULL_BRUSH, 11 | HOLLOW_BRUSH = 5, 12 | WHITE_PEN, 13 | BLACK_PEN, 14 | NULL_PEN, 15 | SYSTEM_FONT = 13, 16 | DEFAULT_PALETTE = 15 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/TBPF.cs: -------------------------------------------------------------------------------- 1 | namespace Standard 2 | { 3 | public enum TBPF 4 | { 5 | NOPROGRESS, 6 | INDETERMINATE, 7 | NORMAL, 8 | ERROR = 4, 9 | PAUSED = 8 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/THB.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Standard 4 | { 5 | [Flags] 6 | public enum THB : uint 7 | { 8 | BITMAP = 1U, 9 | ICON = 2U, 10 | TOOLTIP = 4U, 11 | FLAGS = 8U 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/THBF.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Standard 4 | { 5 | [Flags] 6 | public enum THBF : uint 7 | { 8 | ENABLED = 0U, 9 | DISABLED = 1U, 10 | DISMISSONCLICK = 2U, 11 | NOBACKGROUND = 4U, 12 | HIDDEN = 8U, 13 | NONINTERACTIVE = 16U 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/THUMBBUTTON.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace Standard 5 | { 6 | [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 8)] 7 | public struct THUMBBUTTON 8 | { 9 | public const int THBN_CLICKED = 6144; 10 | 11 | public THB dwMask; 12 | 13 | public uint iId; 14 | 15 | public uint iBitmap; 16 | 17 | public IntPtr hIcon; 18 | 19 | [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)] 20 | public string szTip; 21 | 22 | public THBF dwFlags; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/TITLEBARINFO.cs: -------------------------------------------------------------------------------- 1 | namespace Standard 2 | { 3 | // CS0649.cs 4 | // compile with: /W:4 5 | public struct TITLEBARINFO 6 | { 7 | public int cbSize; 8 | 9 | public RECT rcTitleBar; 10 | 11 | public STATE_SYSTEM rgstate_TitleBar; 12 | 13 | public STATE_SYSTEM rgstate_Reserved; 14 | 15 | public STATE_SYSTEM rgstate_MinimizeButton; 16 | 17 | public STATE_SYSTEM rgstate_MaximizeButton; 18 | 19 | public STATE_SYSTEM rgstate_HelpButton; 20 | 21 | public STATE_SYSTEM rgstate_CloseButton; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/TITLEBARINFOEX.cs: -------------------------------------------------------------------------------- 1 | namespace Standard 2 | { 3 | public struct TITLEBARINFOEX 4 | { 5 | public int cbSize; 6 | 7 | public RECT rcTitleBar; 8 | 9 | public STATE_SYSTEM rgstate_TitleBar; 10 | 11 | public STATE_SYSTEM rgstate_Reserved; 12 | 13 | public STATE_SYSTEM rgstate_MinimizeButton; 14 | 15 | public STATE_SYSTEM rgstate_MaximizeButton; 16 | 17 | public STATE_SYSTEM rgstate_HelpButton; 18 | 19 | public STATE_SYSTEM rgstate_CloseButton; 20 | 21 | public RECT rgrect_TitleBar; 22 | 23 | public RECT rgrect_Reserved; 24 | 25 | public RECT rgrect_MinimizeButton; 26 | 27 | public RECT rgrect_MaximizeButton; 28 | 29 | public RECT rgrect_HelpButton; 30 | 31 | public RECT rgrect_CloseButton; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/ULW.cs: -------------------------------------------------------------------------------- 1 | namespace Standard 2 | { 3 | public enum ULW 4 | { 5 | ALPHA = 2, 6 | COLORKEY = 1, 7 | OPAQUE = 4 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/UNSIGNED_RATIO.cs: -------------------------------------------------------------------------------- 1 | namespace Standard 2 | { 3 | public struct UNSIGNED_RATIO 4 | { 5 | public uint uiNumerator; 6 | 7 | public uint uiDenominator; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/WIN32_FIND_DATAW.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics.CodeAnalysis; 2 | using System.IO; 3 | using System.Runtime.InteropServices; 4 | 5 | namespace Standard 6 | { 7 | [BestFitMapping(false)] 8 | [SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses")] 9 | [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] 10 | public class WIN32_FIND_DATAW 11 | { 12 | public FileAttributes dwFileAttributes; 13 | 14 | public System.Runtime.InteropServices.ComTypes.FILETIME ftCreationTime; 15 | 16 | public System.Runtime.InteropServices.ComTypes.FILETIME ftLastAccessTime; 17 | 18 | public System.Runtime.InteropServices.ComTypes.FILETIME ftLastWriteTime; 19 | 20 | public int nFileSizeHigh; 21 | 22 | public int nFileSizeLow; 23 | 24 | public int dwReserved0; 25 | 26 | public int dwReserved1; 27 | 28 | [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)] 29 | public string cFileName; 30 | 31 | [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 14)] 32 | public string cAlternateFileName; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/WINDOWPLACEMENT.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace Standard 4 | { 5 | [StructLayout(LayoutKind.Sequential)] 6 | public class WINDOWPLACEMENT 7 | { 8 | public int length = Marshal.SizeOf(typeof(WINDOWPLACEMENT)); 9 | 10 | public int flags; 11 | 12 | public SW showCmd; 13 | 14 | public POINT ptMinPosition; 15 | 16 | public POINT ptMaxPosition; 17 | 18 | public RECT rcNormalPosition; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/WINDOWPOS.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Standard 4 | { 5 | public struct WINDOWPOS 6 | { 7 | public IntPtr hwnd; 8 | 9 | public IntPtr hwndInsertAfter; 10 | 11 | public int x; 12 | 13 | public int y; 14 | 15 | public int cx; 16 | 17 | public int cy; 18 | 19 | public int flags; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/WINDOWTHEMEATTRIBUTETYPE.cs: -------------------------------------------------------------------------------- 1 | namespace Standard 2 | { 3 | public enum WINDOWTHEMEATTRIBUTETYPE : uint 4 | { 5 | WTA_NONCLIENT = 1U 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/WNDCLASSEX.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace Standard 5 | { 6 | [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] 7 | public struct WNDCLASSEX 8 | { 9 | public int cbSize; 10 | 11 | public CS style; 12 | 13 | public WndProc lpfnWndProc; 14 | 15 | public int cbClsExtra; 16 | 17 | public int cbWndExtra; 18 | 19 | public IntPtr hInstance; 20 | 21 | public IntPtr hIcon; 22 | 23 | public IntPtr hCursor; 24 | 25 | public IntPtr hbrBackground; 26 | 27 | [MarshalAs(UnmanagedType.LPWStr)] 28 | public string lpszMenuName; 29 | 30 | [MarshalAs(UnmanagedType.LPWStr)] 31 | public string lpszClassName; 32 | 33 | public IntPtr hIconSm; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/WS.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Standard 4 | { 5 | [Flags] 6 | public enum WS : uint 7 | { 8 | OVERLAPPED = 0U, 9 | POPUP = 2147483648U, 10 | CHILD = 1073741824U, 11 | MINIMIZE = 536870912U, 12 | VISIBLE = 268435456U, 13 | DISABLED = 134217728U, 14 | CLIPSIBLINGS = 67108864U, 15 | CLIPCHILDREN = 33554432U, 16 | MAXIMIZE = 16777216U, 17 | BORDER = 8388608U, 18 | DLGFRAME = 4194304U, 19 | VSCROLL = 2097152U, 20 | HSCROLL = 1048576U, 21 | SYSMENU = 524288U, 22 | THICKFRAME = 262144U, 23 | GROUP = 131072U, 24 | TABSTOP = 65536U, 25 | MINIMIZEBOX = 131072U, 26 | MAXIMIZEBOX = 65536U, 27 | CAPTION = 12582912U, 28 | TILED = 0U, 29 | ICONIC = 536870912U, 30 | SIZEBOX = 262144U, 31 | TILEDWINDOW = 13565952U, 32 | OVERLAPPEDWINDOW = 13565952U, 33 | POPUPWINDOW = 2156396544U, 34 | CHILDWINDOW = 1073741824U 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/WS_EX.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Standard 4 | { 5 | [Flags] 6 | public enum WS_EX : uint 7 | { 8 | None = 0U, 9 | DLGMODALFRAME = 1U, 10 | NOPARENTNOTIFY = 4U, 11 | TOPMOST = 8U, 12 | ACCEPTFILES = 16U, 13 | TRANSPARENT = 32U, 14 | MDICHILD = 64U, 15 | TOOLWINDOW = 128U, 16 | WINDOWEDGE = 256U, 17 | CLIENTEDGE = 512U, 18 | CONTEXTHELP = 1024U, 19 | RIGHT = 4096U, 20 | LEFT = 0U, 21 | RTLREADING = 8192U, 22 | LTRREADING = 0U, 23 | LEFTSCROLLBAR = 16384U, 24 | RIGHTSCROLLBAR = 0U, 25 | CONTROLPARENT = 65536U, 26 | STATICEDGE = 131072U, 27 | APPWINDOW = 262144U, 28 | LAYERED = 524288U, 29 | NOINHERITLAYOUT = 1048576U, 30 | LAYOUTRTL = 4194304U, 31 | COMPOSITED = 33554432U, 32 | NOACTIVATE = 134217728U, 33 | OVERLAPPEDWINDOW = 768U, 34 | PALETTEWINDOW = 392U 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/WTA_OPTIONS.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics.CodeAnalysis; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace Standard 5 | { 6 | [StructLayout(LayoutKind.Explicit)] 7 | public struct WTA_OPTIONS 8 | { 9 | public const uint Size = 8U; 10 | 11 | [SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Justification = "Used by native code.")] 12 | [FieldOffset(0)] 13 | public WTNCA dwFlags; 14 | 15 | [SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Justification = "Used by native code.")] 16 | [FieldOffset(4)] 17 | public WTNCA dwMask; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/WTNCA.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Standard 4 | { 5 | [Flags] 6 | public enum WTNCA : uint 7 | { 8 | NODRAWCAPTION = 1U, 9 | NODRAWICON = 2U, 10 | NOSYSMENU = 4U, 11 | NOMIRRORHELP = 8U, 12 | VALIDBITS = 15U 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/WVR.cs: -------------------------------------------------------------------------------- 1 | namespace Standard 2 | { 3 | public enum WVR 4 | { 5 | ALIGNTOP = 16, 6 | ALIGNLEFT = 32, 7 | ALIGNBOTTOM = 64, 8 | ALIGNRIGHT = 128, 9 | HREDRAW = 256, 10 | VREDRAW = 512, 11 | VALIDRECTS = 1024, 12 | REDRAW = 768 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/Win32Value.cs: -------------------------------------------------------------------------------- 1 | namespace Standard 2 | { 3 | public static class Win32Value 4 | { 5 | public const uint MAX_PATH = 260U; 6 | 7 | public const uint INFOTIPSIZE = 1024U; 8 | 9 | public const uint TRUE = 1U; 10 | 11 | public const uint FALSE = 0U; 12 | 13 | public const uint sizeof_WCHAR = 2U; 14 | 15 | public const uint sizeof_CHAR = 1U; 16 | 17 | public const uint sizeof_BOOL = 4U; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/WndProc.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Standard 4 | { 5 | public delegate IntPtr WndProc(IntPtr hwnd, WM uMsg, IntPtr wParam, IntPtr lParam); 6 | } 7 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/Standard/WndProcHook.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Standard 4 | { 5 | public delegate IntPtr WndProcHook(IntPtr hwnd, WM uMsg, IntPtr wParam, IntPtr lParam, ref bool handled); 6 | } 7 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/TaskbarItemProgressState.cs: -------------------------------------------------------------------------------- 1 | namespace Microsoft.Windows.Shell 2 | { 3 | public enum TaskbarItemProgressState 4 | { 5 | None, 6 | Indeterminate, 7 | Normal, 8 | Error, 9 | Paused 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/Microsoft.Windows.Shell/ThumbButtonInfoCollection.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | 3 | namespace Microsoft.Windows.Shell 4 | { 5 | public class ThumbButtonInfoCollection : FreezableCollection 6 | { 7 | protected override Freezable CreateInstanceCore() 8 | { 9 | return new ThumbButtonInfoCollection(); 10 | } 11 | 12 | internal static ThumbButtonInfoCollection Empty 13 | { 14 | get 15 | { 16 | if (ThumbButtonInfoCollection.s_empty == null) 17 | { 18 | ThumbButtonInfoCollection thumbButtonInfoCollection = new ThumbButtonInfoCollection(); 19 | thumbButtonInfoCollection.Freeze(); 20 | ThumbButtonInfoCollection.s_empty = thumbButtonInfoCollection; 21 | } 22 | return ThumbButtonInfoCollection.s_empty; 23 | } 24 | } 25 | 26 | private static ThumbButtonInfoCollection s_empty; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Net40/Effects/GrayscaleEffect.ps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WPFDevelopersOrg/WPFDevelopers.Minimal/a7e1077236302d4cbd0537d2a9551b8c8f10baee/src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Net40/Effects/GrayscaleEffect.ps -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Net40/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | using System.Windows.Markup; 3 | 4 | [assembly: ThemeInfo( 5 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located 6 | //(used if a resource is not found in the page, 7 | // or application resource dictionaries) 8 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located 9 | //(used if a resource is not found in the page, 10 | // app, or any theme specific resource dictionaries) 11 | )] 12 | [assembly: XmlnsPrefix("https://github.com/WPFDevelopersOrg/WPFDevelopers.Minimal", "WPFDevelopers.Minimal")] 13 | [assembly: XmlnsDefinition("https://github.com/WPFDevelopersOrg/WPFDevelopers.Minimal", "WPFDevelopers.Minimal")] 14 | [assembly: XmlnsDefinition("https://github.com/WPFDevelopersOrg/WPFDevelopers.Minimal", "WPFDevelopers.Minimal.Converts")] 15 | [assembly: XmlnsDefinition("https://github.com/WPFDevelopersOrg/WPFDevelopers.Minimal", "WPFDevelopers.Minimal.Helpers")] 16 | [assembly: XmlnsDefinition("https://github.com/WPFDevelopersOrg/WPFDevelopers.Minimal", "WPFDevelopers.Minimal.Net40")] 17 | [assembly: XmlnsDefinition("https://github.com/WPFDevelopersOrg/WPFDevelopers.Minimal", "WPFDevelopers.Minimal.Controls")] 18 | [assembly: XmlnsDefinition("https://github.com/WPFDevelopersOrg/WPFDevelopers.Minimal", "Microsoft.Windows.Shell")] 19 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Net40/WPFDevelopers.Minimal.Net40.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | WPFDevelopers.Minimal 4 | WPFDevelopers.Minimal 5 | net40 6 | true 7 | WPFDevelopers.Minimal 8 | true 9 | snupkg 10 | Copyright © WPFDevelopersOrg 2022 11 | 1.0.0.1 12 | 1.0.0.1 13 | 1.0.0.1 14 | https://github.com/WPFDevelopersOrg/WPFDevelopers.Minimal 15 | true 16 | Debug;Release;.Net40;.Net45x 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Net40/WPFDevelopers.Minimal.Net40.csproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | ProjectFiles 5 | 6 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Net45x/Effects/GrayscaleEffect.ps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WPFDevelopersOrg/WPFDevelopers.Minimal/a7e1077236302d4cbd0537d2a9551b8c8f10baee/src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Net45x/Effects/GrayscaleEffect.ps -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Net45x/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 |  2 | using System.Windows.Markup; 3 | 4 | [assembly: XmlnsPrefix("https://github.com/WPFDevelopersOrg/WPFDevelopers.Minimal", "WPFDevelopers.Minimal")] 5 | [assembly: XmlnsDefinition("https://github.com/WPFDevelopersOrg/WPFDevelopers.Minimal", "WPFDevelopers.Minimal")] 6 | [assembly: XmlnsDefinition("https://github.com/WPFDevelopersOrg/WPFDevelopers.Minimal", "WPFDevelopers.Minimal.Helpers")] 7 | [assembly: XmlnsDefinition("https://github.com/WPFDevelopersOrg/WPFDevelopers.Minimal", "WPFDevelopers.Minimal.Net45x")] 8 | [assembly: XmlnsDefinition("https://github.com/WPFDevelopersOrg/WPFDevelopers.Minimal", "WPFDevelopers.Minimal.Controls")] -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Net45x/WPFDevelopers.Minimal.Net45x.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | WPFDevelopers.Minimal 4 | WPFDevelopers.Minimal 5 | net45;net46;net47;net48;net5.0-windows;net6.0-windows;net7.0-windows;net8.0-windows;netcoreapp3.0 6 | true 7 | WPFDevelopers.Minimal 8 | true 9 | snupkg 10 | Copyright © WPFDevelopersOrg 2022 11 | 1.0.0.1 12 | 1.0.0.1 13 | 1.0.0.1 14 | https://github.com/WPFDevelopersOrg/WPFDevelopers.Minimal 15 | true 16 | Debug;Release;.Net40;.Net45x 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Net45x/WPFDevelopers.Minimal.Net45x.csproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | true 5 | 6 | 7 | 8 | Designer 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Sample.Net40/Resources/WPFDevelopers.Minimal.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WPFDevelopersOrg/WPFDevelopers.Minimal/a7e1077236302d4cbd0537d2a9551b8c8f10baee/src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Sample.Net40/Resources/WPFDevelopers.Minimal.ico -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Sample.Net40/WPFDevelopers.Minimal.Sample.Net40.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | WinExe 5 | WPFDevelopers.Minimal.Sample 6 | WPFDevelopers.Minimal.Sample 7 | net40 8 | true 9 | 10 | WPFDevelopers.Minimal.ico 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Sample.Net40/WPFDevelopers.Minimal.Sample.Net40.csproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Sample.Net40/WPFDevelopers.Minimal.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WPFDevelopersOrg/WPFDevelopers.Minimal/a7e1077236302d4cbd0537d2a9551b8c8f10baee/src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Sample.Net40/WPFDevelopers.Minimal.ico -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Sample.Net45x/Resources/WPFDevelopers.Minimal.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WPFDevelopersOrg/WPFDevelopers.Minimal/a7e1077236302d4cbd0537d2a9551b8c8f10baee/src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Sample.Net45x/Resources/WPFDevelopers.Minimal.ico -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Sample.Net45x/WPFDevelopers.Minimal.Sample.Net45x.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | WinExe 5 | WPFDevelopers.Minimal.Sample 6 | WPFDevelopers.Minimal.Sample 7 | net45;net46;net47;net48;net5.0-windows;net6.0-windows;net7.0-windows;net8.0-windows;netcoreapp3.0 8 | true 9 | WPFDevelopers.Minimal.ico 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Sample.Net45x/WPFDevelopers.Minimal.Sample.Net45x.csproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Sample.Net45x/WPFDevelopers.Minimal.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WPFDevelopersOrg/WPFDevelopers.Minimal/a7e1077236302d4cbd0537d2a9551b8c8f10baee/src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Sample.Net45x/WPFDevelopers.Minimal.ico -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Sample.Shared/App.xaml: -------------------------------------------------------------------------------- 1 |  8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Sample.Shared/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | 3 | namespace WPFDevelopers.Minimal.Sample 4 | { 5 | /// 6 | /// App.xaml 的交互逻辑 7 | /// 8 | public partial class App : Application 9 | { 10 | public static double Wdith 11 | { 12 | get { return SystemParameters.WorkArea.Width / 1.5; } 13 | } 14 | public static double Height 15 | { 16 | get { return SystemParameters.WorkArea.Height / 1.5; } 17 | } 18 | public static Window CurrentMainWindow 19 | { 20 | get { return Current.MainWindow; } 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Sample.Shared/Converts/StateConvert.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Data; 3 | using System.Windows.Media; 4 | 5 | namespace WPFDevelopers.Minimal.Sample.Converts 6 | { 7 | public class StateConvert : IValueConverter 8 | { 9 | public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo cultureInfo) 10 | { 11 | var color = Brushes.Green; 12 | if (value != null) 13 | { 14 | var state = int.Parse(value.ToString()); 15 | switch (state) 16 | { 17 | case 0: 18 | color = Brushes.Green; 19 | break; 20 | case 1: 21 | color = Brushes.Orange; 22 | break; 23 | case 2: 24 | color = Brushes.Red; 25 | break; 26 | } 27 | } 28 | 29 | return color; 30 | } 31 | public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo cultureInfo) 32 | { 33 | throw new NotImplementedException(); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Sample.Shared/ExampleViews/AboutWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using System.Windows; 4 | using System.Windows.Navigation; 5 | 6 | namespace WPFDevelopers.Minimal.Sample.ExampleViews 7 | { 8 | /// 9 | /// Window1.xaml 的交互逻辑 10 | /// 11 | public partial class AboutWindow 12 | { 13 | public AboutWindow() 14 | { 15 | InitializeComponent(); 16 | 17 | } 18 | private void GithubHyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e) 19 | { 20 | Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri)); 21 | e.Handled = true; 22 | } 23 | 24 | private void GiteeHyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e) 25 | { 26 | Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri)); 27 | e.Handled = true; 28 | } 29 | 30 | private void QQHyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e) 31 | { 32 | var uri = new Uri(@"https://qm.qq.com/cgi-bin/qm/qr?k=f2zl3nvoetItho8kGfe1eys0jDkqvvcL&jump_from=webapi"); 33 | Process.Start(new ProcessStartInfo(uri.AbsoluteUri)); 34 | e.Handled = true; 35 | } 36 | 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Sample.Shared/ExampleViews/VirtualizingWrapPanelExample.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Security.Cryptography; 5 | using System.Text; 6 | using System.Windows; 7 | using System.Windows.Controls; 8 | using System.Windows.Data; 9 | using System.Windows.Documents; 10 | using System.Windows.Input; 11 | using System.Windows.Media; 12 | using System.Windows.Media.Imaging; 13 | using System.Windows.Shapes; 14 | 15 | namespace WPFDevelopers.Minimal.Sample.ExampleViews 16 | { 17 | /// 18 | /// Window1.xaml 的交互逻辑 19 | /// 20 | public partial class VirtualizingWrapPanelExample 21 | { 22 | public VirtualizingWrapPanelExample() 23 | { 24 | InitializeComponent(); 25 | 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Sample.Shared/Light.AmericanRose.xaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | #FFFFFF 7 | 8 | 9 | #FF8DA7 10 | 11 | #FFD6DF 12 | 13 | #FF275A 14 | 15 | 16 | #FF033E 17 | 18 | 19 | #FE6E90 20 | 21 | 22 | #FF0943 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Sample.Shared/Light.Carmine.xaml: -------------------------------------------------------------------------------- 1 |  6 | 7 | 8 | #CD7474 9 | 13 | #CFA0A0 14 | 18 | #B70404 19 | 23 | 24 | #B31B1B 25 | 29 | 33 | 34 | #BB5F5F 35 | 39 | 40 | #B70404 41 | 45 | 46 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Sample.Shared/Models/HospitalList.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Collections.ObjectModel; 4 | using System.Windows.Media; 5 | 6 | namespace WPFDevelopers.Minimal.Sample.Models 7 | { 8 | public class HospitalList : ObservableCollection 9 | { 10 | public HospitalList() 11 | { 12 | var hospitals = new string[] { "No. 189, Grove St, Los Angeles", "No. 3669, Grove St, Los Angeles" }; 13 | var names = new string[] { "Doctor Fang", "Judge Qu" }; 14 | var images = new string[] 15 | { "https://pic2.zhimg.com/80/v2-0711e97955adc9be9fbcff67e1007535_720w.jpg", 16 | //"https://pic2.zhimg.com/80/v2-5b7f84c63075ba9771f6e6dc29a54615_720w.jpg", 17 | "https://pic3.zhimg.com/80/v2-a3d6d8832090520e7ed6c748a8698e4e_720w.jpg", 18 | "https://pic3.zhimg.com/80/v2-de7554ac9667a59255fe002bb8753ab6_720w.jpg" 19 | }; 20 | var state = 0; 21 | for (var i = 1; i < 10000; i++) 22 | { 23 | Add(new Hospital { Id = $"9999{i}", DoctorName = i % 2 == 0 ? names[0]:names[1], HospitalName = i % 2 == 0 ? hospitals[0] : hospitals[1] ,State = state ,UserImage = images[state] }); 24 | state++; 25 | if (state > 2) 26 | state = 0; 27 | } 28 | } 29 | } 30 | 31 | public class Hospital 32 | { 33 | public string Id { get; set; } 34 | public string DoctorName { get; set; } 35 | public string HospitalName { get; set; } 36 | public string UserImage { get; set; } 37 | public int State { get; set; } 38 | } 39 | } -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Sample.Shared/Models/UserModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace WPFDevelopers.Minimal.Sample.Models 5 | { 6 | public class UserModel : ViewModelBase 7 | { 8 | private bool _isChecked; 9 | 10 | public bool IsChecked 11 | { 12 | get => _isChecked; 13 | set 14 | { 15 | _isChecked = value; 16 | NotifyPropertyChange("IsChecked"); 17 | } 18 | } 19 | 20 | public DateTime Date { get; set; } 21 | public string Name { get; set; } 22 | public string Address { get; set; } 23 | public List Children { get; set; } 24 | } 25 | } -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Sample.Shared/Models/ViewModelBase.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | 3 | namespace WPFDevelopers.Minimal.Sample.Models 4 | { 5 | public class ViewModelBase : INotifyPropertyChanged 6 | { 7 | public event PropertyChangedEventHandler PropertyChanged; 8 | 9 | public void NotifyPropertyChange(string propertyName) 10 | { 11 | if (PropertyChanged != null) PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Sample.Shared/WPFDevelopers.Minimal.Sample.Shared.projitems: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 5 | true 6 | 018b1a33-3924-46fd-9429-6eac6ecc9aad 7 | 8 | 9 | WPFDevelopers.Minimal.Sample 10 | 11 | 12 | 13 | MSBuild:Compile 14 | Designer 15 | 16 | 17 | MSBuild:Compile 18 | Designer 19 | 20 | 21 | Designer 22 | MSBuild:Compile 23 | 24 | 25 | MSBuild:Compile 26 | Designer 27 | 28 | 29 | MSBuild:Compile 30 | Designer 31 | 32 | 33 | 34 | 35 | App.xaml 36 | 37 | 38 | AboutWindow.xaml 39 | 40 | 41 | MainView.xaml 42 | 43 | 44 | VirtualizingWrapPanelExample.xaml 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Sample.Shared/WPFDevelopers.Minimal.Sample.Shared.shproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 018b1a33-3924-46fd-9429-6eac6ecc9aad 5 | 14.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Sample.Shared/WPFDevelopers.Minimal.Sample.Shared.shproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | true 5 | 6 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Sample.Shared/WPFDevelopers.Minimal.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WPFDevelopersOrg/WPFDevelopers.Minimal/a7e1077236302d4cbd0537d2a9551b8c8f10baee/src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Sample.Shared/WPFDevelopers.Minimal.ico -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Shared/Controls/Loading/WPFLoading.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows; 3 | using System.Windows.Controls; 4 | using System.Windows.Media; 5 | using System.Windows.Media.Animation; 6 | 7 | namespace WPFDevelopers.Minimal.Controls 8 | { 9 | internal class WPFLoading : Control 10 | { 11 | public static readonly DependencyProperty IsAnimationProperty = 12 | DependencyProperty.Register("IsAnimation", typeof(bool), typeof(WPFLoading), new PropertyMetadata(true)); 13 | 14 | public static readonly DependencyProperty StrokeValueProperty = 15 | DependencyProperty.Register("StrokeValue", typeof(double), typeof(WPFLoading) 16 | , new PropertyMetadata(0.0, OnStrokeValueChanged)); 17 | 18 | public static readonly DependencyProperty StrokeArrayProperty = 19 | DependencyProperty.Register("StrokeArray", typeof(DoubleCollection), typeof(WPFLoading) 20 | , new PropertyMetadata(new DoubleCollection { 0, 100 })); 21 | 22 | private Storyboard _storyboard; 23 | 24 | 25 | public WPFLoading() 26 | { 27 | Loaded += LoadingNew_Loaded; 28 | Unloaded += LoadingNew_Unloaded; 29 | } 30 | 31 | /// 32 | /// true :动画开始 33 | /// false:动画停止 34 | /// 35 | public bool IsAnimation 36 | { 37 | get => (bool)GetValue(IsAnimationProperty); 38 | set => SetValue(IsAnimationProperty, value); 39 | } 40 | 41 | public double StrokeValue 42 | { 43 | get => (double)GetValue(StrokeValueProperty); 44 | set => SetValue(StrokeValueProperty, value); 45 | } 46 | 47 | 48 | public DoubleCollection StrokeArray 49 | { 50 | get => (DoubleCollection)GetValue(StrokeArrayProperty); 51 | set => SetValue(StrokeArrayProperty, value); 52 | } 53 | 54 | private static void OnStrokeValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) 55 | { 56 | (d as WPFLoading).StrokeArray = new DoubleCollection { (double)e.NewValue, 100 }; 57 | } 58 | 59 | private void LoadingNew_Loaded(object sender, RoutedEventArgs e) 60 | { 61 | _storyboard = new Storyboard(); 62 | _storyboard.RepeatBehavior = RepeatBehavior.Forever; 63 | var animation = new DoubleAnimation(0, Width, new Duration(TimeSpan.FromSeconds(1.5))); 64 | _storyboard.Children.Add(animation); 65 | Storyboard.SetTarget(animation, this); 66 | Storyboard.SetTargetProperty(animation, new PropertyPath(StrokeValueProperty)); 67 | _storyboard.Begin(); 68 | } 69 | 70 | private void LoadingNew_Unloaded(object sender, RoutedEventArgs e) 71 | { 72 | if (_storyboard != null) 73 | _storyboard.Stop(); 74 | IsAnimation = false; 75 | } 76 | } 77 | } -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Shared/Controls/MessageBox/MessageBox.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using System.Windows; 3 | using System.Windows.Controls; 4 | using System.Windows.Shapes; 5 | using WPFDevelopers.Minimal.Helpers; 6 | 7 | namespace WPFDevelopers.Minimal.Controls 8 | { 9 | public static class MessageBox 10 | { 11 | public static MessageBoxResult Show(string messageBoxText) 12 | { 13 | var msg = new WPFMessageBox(messageBoxText); 14 | return GetWindow(msg); 15 | } 16 | 17 | public static MessageBoxResult Show(string messageBoxText, string caption) 18 | { 19 | var msg = new WPFMessageBox(messageBoxText, caption); 20 | return GetWindow(msg); 21 | } 22 | 23 | public static MessageBoxResult Show(string messageBoxText, string caption, MessageBoxButton button) 24 | { 25 | var msg = new WPFMessageBox(messageBoxText, caption, button); 26 | return GetWindow(msg); 27 | } 28 | 29 | public static MessageBoxResult Show(string messageBoxText, string caption, MessageBoxImage icon) 30 | { 31 | var msg = new WPFMessageBox(messageBoxText, caption, icon); 32 | return GetWindow(msg); 33 | } 34 | 35 | public static MessageBoxResult Show(string messageBoxText, string caption, MessageBoxButton button, 36 | MessageBoxImage icon) 37 | { 38 | var msg = new WPFMessageBox(messageBoxText, caption, button, icon); 39 | return GetWindow(msg); 40 | } 41 | 42 | private static MessageBoxResult GetWindow(WPFMessageBox msg) 43 | { 44 | msg.WindowStartupLocation = WindowStartupLocation.CenterOwner; 45 | Window win = null; 46 | if (Application.Current.Windows.Count > 0) 47 | win = Application.Current.Windows.OfType().FirstOrDefault(o => o.IsActive); 48 | if (win != null) 49 | { 50 | var layer = new Grid(); 51 | layer.Children.Add(new Rectangle { Fill = ControlHelper.WindowForegroundBrush, Opacity = .7 }); 52 | var original = win.Content as UIElement; 53 | win.Content = null; 54 | var container = new Grid(); 55 | container.Children.Add(original); 56 | container.Children.Add(layer); 57 | win.Content = container; 58 | msg.Owner = win; 59 | msg.ShowDialog(); 60 | } 61 | else 62 | { 63 | msg.Show(); 64 | } 65 | 66 | return msg.Result; 67 | } 68 | } 69 | } -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Shared/Controls/NotifyIcon/Runtimes/Interop/BITMAPINFO.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | using System.Security; 3 | 4 | namespace WPFDevelopers.Minimal.Controls.Runtimes.Interop 5 | { 6 | [StructLayout(LayoutKind.Sequential, Pack = 2)] 7 | public struct BITMAPINFO 8 | { 9 | // bmiHeader was a by-value BITMAPINFOHEADER structure 10 | public int bmiHeader_biSize; // ndirect.DllLib.sizeOf( BITMAPINFOHEADER.class ); 11 | 12 | public int bmiHeader_biWidth; 13 | 14 | public int bmiHeader_biHeight; 15 | 16 | public short bmiHeader_biPlanes; 17 | 18 | public short bmiHeader_biBitCount; 19 | 20 | public int bmiHeader_biCompression; 21 | 22 | public int bmiHeader_biSizeImage; 23 | 24 | public int bmiHeader_biXPelsPerMeter; 25 | 26 | public int bmiHeader_biYPelsPerMeter; 27 | 28 | public int bmiHeader_biClrUsed; 29 | 30 | public int bmiHeader_biClrImportant; 31 | 32 | 33 | // hamidm -- 03/08/2006 34 | // if the following RGBQUAD struct is added in this struct, 35 | // we need to update bmiHeader_biSize in the cctor to hard-coded 40 36 | // since it expects the size of the BITMAPINFOHEADER only 37 | // 38 | // bmiColors was an embedded array of RGBQUAD structures 39 | // public byte bmiColors_rgbBlue = 0; 40 | // public byte bmiColors_rgbGreen = 0; 41 | // public byte bmiColors_rgbRed = 0; 42 | // public byte bmiColors_rgbReserved = 0; 43 | public BITMAPINFO(int width, int height, short bpp) 44 | { 45 | bmiHeader_biSize = SizeOf(); 46 | bmiHeader_biWidth = width; 47 | bmiHeader_biHeight = height; 48 | bmiHeader_biPlanes = 1; 49 | bmiHeader_biBitCount = bpp; 50 | bmiHeader_biCompression = 0; 51 | bmiHeader_biSizeImage = 0; 52 | bmiHeader_biXPelsPerMeter = 0; 53 | bmiHeader_biYPelsPerMeter = 0; 54 | bmiHeader_biClrUsed = 0; 55 | bmiHeader_biClrImportant = 0; 56 | } 57 | 58 | /// 59 | /// Critical : Calls critical Marshal.SizeOf 60 | /// Safe : Calls method with trusted input (well known safe type) 61 | /// 62 | [SecuritySafeCritical] 63 | private static int SizeOf() 64 | { 65 | return Marshal.SizeOf(typeof(BITMAPINFO)); 66 | } 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Shared/Controls/NotifyIcon/Runtimes/Interop/BitmapHandle.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.ConstrainedExecution; 3 | using System.Runtime.InteropServices; 4 | using System.Security; 5 | 6 | namespace WPFDevelopers.Minimal.Controls.Runtimes.Interop 7 | { 8 | internal sealed class BitmapHandle : WpfSafeHandle 9 | { 10 | /// 11 | /// Critical: This code calls into a base class which is protected by a SecurityCritical constructor. 12 | /// 13 | [SecurityCritical] 14 | private BitmapHandle() : this(true) 15 | { 16 | } 17 | 18 | /// 19 | /// Critical: This code calls into a base class which is protected by a SecurityCritical constructor. 20 | /// 21 | [SecurityCritical] 22 | private BitmapHandle(bool ownsHandle) : base(ownsHandle, CommonHandles.GDI) 23 | { 24 | } 25 | /// 26 | /// Critical: This calls into DeleteObject 27 | /// 28 | [SecurityCritical] 29 | [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)] 30 | protected override bool ReleaseHandle() 31 | { 32 | return Gdi32Interop.DeleteObject(handle); 33 | } 34 | 35 | /// 36 | /// Critical: Accesses internal critical data. 37 | /// 38 | [SecurityCritical] 39 | internal HandleRef MakeHandleRef(object obj) 40 | { 41 | return new HandleRef(obj, handle); 42 | } 43 | 44 | /// 45 | /// Critical: Creates a new BitmapHandle using Critical constructor. 46 | /// 47 | [SecurityCritical] 48 | internal static BitmapHandle CreateFromHandle(IntPtr hbitmap, bool ownsHandle = true) 49 | { 50 | return new BitmapHandle(ownsHandle) 51 | { 52 | handle = hbitmap, 53 | }; 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Shared/Controls/NotifyIcon/Runtimes/Interop/CommonHandles.cs: -------------------------------------------------------------------------------- 1 | namespace WPFDevelopers.Minimal.Controls.Runtimes.Interop 2 | { 3 | internal static class CommonHandles 4 | { 5 | public static readonly int Icon = HandleCollector.RegisterType(nameof(Icon), 20, 500); 6 | 7 | public static readonly int HDC = HandleCollector.RegisterType(nameof(HDC), 100, 2); 8 | 9 | public static readonly int GDI = HandleCollector.RegisterType(nameof(GDI), 50, 500); 10 | 11 | public static readonly int Kernel = HandleCollector.RegisterType(nameof(Kernel), 0, 1000); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Shared/Controls/NotifyIcon/Runtimes/Interop/IconHandle.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.ConstrainedExecution; 3 | using System.Security; 4 | 5 | namespace WPFDevelopers.Minimal.Controls.Runtimes.Interop 6 | { 7 | internal sealed class IconHandle : WpfSafeHandle 8 | { 9 | /// 10 | /// Critical: This code calls into a base class which is protected by a SecurityCritical constructor. 11 | /// 12 | [SecurityCritical] 13 | private IconHandle() : base(true, CommonHandles.Icon) 14 | { 15 | } 16 | 17 | /// 18 | /// Critical: This calls into DestroyIcon 19 | /// 20 | [SecurityCritical] 21 | [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)] 22 | protected override bool ReleaseHandle() 23 | { 24 | return User32Interop.DestroyIcon(handle); 25 | } 26 | 27 | /// 28 | /// Critical: This creates a new SafeHandle, which has a critical constructor. 29 | /// TreatAsSafe: The handle this creates is invalid. It contains no critical data. 30 | /// 31 | [SecurityCritical, SecurityTreatAsSafe] 32 | internal static IconHandle GetInvalidIcon() 33 | { 34 | return new IconHandle(); 35 | } 36 | 37 | /// 38 | /// Get access to the raw handle for native APIs that require it. 39 | /// 40 | /// 41 | /// Critical: This accesses critical data for the safe handle. 42 | /// 43 | [SecurityCritical] 44 | internal IntPtr CriticalGetHandle() 45 | { 46 | return handle; 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Shared/Controls/NotifyIcon/Runtimes/Interop/WpfSafeHandle.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Win32.SafeHandles; 2 | using System.Security; 3 | 4 | namespace WPFDevelopers.Minimal.Controls.Runtimes.Interop 5 | { 6 | internal abstract class WpfSafeHandle : SafeHandleZeroOrMinusOneIsInvalid 7 | { 8 | private int _collectorId; 9 | 10 | /// 11 | /// Critical:This code calls into a base class which is protected by link demand and by inheritance demand 12 | /// 13 | [SecurityCritical] 14 | protected WpfSafeHandle(bool ownsHandle, int collectorId) : base(ownsHandle) 15 | { 16 | HandleCollector.Add(collectorId); 17 | _collectorId = collectorId; 18 | } 19 | 20 | /// 21 | /// Critical: Conceptually, this would be accessing critical data as it's in the destroy call path. 22 | /// TreatAsSafe: This is just destroying a handle that this object owns. 23 | /// 24 | [SecurityCritical, SecurityTreatAsSafe] 25 | protected override void Dispose(bool disposing) 26 | { 27 | HandleCollector.Remove(_collectorId); 28 | base.Dispose(disposing); 29 | } 30 | 31 | // ReleaseHandle implementation is deferred to derived classes. 32 | // protected override bool ReleaseHandle() {} 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Shared/Controls/NotifyIcon/Runtimes/Kernel32Interop.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel; 3 | using System.Diagnostics; 4 | using System.Runtime.InteropServices; 5 | using System.Security; 6 | using System.Text; 7 | using WPFDevelopers.Minimal.Controls.Runtimes.Interop; 8 | using HandleCollector = WPFDevelopers.Minimal.Controls.Runtimes.Interop.HandleCollector; 9 | 10 | namespace WPFDevelopers.Minimal.Controls.Runtimes 11 | { 12 | public static class Kernel32Interop 13 | { 14 | private const string _Kernel32 = "kernel32.dll"; 15 | 16 | [DllImport(_Kernel32, CharSet = CharSet.Unicode, EntryPoint = "GetModuleHandleW", SetLastError = true)] 17 | public static extern IntPtr GetModuleHandle([MarshalAs(UnmanagedType.LPWStr)] string lpModuleName); 18 | 19 | [SecurityCritical] 20 | [SuppressUnmanagedCodeSecurity] 21 | [DllImport(_Kernel32, EntryPoint = "GetModuleFileName", CharSet = CharSet.Unicode, 22 | SetLastError = true)] 23 | private static extern int IntGetModuleFileName(HandleRef hModule, StringBuilder buffer, int length); 24 | 25 | [SecurityCritical] 26 | internal static string GetModuleFileName(HandleRef hModule) 27 | { 28 | var sBuilder = new StringBuilder(260); 29 | while (true) 30 | { 31 | var size = IntGetModuleFileName(hModule, sBuilder, sBuilder.Capacity); 32 | if (size == 0) throw new Win32Exception(); 33 | if (size == sBuilder.Capacity) 34 | { 35 | sBuilder.EnsureCapacity(sBuilder.Capacity * 2); 36 | continue; 37 | } 38 | return sBuilder.ToString(); 39 | } 40 | } 41 | [DllImport(_Kernel32, EntryPoint = "CloseHandle", CharSet = CharSet.Auto, SetLastError = true)] 42 | private static extern bool IntCloseHandle(HandleRef handle); 43 | 44 | /// 45 | /// Critical: Closes a passed in handle, LinkDemand on Marshal.GetLastWin32Error 46 | /// 47 | [SecurityCritical] 48 | public static bool CloseHandleNoThrow(HandleRef handle) 49 | { 50 | HandleCollector.Remove((IntPtr)handle, CommonHandles.Kernel); 51 | 52 | bool result = IntCloseHandle(handle); 53 | int error = Marshal.GetLastWin32Error(); 54 | 55 | if (!result) 56 | { 57 | Debug.WriteLine("CloseHandle failed. Error = " + error); 58 | } 59 | 60 | return result; 61 | 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Shared/Controls/NotifyIcon/Runtimes/Shell32/NIFFlags.cs: -------------------------------------------------------------------------------- 1 | namespace WPFDevelopers.Minimal.Controls.Runtimes.Shell32 2 | { 3 | public enum NIFFlags 4 | { 5 | // The uCallbackMessage member is valid. 6 | NIF_MESSAGE = 0x01, 7 | 8 | // The hIcon member is valid. 9 | NIF_ICON = 0x02, 10 | 11 | // The szTip member is valid. 12 | NIF_TIP = 0x04, 13 | 14 | //The dwState and dwStateMask members are valid. 15 | NIF_STATE = 0x08, 16 | 17 | /// 18 | /// Display a balloon notification. 19 | /// The szInfo, szInfoTitle, dwInfoFlags, and uTimeout members are valid. 20 | /// Note that uTimeout is valid only in Windows 2000 and Windows XP. 21 | /// To display the balloon notification, specify NIF_INFO and provide text in szInfo. 22 | /// To remove a balloon notification, specify NIF_INFO and provide an empty string through szInfo. 23 | /// To add a notification area icon without displaying a notification, do not set the NIF_INFO flag. 24 | /// 25 | NIF_INFO = 0x10, 26 | 27 | /// 28 | /// Windows 7 and later: The guidItem is valid. 29 | /// Windows Vista and earlier: Reserved. 30 | /// 31 | NIF_GUID = 0x20, 32 | 33 | /// 34 | /// Windows Vista and later. If the balloon notification cannot be displayed immediately, discard it. 35 | /// Use this flag for notifications that represent real-time information which would be meaningless or misleading if displayed at a later time. 36 | /// For example, a message that states "Your telephone is ringing." 37 | /// NIF_REALTIME is meaningful only when combined with the NIF_INFO flag. 38 | /// 39 | NIF_REALTIME = 0x40, 40 | 41 | 42 | /// 43 | /// Windows Vista and later. 44 | /// Use the standard tooltip. 45 | /// Normally, when uVersion is set to NOTIFYICON_VERSION_4, the standard tooltip is suppressed and can be replaced by the application-drawn, pop-up UI. 46 | /// If the application wants to show the standard tooltip with NOTIFYICON_VERSION_4, 47 | /// it can specify NIF_SHOWTIP to indicate the standard tooltip should still be shown. 48 | /// 49 | NIF_SHOWTIP = 0x80, 50 | 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Shared/Controls/NotifyIcon/Runtimes/Shell32/NISFlags.cs: -------------------------------------------------------------------------------- 1 | namespace WPFDevelopers.Minimal.Controls.Runtimes.Shell32 2 | { 3 | public enum NISFlags 4 | { 5 | /// 6 | /// 7 | /// 8 | NIS_DEFAULT = 0x00, 9 | 10 | /// 11 | /// The icon is hidden. 12 | /// 13 | NIS_HIDDEN = 0x01, 14 | 15 | /// 16 | /// The icon resource is shared between multiple icons. 17 | /// 18 | NIS_SHAREDICON = 0x02, 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Shared/Controls/NotifyIcon/Runtimes/Shell32/NotifyCommand.cs: -------------------------------------------------------------------------------- 1 | namespace WPFDevelopers.Minimal.Controls.Runtimes.Shell32 2 | { 3 | public enum NotifyCommand 4 | { 5 | /// 6 | /// Adds an icon to the status area. 7 | /// The icon is given an identifier in the NOTIFYICONDATA structure pointed to by lpdata—either through its uID or guidItem member. 8 | /// This identifier is used in subsequent calls to Shell_NotifyIcon to perform later actions on the icon. 9 | /// 10 | NIM_Add = 0x00, 11 | 12 | /// 13 | /// Modifies an icon in the status area. 14 | /// NOTIFYICONDATA structure pointed to by lpdata uses the ID originally assigned to the icon when it was added to the notification area (NIM_ADD) to identify the icon to be modified. 15 | /// 16 | NIM_Modify = 0x01, 17 | 18 | /// 19 | /// Deletes an icon from the status area. 20 | /// NOTIFYICONDATA structure pointed to by lpdata uses the ID originally assigned to the icon when it was added to the notification area (NIM_ADD) to identify the icon to be deleted. 21 | /// 22 | NIM_Delete = 0x02, 23 | 24 | /// 25 | /// Shell32.dll version 5.0 and later only. 26 | /// Returns focus to the taskbar notification area. 27 | /// Notification area icons should use this message when they have completed their UI operation. 28 | /// For example, if the icon displays a shortcut menu, but the user presses ESC to cancel it, 29 | /// use NIM_SETFOCUS to return focus to the notification area. 30 | /// 31 | NIM_SetFocus = 0x03, 32 | 33 | /// 34 | /// Shell32.dll version 5.0 and later only. 35 | /// Instructs the notification area to behave according to the version number specified in the uVersion member of the structure pointed to by lpdata. 36 | /// The version number specifies which members are recognized. 37 | /// 38 | NIM_SetVersion = 0x04 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Shared/Controls/NotifyIcon/Runtimes/Shell32/NotifyFlags.cs: -------------------------------------------------------------------------------- 1 | using WPFDevelopers.Minimal.Controls.Runtimes.User32; 2 | 3 | namespace WPFDevelopers.Minimal.Controls.Runtimes.Shell32 4 | { 5 | public enum TimeOutFlags 6 | { 7 | Minimum_Timeout = 10, 8 | Maximum_Timeout = 30, 9 | } 10 | 11 | public enum NOTIFYICONDATAWFlags 12 | { 13 | NOTIFYICONDATA_V1_SIZE, 14 | NOTIFYICONDATA_V2_SIZE, 15 | NOTIFYICONDATA_V3_SIZE = 952, 16 | } 17 | 18 | public enum NOTIFYMESSAGESINK 19 | { 20 | NotifyCallBackMessage = WM.USER + 6, 21 | } 22 | 23 | public enum NOTIFYICONVERSIONFlags 24 | { 25 | NOTIFYICON_VERSION = 0x03, 26 | NOTIFYICON_VERSION_4 = 0x04, 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Shared/Controls/NotifyIcon/Runtimes/Shell32Interop.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | using WPFDevelopers.Minimal.Controls.Runtimes.Shell32; 4 | 5 | namespace WPFDevelopers.Minimal.Controls.Runtimes 6 | { 7 | public static class Shell32Interop 8 | { 9 | private const string _Shell32 = "shell32.dll"; 10 | 11 | [DllImport(_Shell32, CharSet = CharSet.Unicode)] 12 | [return: MarshalAs(UnmanagedType.Bool)] 13 | public static extern bool Shell_NotifyIcon([In] NotifyCommand dwMessage, [In] ref NOTIFYICONDATA lpData); 14 | 15 | 16 | [DllImport(_Shell32, CharSet = CharSet.Auto)] 17 | public static extern IntPtr ExtractAssociatedIcon(IntPtr hInst, string iconPath, ref IntPtr index); 18 | 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Shared/Controls/NotifyIcon/Runtimes/User32/CS.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace WPFDevelopers.Minimal.Controls.Runtimes.User32 4 | { 5 | [Flags] 6 | public enum CS : uint 7 | { 8 | VREDRAW = 1U, 9 | HREDRAW = 2U, 10 | DBLCLKS = 8U, 11 | OWNDC = 32U, 12 | CLASSDC = 64U, 13 | PARENTDC = 128U, 14 | NOCLOSE = 512U, 15 | SAVEBITS = 2048U, 16 | BYTEALIGNCLIENT = 4096U, 17 | BYTEALIGNWINDOW = 8192U, 18 | GLOBALCLASS = 16384U, 19 | IME = 65536U, 20 | DROPSHADOW = 131072U 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Shared/Controls/NotifyIcon/Runtimes/User32/ImageType.cs: -------------------------------------------------------------------------------- 1 | namespace WPFDevelopers.Minimal.Controls.Runtimes.User32 2 | { 3 | public enum ImageType : uint 4 | { 5 | // 6 | // Summary: 7 | // Loads a bitmap. 8 | IMAGE_BITMAP, 9 | // 10 | // Summary: 11 | // Loads an icon. 12 | IMAGE_ICON, 13 | // 14 | // Summary: 15 | // Loads a cursor. 16 | IMAGE_CURSOR 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Shared/Controls/NotifyIcon/Runtimes/User32/WNDCLASSEX.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace WPFDevelopers.Minimal.Controls.Runtimes.User32 5 | { 6 | [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] 7 | public struct WNDCLASSEX 8 | { 9 | public int cbSize; 10 | 11 | public CS style; 12 | 13 | public WndProc lpfnWndProc; 14 | 15 | public int cbClsExtra; 16 | 17 | public int cbWndExtra; 18 | 19 | public IntPtr hInstance; 20 | 21 | public IntPtr hIcon; 22 | 23 | public IntPtr hCursor; 24 | 25 | public IntPtr hbrBackground; 26 | 27 | [MarshalAs(UnmanagedType.LPWStr)] 28 | public string lpszMenuName; 29 | 30 | [MarshalAs(UnmanagedType.LPWStr)] 31 | public string lpszClassName; 32 | 33 | public IntPtr hIconSm; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Shared/Controls/NotifyIcon/Runtimes/User32/WS.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace WPFDevelopers.Minimal.Controls.Runtimes.User32 4 | { 5 | [Flags] 6 | public enum WS : uint 7 | { 8 | OVERLAPPED = 0U, 9 | POPUP = 2147483648U, 10 | CHILD = 1073741824U, 11 | MINIMIZE = 536870912U, 12 | VISIBLE = 268435456U, 13 | DISABLED = 134217728U, 14 | CLIPSIBLINGS = 67108864U, 15 | CLIPCHILDREN = 33554432U, 16 | MAXIMIZE = 16777216U, 17 | BORDER = 8388608U, 18 | DLGFRAME = 4194304U, 19 | VSCROLL = 2097152U, 20 | HSCROLL = 1048576U, 21 | SYSMENU = 524288U, 22 | THICKFRAME = 262144U, 23 | GROUP = 131072U, 24 | TABSTOP = 65536U, 25 | MINIMIZEBOX = 131072U, 26 | MAXIMIZEBOX = 65536U, 27 | CAPTION = 12582912U, 28 | TILED = 0U, 29 | ICONIC = 536870912U, 30 | SIZEBOX = 262144U, 31 | TILEDWINDOW = 13565952U, 32 | OVERLAPPEDWINDOW = 13565952U, 33 | POPUPWINDOW = 2156396544U, 34 | CHILDWINDOW = 1073741824U 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Shared/Controls/NotifyIcon/Runtimes/User32/WS_EX.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace WPFDevelopers.Minimal.Controls.Runtimes.User32 4 | { 5 | [Flags] 6 | public enum WS_EX : uint 7 | { 8 | None = 0U, 9 | DLGMODALFRAME = 1U, 10 | NOPARENTNOTIFY = 4U, 11 | TOPMOST = 8U, 12 | ACCEPTFILES = 16U, 13 | TRANSPARENT = 32U, 14 | MDICHILD = 64U, 15 | TOOLWINDOW = 128U, 16 | WINDOWEDGE = 256U, 17 | CLIENTEDGE = 512U, 18 | CONTEXTHELP = 1024U, 19 | RIGHT = 4096U, 20 | LEFT = 0U, 21 | RTLREADING = 8192U, 22 | LTRREADING = 0U, 23 | LEFTSCROLLBAR = 16384U, 24 | RIGHTSCROLLBAR = 0U, 25 | CONTROLPARENT = 65536U, 26 | STATICEDGE = 131072U, 27 | APPWINDOW = 262144U, 28 | LAYERED = 524288U, 29 | NOINHERITLAYOUT = 1048576U, 30 | LAYOUTRTL = 4194304U, 31 | COMPOSITED = 33554432U, 32 | NOACTIVATE = 134217728U, 33 | OVERLAPPEDWINDOW = 768U, 34 | PALETTEWINDOW = 392U 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Shared/Controls/NotifyIcon/Runtimes/User32/WndProc.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace WPFDevelopers.Minimal.Controls.Runtimes.User32 4 | { 5 | public delegate IntPtr WndProc(IntPtr hwnd, WM uMsg, IntPtr wParam, IntPtr lParam); 6 | } 7 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Shared/Controls/Panel/SmallPanel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows; 3 | using System.Windows.Controls; 4 | 5 | namespace WPFDevelopers.Minimal.Controls 6 | { 7 | /// 8 | /// 当不需要使用Grid的分行分列,则可使用 SmallPanel 9 | /// 10 | public class SmallPanel : Panel 11 | { 12 | /// 13 | /// Content measurement. 14 | /// 15 | /// Constraint 16 | /// Desired size 17 | protected override Size MeasureOverride(Size constraint) 18 | { 19 | Size gridDesiredSize = new Size(); 20 | UIElementCollection children = InternalChildren; 21 | 22 | for (int i = 0, count = children.Count; i < count; ++i) 23 | { 24 | UIElement child = children[i]; 25 | if (child != null) 26 | { 27 | child.Measure(constraint); 28 | gridDesiredSize.Width = Math.Max(gridDesiredSize.Width, child.DesiredSize.Width); 29 | gridDesiredSize.Height = Math.Max(gridDesiredSize.Height, child.DesiredSize.Height); 30 | } 31 | } 32 | return (gridDesiredSize); 33 | } 34 | /// 35 | /// Content arrangement. 36 | /// 37 | /// Arrange size 38 | protected override Size ArrangeOverride(Size arrangeSize) 39 | { 40 | UIElementCollection children = InternalChildren; 41 | for (int i = 0, count = children.Count; i < count; ++i) 42 | { 43 | UIElement child = children[i]; 44 | if (child != null) 45 | { 46 | child.Arrange(new Rect(arrangeSize)); 47 | } 48 | } 49 | return (arrangeSize); 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Shared/Controls/ThemeControl/ThemeModel.cs: -------------------------------------------------------------------------------- 1 | using WPFDevelopers.Minimal.Helpers; 2 | 3 | namespace WPFDevelopers.Minimal.Controls 4 | { 5 | public class ThemeModel : ViewModelBase 6 | { 7 | private bool _isChecked; 8 | 9 | /// 10 | /// whether to choose 11 | /// 12 | public bool IsChecked 13 | { 14 | get => _isChecked; 15 | set 16 | { 17 | _isChecked = value; 18 | NotifyPropertyChange("IsChecked"); 19 | } 20 | } 21 | 22 | /// 23 | /// display color 24 | /// 25 | public string Color { get; set; } 26 | 27 | /// 28 | /// resource path 29 | /// 30 | public string ResourcePath { get; set; } 31 | } 32 | } -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Shared/Converts/DatePickerToCurrentConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | using System.Windows; 4 | using System.Windows.Controls.Primitives; 5 | using System.Windows.Data; 6 | 7 | namespace WPFDevelopers.Minimal.Converts 8 | { 9 | public class DatePickerToCurrentConverter : IMultiValueConverter 10 | { 11 | public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) 12 | { 13 | if (values == null) 14 | return Visibility.Collapsed; 15 | if (values[0] == null) 16 | return Visibility.Collapsed; 17 | if (values[1] is CalendarButton calendar) 18 | { 19 | var current = (DateTime)calendar.DataContext; 20 | var time = DateTime.Now.Date; 21 | int result; 22 | var isYear = int.TryParse(calendar.Content.ToString(), out result); 23 | if (isYear) 24 | { 25 | if (current.Year == time.Year) 26 | return Visibility.Visible; 27 | } 28 | else 29 | { 30 | if (current.Year == time.Year 31 | && 32 | current.Month == time.Month) 33 | return Visibility.Visible; 34 | } 35 | } 36 | return Visibility.Collapsed; 37 | } 38 | 39 | public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) 40 | { 41 | throw new NotImplementedException(); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Shared/Converts/ElementConvert.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | using System.Windows.Data; 4 | 5 | namespace WPFDevelopers.Minimal.Converts 6 | { 7 | public class WidthConvert : IValueConverter 8 | { 9 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 10 | { 11 | return 20; 12 | } 13 | 14 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 15 | { 16 | throw new NotImplementedException(); 17 | } 18 | } 19 | public class DoubleMinConverter : IValueConverter 20 | { 21 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 22 | { 23 | if (value is double doubleValue) 24 | return doubleValue < .0 ? .0 : doubleValue; 25 | return .0; 26 | } 27 | 28 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 29 | { 30 | throw new NotSupportedException(); 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Shared/Converts/ObjectNullToVisibilityConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | using System.Windows; 4 | using System.Windows.Data; 5 | 6 | namespace WPFDevelopers.Minimal.Converts 7 | { 8 | public class ObjectNullToVisibilityConverter : IValueConverter 9 | { 10 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 11 | { 12 | return value == null ? Visibility.Collapsed : Visibility.Visible; 13 | } 14 | 15 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 16 | { 17 | throw new NotImplementedException(); 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Shared/Effects/GrayscaleEffect.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows; 3 | using System.Windows.Media; 4 | using System.Windows.Media.Effects; 5 | 6 | namespace WPFDevelopers.Minimal 7 | { 8 | public class GrayscaleEffect : ShaderEffect 9 | { 10 | /// 11 | /// Identifies the Input property. 12 | /// 13 | public static readonly DependencyProperty InputProperty = RegisterPixelShaderSamplerProperty("Input", typeof(GrayscaleEffect), 0); 14 | 15 | /// 16 | /// Identifies the Factor property. 17 | /// 18 | public static readonly DependencyProperty FactorProperty = DependencyProperty.Register("Factor", typeof(double), typeof(GrayscaleEffect), new UIPropertyMetadata(0D, PixelShaderConstantCallback(0))); 19 | 20 | /// 21 | /// Identifies the Brightness property. 22 | /// 23 | public static readonly DependencyProperty BrightnessProperty = DependencyProperty.Register("Brightness", typeof(double), typeof(GrayscaleEffect), new UIPropertyMetadata(0D, PixelShaderConstantCallback(1))); 24 | 25 | /// 26 | /// Creates a new instance of the class. 27 | /// 28 | public GrayscaleEffect() 29 | { 30 | var pixelShader = new PixelShader(); 31 | pixelShader.UriSource = new Uri("WPFDevelopers.Minimal;component/Effects/GrayscaleEffect.ps", UriKind.Relative); 32 | 33 | PixelShader = pixelShader; 34 | 35 | UpdateShaderValue(InputProperty); 36 | UpdateShaderValue(FactorProperty); 37 | UpdateShaderValue(BrightnessProperty); 38 | } 39 | 40 | /// 41 | /// Gets or sets the used as input for the shader. 42 | /// 43 | public Brush Input 44 | { 45 | get => ((Brush)(GetValue(InputProperty))); 46 | set => SetValue(InputProperty, value); 47 | } 48 | 49 | /// 50 | /// Gets or sets the factor used in the shader. 51 | /// 52 | public double Factor 53 | { 54 | get => ((double)(GetValue(FactorProperty))); 55 | set => SetValue(FactorProperty, value); 56 | } 57 | 58 | /// 59 | /// Gets or sets the brightness of the effect. 60 | /// 61 | public double Brightness 62 | { 63 | get => ((double)(GetValue(BrightnessProperty))); 64 | set => SetValue(BrightnessProperty, value); 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Shared/Helpers/ElementHelper.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | 3 | namespace WPFDevelopers.Minimal.Helpers 4 | { 5 | public class ElementHelper : DependencyObject 6 | { 7 | public static readonly DependencyProperty CornerRadiusProperty = 8 | DependencyProperty.RegisterAttached("CornerRadius", typeof(CornerRadius), typeof(ElementHelper), 9 | new PropertyMetadata(new CornerRadius(0))); 10 | 11 | public static readonly DependencyProperty IsWatermarkProperty = 12 | DependencyProperty.RegisterAttached("IsWatermark", typeof(bool), typeof(ElementHelper), 13 | new PropertyMetadata(false)); 14 | public static readonly DependencyProperty WatermarkProperty = 15 | DependencyProperty.RegisterAttached("Watermark", typeof(string), typeof(ElementHelper), 16 | new PropertyMetadata("Please input")); 17 | 18 | public static readonly DependencyProperty IsStripeProperty = 19 | DependencyProperty.RegisterAttached("IsStripe", typeof(bool), typeof(ElementHelper), 20 | new PropertyMetadata(false)); 21 | 22 | public static CornerRadius GetCornerRadius(DependencyObject obj) 23 | { 24 | return (CornerRadius)obj.GetValue(CornerRadiusProperty); 25 | } 26 | 27 | public static void SetCornerRadius(DependencyObject obj, CornerRadius value) 28 | { 29 | obj.SetValue(CornerRadiusProperty, value); 30 | } 31 | public static bool GetIsWatermark(DependencyObject obj) 32 | { 33 | return (bool)obj.GetValue(IsWatermarkProperty); 34 | } 35 | 36 | public static void SetIsWatermark(DependencyObject obj, bool value) 37 | { 38 | obj.SetValue(IsWatermarkProperty, value); 39 | } 40 | 41 | public static string GetWatermark(DependencyObject obj) 42 | { 43 | return (string)obj.GetValue(WatermarkProperty); 44 | } 45 | 46 | public static void SetWatermark(DependencyObject obj, string value) 47 | { 48 | obj.SetValue(WatermarkProperty, value); 49 | } 50 | public static bool GetIsStripe(DependencyObject obj) 51 | { 52 | return (bool)obj.GetValue(IsStripeProperty); 53 | } 54 | 55 | public static void SetIsStripe(DependencyObject obj, bool value) 56 | { 57 | obj.SetValue(IsStripeProperty, value); 58 | } 59 | } 60 | } -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Shared/Helpers/MaskAdorner.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | using System.Windows.Documents; 3 | using System.Windows.Media; 4 | 5 | namespace WPFDevelopers.Minimal.Helpers 6 | { 7 | public class MaskAdorner : Adorner 8 | { 9 | private UIElement child; 10 | 11 | public MaskAdorner(UIElement adornedElement) : base(adornedElement) 12 | { 13 | } 14 | 15 | public UIElement Child 16 | { 17 | get => child; 18 | set 19 | { 20 | if (value == null) 21 | RemoveVisualChild(child); 22 | else 23 | AddVisualChild(value); 24 | child = value; 25 | } 26 | } 27 | 28 | protected override int VisualChildrenCount => 1; 29 | 30 | protected override Size ArrangeOverride(Size finalSize) 31 | { 32 | child?.Arrange(new Rect(finalSize)); 33 | return finalSize; 34 | } 35 | 36 | protected override Visual GetVisualChild(int index) 37 | { 38 | if (index == 0 && child != null) return child; 39 | return base.GetVisualChild(index); 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Shared/Helpers/PasswordBoxHelper.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | using System.Windows.Controls; 3 | 4 | namespace WPFDevelopers.Minimal.Helpers 5 | { 6 | public class PasswordBoxHelper : DependencyObject 7 | { 8 | public static readonly DependencyProperty IsMonitoringProperty = 9 | DependencyProperty.RegisterAttached("IsMonitoring", typeof(bool), typeof(PasswordBoxHelper), 10 | new UIPropertyMetadata(false, OnIsMonitoringChanged)); 11 | 12 | public static readonly DependencyProperty PasswordLengthProperty = 13 | DependencyProperty.RegisterAttached("PasswordLength", typeof(int), typeof(PasswordBoxHelper), 14 | new UIPropertyMetadata(0)); 15 | 16 | public static bool GetIsMonitoring(DependencyObject obj) 17 | { 18 | return (bool)obj.GetValue(IsMonitoringProperty); 19 | } 20 | 21 | public static void SetIsMonitoring(DependencyObject obj, bool value) 22 | { 23 | obj.SetValue(IsMonitoringProperty, value); 24 | } 25 | 26 | 27 | public static int GetPasswordLength(DependencyObject obj) 28 | { 29 | return (int)obj.GetValue(PasswordLengthProperty); 30 | } 31 | 32 | public static void SetPasswordLength(DependencyObject obj, int value) 33 | { 34 | obj.SetValue(PasswordLengthProperty, value); 35 | } 36 | 37 | private static void OnIsMonitoringChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) 38 | { 39 | var pb = d as PasswordBox; 40 | if (pb == null) return; 41 | if ((bool)e.NewValue) 42 | pb.PasswordChanged += PasswordChanged; 43 | else 44 | pb.PasswordChanged -= PasswordChanged; 45 | } 46 | 47 | private static void PasswordChanged(object sender, RoutedEventArgs e) 48 | { 49 | var pb = sender as PasswordBox; 50 | if (pb == null) return; 51 | SetPasswordLength(pb, pb.Password.Length); 52 | } 53 | } 54 | } -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Shared/Helpers/ThemeType.cs: -------------------------------------------------------------------------------- 1 | namespace WPFDevelopers.Minimal.Helpers 2 | { 3 | public enum ThemeType 4 | { 5 | Light, 6 | Dark, 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Shared/Helpers/ViewModelBase.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | 3 | namespace WPFDevelopers.Minimal.Helpers 4 | { 5 | public class ViewModelBase : INotifyPropertyChanged 6 | { 7 | public event PropertyChangedEventHandler PropertyChanged; 8 | 9 | public void NotifyPropertyChange(string propertyName) 10 | { 11 | if (PropertyChanged != null) PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Shared/Resources.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows; 3 | using WPFDevelopers.Minimal.Helpers; 4 | 5 | namespace WPFDevelopers.Minimal 6 | { 7 | public class Resources : ResourceDictionary 8 | { 9 | public static event ThemeChangedEvent ThemeChanged; 10 | public ThemeType Theme 11 | { 12 | set => InitializeTheme(value); 13 | } 14 | 15 | protected void InitializeTheme(ThemeType themeType) 16 | { 17 | MergedDictionaries.Clear(); 18 | var path = GetResourceUri(GetThemeResourceName(themeType)); 19 | MergedDictionaries.Add(new ResourceDictionary { Source = path }); 20 | ThemeChanged?.Invoke(themeType); 21 | } 22 | 23 | protected Uri GetResourceUri(string path) 24 | { 25 | return new Uri($"pack://application:,,,/WPFDevelopers.Minimal;component/Themes/Basic/{path}.xaml"); 26 | } 27 | 28 | protected string GetThemeResourceName(ThemeType themeType) 29 | { 30 | return themeType == ThemeType.Light ? "Light.Color" : "Dark.Color"; 31 | } 32 | } 33 | public delegate void ThemeChangedEvent(ThemeType currentTheme); 34 | } -------------------------------------------------------------------------------- /src/WPFDevelopers.Minimal/WPFDevelopers.Minimal.Shared/Styles/Styles.ContextMenu.xaml: -------------------------------------------------------------------------------- 1 |  6 | 7 | 8 | 9 | 10 | 11 | 12 | 39 | 20 | 34 | 48 | 31 | 36 |