├── .gitignore ├── LICENSE ├── Profiles ├── 1-1_1200x1200.xml ├── 1-1_1800x1800.xml ├── 1-1_2400x2400.xml ├── 1-1_3000x3000.xml ├── 1-1_5000x5000.xml ├── 16-10_1920x1200.xml ├── 16-10_2880x1800.xml ├── 16-10_3840x2400.xml ├── 16-10_5760x3600.xml ├── 16-9_1536x864.xml ├── 16-9_1920x1080.xml ├── 21-9_1920x822.xml ├── 21-9_2880x1200.xml ├── 21-9_3840x1645.xml ├── 21-9_5760x2468.xml ├── 4-5_1920x2400.xml ├── 4-5_2880x3600.xml └── 4-5_960x1200.xml ├── README.md ├── SRWE.sln ├── SRWE.v12.suo └── SRWE ├── MainForm.Designer.cs ├── MainForm.cs ├── MainForm.resx ├── OpenProcessDialog.cs ├── OpenProcessDialog.designer.cs ├── OpenProcessDialog.resx ├── ProcessSelectorCtrl.cs ├── ProcessSelectorCtrl.designer.cs ├── ProcessSelectorCtrl.resx ├── Program.cs ├── Properties ├── AssemblyInfo.cs ├── Resources.Designer.cs ├── Resources.resx ├── Settings.Designer.cs └── Settings.settings ├── Resources ├── Application_EXE.png ├── LoadProfile.png ├── Profile.xml ├── Recent.png ├── RefreshTree.png ├── SaveProfile.png ├── Settings.xml └── WindowStyles.xml ├── SRWE.csproj ├── SRWE.ico ├── SRWE_Settings.cs ├── Window.cs ├── app.config └── app.manifest /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | build/ 21 | bld/ 22 | [Bb]in/ 23 | [Oo]bj/ 24 | 25 | # Visual Studo 2015 cache/options directory 26 | .vs/ 27 | 28 | # MSTest test Results 29 | [Tt]est[Rr]esult*/ 30 | [Bb]uild[Ll]og.* 31 | 32 | # NUNIT 33 | *.VisualState.xml 34 | TestResult.xml 35 | 36 | # Build Results of an ATL Project 37 | [Dd]ebugPS/ 38 | [Rr]eleasePS/ 39 | dlldata.c 40 | 41 | *_i.c 42 | *_p.c 43 | *_i.h 44 | *.ilk 45 | *.meta 46 | *.obj 47 | *.pch 48 | *.pdb 49 | *.pgc 50 | *.pgd 51 | *.rsp 52 | *.sbr 53 | *.tlb 54 | *.tli 55 | *.tlh 56 | *.tmp 57 | *.tmp_proj 58 | *.log 59 | *.vspscc 60 | *.vssscc 61 | .builds 62 | *.pidb 63 | *.svclog 64 | *.scc 65 | 66 | # Chutzpah Test files 67 | _Chutzpah* 68 | 69 | # Visual C++ cache files 70 | ipch/ 71 | *.aps 72 | *.ncb 73 | *.opensdf 74 | *.sdf 75 | *.cachefile 76 | 77 | # Visual Studio profiler 78 | *.psess 79 | *.vsp 80 | *.vspx 81 | 82 | # TFS 2012 Local Workspace 83 | $tf/ 84 | 85 | # Guidance Automation Toolkit 86 | *.gpState 87 | 88 | # ReSharper is a .NET coding add-in 89 | _ReSharper*/ 90 | *.[Rr]e[Ss]harper 91 | *.DotSettings.user 92 | 93 | # JustCode is a .NET coding addin-in 94 | .JustCode 95 | 96 | # TeamCity is a build add-in 97 | _TeamCity* 98 | 99 | # DotCover is a Code Coverage Tool 100 | *.dotCover 101 | 102 | # NCrunch 103 | _NCrunch_* 104 | .*crunch*.local.xml 105 | 106 | # MightyMoose 107 | *.mm.* 108 | AutoTest.Net/ 109 | 110 | # Web workbench (sass) 111 | .sass-cache/ 112 | 113 | # Installshield output folder 114 | [Ee]xpress/ 115 | 116 | # DocProject is a documentation generator add-in 117 | DocProject/buildhelp/ 118 | DocProject/Help/*.HxT 119 | DocProject/Help/*.HxC 120 | DocProject/Help/*.hhc 121 | DocProject/Help/*.hhk 122 | DocProject/Help/*.hhp 123 | DocProject/Help/Html2 124 | DocProject/Help/html 125 | 126 | # Click-Once directory 127 | publish/ 128 | 129 | # Publish Web Output 130 | *.[Pp]ublish.xml 131 | *.azurePubxml 132 | # TODO: Comment the next line if you want to checkin your web deploy settings 133 | # but database connection strings (with potential passwords) will be unencrypted 134 | *.pubxml 135 | *.publishproj 136 | 137 | # NuGet Packages 138 | *.nupkg 139 | # The packages folder can be ignored because of Package Restore 140 | **/packages/* 141 | # except build/, which is used as an MSBuild target. 142 | !**/packages/build/ 143 | # Uncomment if necessary however generally it will be regenerated when needed 144 | #!**/packages/repositories.config 145 | 146 | # Windows Azure Build Output 147 | csx/ 148 | *.build.csdef 149 | 150 | # Windows Store app package directory 151 | AppPackages/ 152 | 153 | # Others 154 | *.[Cc]ache 155 | ClientBin/ 156 | [Ss]tyle[Cc]op.* 157 | ~$* 158 | *~ 159 | *.dbmdl 160 | *.dbproj.schemaview 161 | *.pfx 162 | *.publishsettings 163 | node_modules/ 164 | bower_components/ 165 | 166 | # RIA/Silverlight projects 167 | Generated_Code/ 168 | 169 | # Backup & report files from converting an old project file 170 | # to a newer Visual Studio version. Backup files are not needed, 171 | # because we have git ;-) 172 | _UpgradeReport_Files/ 173 | Backup*/ 174 | UpgradeLog*.XML 175 | UpgradeLog*.htm 176 | 177 | # SQL Server files 178 | *.mdf 179 | *.ldf 180 | 181 | # Business Intelligence projects 182 | *.rdl.data 183 | *.bim.layout 184 | *.bim_*.settings 185 | 186 | # Microsoft Fakes 187 | FakesAssemblies/ 188 | 189 | # Node.js Tools for Visual Studio 190 | .ntvs_analysis.dat 191 | 192 | # Visual Studio 6 build log 193 | *.plg 194 | 195 | # Visual Studio 6 workspace options file 196 | *.opt 197 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 dtgDTGdtg 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 | -------------------------------------------------------------------------------- /Profiles/1-1_1200x1200.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Profiles/1-1_1800x1800.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Profiles/1-1_2400x2400.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Profiles/1-1_3000x3000.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Profiles/1-1_5000x5000.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Profiles/16-10_1920x1200.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Profiles/16-10_2880x1800.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Profiles/16-10_3840x2400.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Profiles/16-10_5760x3600.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Profiles/16-9_1536x864.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Profiles/16-9_1920x1080.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Profiles/21-9_1920x822.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Profiles/21-9_2880x1200.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Profiles/21-9_3840x1645.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Profiles/21-9_5760x2468.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Profiles/4-5_1920x2400.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Profiles/4-5_2880x3600.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Profiles/4-5_960x1200.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SRWE 2 | Simple Runtime Window Editor (SRWE) - a program that allows you to pick a running 3 | application and manipulate size, position, styles of its main/child windows. 4 | SRWE was built to maintain games that run in Windowed-mode. For example, 5 | you can get the fullscreen-mode effect on a windowed-mode game or get fullscreen effect 6 | with visible taskbar. 7 | Since SRWE allows you to manually set up any window size or position, it can be useful 8 | in taking high-resolution screenshots in games that support windowed-mode. 9 | 10 | ## Hotsampling games for screenshots 11 | 12 | To take screenshots from games it's often better to run the game on a high resolution. This will likely make the game run 13 | slower than normal, but for taking screenshots this is OK. To set the game to a (much) higher resolution, SRWE can be used. 14 | This is called *hotsampling*. Not all games support this feature, however: the game has to resize its *viewport* (the area of 15 | the window which displays the game's graphics) when the game's window (the frame/border around the viewport) is being resized. A lot of 16 | games simply stretch the viewport or create black borders around it. However some games do resize the viewport and for these games 17 | you can use SRWE to resize them when you want to take screenshots. 18 | 19 | To test whether a game supports hotsampling, run the game in windowed mode so you'll have a border around the viewport. Now drag 20 | with the mouse the border to a direction to increase the window size. When you release the left mouse button, the viewport of the game 21 | should resize. If the viewport adapts to the new window size, the game can be hotsampled. Games like Skyrim SE, all frostbyte games, Rise 22 | of the Tomb Raider support hotsampling. 23 | 24 | ### How to hotsample a game 25 | To hotsample a game, it's key to run the game in windowed mode. To do this you have to select this mode in the game's graphics options. 26 | Additionally, you have to run the game as administrator. Now start the game, press alt-tab and as administrator, also start SRWE. In 27 | SRWE, click _Select running Application_ from the toolbar. The window that pops up should enlist the game's .exe process. Select 28 | that process from the list and click _Open_. 29 | 30 | SRWE is now attached to the game window, and you can now manipulate the window. SRWE will show you all kinds of characteristics of the 31 | game's window, like its size, position, but also flags which Windows uses to define how a window looks. These are available on 32 | the 'Windows Styles' tab. For instance, you can change whether the window has a title bar or min/max buttons by checking/unchecking 33 | the checkboxes of `WS_SYSMENU` and `WS_DLGFRAME`. For games these aren't that important. 34 | 35 | To set the game's window to a high resolution, just type the resolution you want in the _Width_ and _Height_ text boxes. SRWE will update 36 | the window immediately. For most games this is enough to set the game window to a higher resolution. If you want to get rid of the 37 | borders around the window, just click the _Remove borders_ button. 38 | 39 | #### EXITSIZEMOVE 40 | 41 | Some games don't seem to work with SRWE, even though they passed the manual resize test. This is because their internal windows handling 42 | code waits for a sign from Windows that the user has finished resizing the window. This sign usually comes when you release the left-mouse 43 | button after manually resizing the windows. These signs are called _messages_. With SRWE we basically trick the window it is attached to 44 | that a user has resized the window manually by sending it these messages, like a size message that the window size has changed. For some 45 | games, this is enough. For other games this isn't enough, they deliberately wait for the 'I'm done!' message. This particularly message is 46 | called `WM_EXITSIZEMOVE`, and you can tell SRWE to send this message as well, by checking the _Force EXITSIZEMOVE after window resize_ 47 | checkbox. 48 | 49 | Some games, like Dragon Age:Inquisition, it's required to check this checkbox. For others, like Rise of the Tomb Raider, 50 | checking this checkbox actually causes resizing the window through SRWE to be stretching. It's therefore a trial/error process whether 51 | to check this checkbox or not. But it's easy to find out (just try whether checking the checkbox helps solve it or not), and SRWE will remember 52 | the state of the checkbox. 53 | 54 | Remember, not all games support hotsampling. SRWE isn't a piece of magic that can enable functionality in a game that's not implemented by its developers: 55 | it simply mimics a user's resize actions on a windowed game. If the game itself doesn't anticipate on resize actions (most games ignore any resize action 56 | on the window, sadly) then SRWE can't add that functionality, only the game developers can. 57 | 58 | ## Profiles 59 | It's of course tedious to type in a resolution each time, clicking borders off/on, etc. To solve that, SRWE allows you to save the 60 | current state of SRWE as a _Profile_. To do this, simply click _Save Profile_. Any saved profile will be added to the list of 61 | _Recent profiles_, so you can quickly pick a profile from that list instead of typing the resolution in again. To get started, 62 | you can choose any of [the profiles in the SRWE repository](https://github.com/dtgDTGdtg/SRWE/tree/master/Profiles), and load these with 63 | the _Load Profile_ button after you've downloaded them and stored them in a folder. Download the profiles from the 64 | [Releases](https://github.com/dtgDTGdtg/SRWE/releases) tab on GitHub in the `SRWE-Example-Profiles.zip` file. They're just examples: if you want to have different 65 | resolutions, just load one of them, alter the resolution and save it under a different name. 66 | 67 | -------------------------------------------------------------------------------- /SRWE.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SRWE", "SRWE\SRWE.csproj", "{FF37255C-B8F8-4866-BB83-0E825A5CB132}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x86 = Debug|x86 11 | Release|x86 = Release|x86 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {FF37255C-B8F8-4866-BB83-0E825A5CB132}.Debug|x86.ActiveCfg = Debug|x86 15 | {FF37255C-B8F8-4866-BB83-0E825A5CB132}.Debug|x86.Build.0 = Debug|x86 16 | {FF37255C-B8F8-4866-BB83-0E825A5CB132}.Release|x86.ActiveCfg = Release|x86 17 | {FF37255C-B8F8-4866-BB83-0E825A5CB132}.Release|x86.Build.0 = Release|x86 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /SRWE.v12.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dtgDTGdtg/SRWE/b439859e15ca44b6c4715fdb015c321a49ef634a/SRWE.v12.suo -------------------------------------------------------------------------------- /SRWE/MainForm.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace SRWE 2 | { 3 | partial class MainForm 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.components = new System.ComponentModel.Container(); 32 | System.Windows.Forms.GroupBox groupBox2; 33 | System.Windows.Forms.GroupBox groupBox3; 34 | System.Windows.Forms.Label label16; 35 | System.Windows.Forms.Label label1; 36 | System.Windows.Forms.Label label15; 37 | System.Windows.Forms.Label label6; 38 | System.Windows.Forms.Label label7; 39 | System.Windows.Forms.Label label8; 40 | System.Windows.Forms.Label label22; 41 | System.Windows.Forms.Label label21; 42 | System.Windows.Forms.Label label14; 43 | System.Windows.Forms.Label label11; 44 | System.Windows.Forms.Label label10; 45 | System.Windows.Forms.Label label9; 46 | System.Windows.Forms.GroupBox groupBox1; 47 | System.Windows.Forms.Label label19; 48 | System.Windows.Forms.Label label5; 49 | System.Windows.Forms.Label label4; 50 | System.Windows.Forms.Label label3; 51 | System.Windows.Forms.Label label2; 52 | System.Windows.Forms.Label label13; 53 | System.Windows.Forms.Label label12; 54 | System.Windows.Forms.GroupBox groupBox4; 55 | System.Windows.Forms.Label label23; 56 | System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); 57 | System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); 58 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); 59 | this.BTN_ALIGN_BOTTOM = new System.Windows.Forms.Button(); 60 | this.BTN_ALIGN_RIGHT = new System.Windows.Forms.Button(); 61 | this.BTN_ALIGN_VCENTER = new System.Windows.Forms.Button(); 62 | this.BTN_ALIGN_TOP = new System.Windows.Forms.Button(); 63 | this.BTN_ALIGN_HCENTER = new System.Windows.Forms.Button(); 64 | this.BTN_ALIGN_LEFT = new System.Windows.Forms.Button(); 65 | this.EDT_CL_WIDTH = new System.Windows.Forms.TextBox(); 66 | this.EDT_CL_HEIGHT = new System.Windows.Forms.TextBox(); 67 | this.EDT_CL_POSY = new System.Windows.Forms.TextBox(); 68 | this.EDT_THREAD_ID = new System.Windows.Forms.TextBox(); 69 | this.EDT_HIER_NUM = new System.Windows.Forms.TextBox(); 70 | this.EDT_BORDER_CY = new System.Windows.Forms.TextBox(); 71 | this.EDT_BORDER_CX = new System.Windows.Forms.TextBox(); 72 | this.EDT_CL_POSX = new System.Windows.Forms.TextBox(); 73 | this.EDT_TEXT = new System.Windows.Forms.TextBox(); 74 | this.EDT_CLASS = new System.Windows.Forms.TextBox(); 75 | this.EDT_HANDLE = new System.Windows.Forms.TextBox(); 76 | this.EDT_WINRC_SCALE = new System.Windows.Forms.TextBox(); 77 | this._setWindowPositionAndSizeButton = new System.Windows.Forms.Button(); 78 | this.EDT_WINRC_Y = new System.Windows.Forms.TextBox(); 79 | this.EDT_WINRC_HEIGHT = new System.Windows.Forms.TextBox(); 80 | this.EDT_WINRC_WIDTH = new System.Windows.Forms.TextBox(); 81 | this.EDT_WINRC_X = new System.Windows.Forms.TextBox(); 82 | this.label20 = new System.Windows.Forms.Label(); 83 | this.EDT_OUTPUT_RESOLUTION = new System.Windows.Forms.TextBox(); 84 | this.EDT_WINRC_ASPRAT = new System.Windows.Forms.ComboBox(); 85 | this._setWindowResolutionFromMegapixels = new System.Windows.Forms.Button(); 86 | this.EDT_WINRC_MPX = new System.Windows.Forms.TextBox(); 87 | this.TS_MAIN = new System.Windows.Forms.ToolStrip(); 88 | this.TSI_OPEN_PROCESS = new System.Windows.Forms.ToolStripButton(); 89 | this.TSI_REFRESH = new System.Windows.Forms.ToolStripButton(); 90 | this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); 91 | this.TSI_PROFILE_LOAD = new System.Windows.Forms.ToolStripButton(); 92 | this.TSI_PROFILE_SAVE = new System.Windows.Forms.ToolStripButton(); 93 | this.TSI_PROFILE_RECENT = new System.Windows.Forms.ToolStripDropDownButton(); 94 | this.TV_WINDOW_TREE = new System.Windows.Forms.TreeView(); 95 | this.TABCTRL_MAIN = new System.Windows.Forms.TabControl(); 96 | this.TABPG_GENERAL = new System.Windows.Forms.TabPage(); 97 | this._autoAttachToLastKnownCheckBox = new System.Windows.Forms.CheckBox(); 98 | this._forceExitSizeMoveCheckBox = new System.Windows.Forms.CheckBox(); 99 | this.BTN_TASKBAR_MODE = new System.Windows.Forms.Button(); 100 | this.BTN_FAKE_FULLSCREEN = new System.Windows.Forms.Button(); 101 | this.BTN_REM_BORDERS = new System.Windows.Forms.Button(); 102 | this.TABPG_STYLES = new System.Windows.Forms.TabPage(); 103 | this.EDT_WSEX_HEX = new System.Windows.Forms.TextBox(); 104 | this.label18 = new System.Windows.Forms.Label(); 105 | this.EDT_WS_HEX = new System.Windows.Forms.TextBox(); 106 | this.label17 = new System.Windows.Forms.Label(); 107 | this.DGV_WS_EX = new System.Windows.Forms.DataGridView(); 108 | this.dataGridViewCheckBoxColumn1 = new System.Windows.Forms.DataGridViewCheckBoxColumn(); 109 | this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn(); 110 | this.DGV_WS = new System.Windows.Forms.DataGridView(); 111 | this.COL_ACTIVATED = new System.Windows.Forms.DataGridViewCheckBoxColumn(); 112 | this.COL_NAME = new System.Windows.Forms.DataGridViewTextBoxColumn(); 113 | this.TIMER_MAIN = new System.Windows.Forms.Timer(this.components); 114 | this.OFD_PROFILE = new System.Windows.Forms.OpenFileDialog(); 115 | this.SFD_PROFILE = new System.Windows.Forms.SaveFileDialog(); 116 | this.TIMER_HOTKEYS = new System.Windows.Forms.Timer(this.components); 117 | this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); 118 | this._aboutLinkLabel = new System.Windows.Forms.LinkLabel(); 119 | groupBox2 = new System.Windows.Forms.GroupBox(); 120 | groupBox3 = new System.Windows.Forms.GroupBox(); 121 | label16 = new System.Windows.Forms.Label(); 122 | label1 = new System.Windows.Forms.Label(); 123 | label15 = new System.Windows.Forms.Label(); 124 | label6 = new System.Windows.Forms.Label(); 125 | label7 = new System.Windows.Forms.Label(); 126 | label8 = new System.Windows.Forms.Label(); 127 | label22 = new System.Windows.Forms.Label(); 128 | label21 = new System.Windows.Forms.Label(); 129 | label14 = new System.Windows.Forms.Label(); 130 | label11 = new System.Windows.Forms.Label(); 131 | label10 = new System.Windows.Forms.Label(); 132 | label9 = new System.Windows.Forms.Label(); 133 | groupBox1 = new System.Windows.Forms.GroupBox(); 134 | label19 = new System.Windows.Forms.Label(); 135 | label5 = new System.Windows.Forms.Label(); 136 | label4 = new System.Windows.Forms.Label(); 137 | label3 = new System.Windows.Forms.Label(); 138 | label2 = new System.Windows.Forms.Label(); 139 | label13 = new System.Windows.Forms.Label(); 140 | label12 = new System.Windows.Forms.Label(); 141 | groupBox4 = new System.Windows.Forms.GroupBox(); 142 | label23 = new System.Windows.Forms.Label(); 143 | groupBox2.SuspendLayout(); 144 | groupBox3.SuspendLayout(); 145 | groupBox1.SuspendLayout(); 146 | groupBox4.SuspendLayout(); 147 | this.TS_MAIN.SuspendLayout(); 148 | this.TABCTRL_MAIN.SuspendLayout(); 149 | this.TABPG_GENERAL.SuspendLayout(); 150 | this.TABPG_STYLES.SuspendLayout(); 151 | ((System.ComponentModel.ISupportInitialize)(this.DGV_WS_EX)).BeginInit(); 152 | ((System.ComponentModel.ISupportInitialize)(this.DGV_WS)).BeginInit(); 153 | this.SuspendLayout(); 154 | // 155 | // groupBox2 156 | // 157 | groupBox2.Controls.Add(this.BTN_ALIGN_BOTTOM); 158 | groupBox2.Controls.Add(this.BTN_ALIGN_RIGHT); 159 | groupBox2.Controls.Add(this.BTN_ALIGN_VCENTER); 160 | groupBox2.Controls.Add(this.BTN_ALIGN_TOP); 161 | groupBox2.Controls.Add(this.BTN_ALIGN_HCENTER); 162 | groupBox2.Controls.Add(this.BTN_ALIGN_LEFT); 163 | groupBox2.Location = new System.Drawing.Point(6, 232); 164 | groupBox2.Name = "groupBox2"; 165 | groupBox2.Size = new System.Drawing.Size(282, 87); 166 | groupBox2.TabIndex = 2; 167 | groupBox2.TabStop = false; 168 | groupBox2.Text = "Align Window"; 169 | // 170 | // BTN_ALIGN_BOTTOM 171 | // 172 | this.BTN_ALIGN_BOTTOM.Location = new System.Drawing.Point(187, 50); 173 | this.BTN_ALIGN_BOTTOM.Name = "BTN_ALIGN_BOTTOM"; 174 | this.BTN_ALIGN_BOTTOM.Size = new System.Drawing.Size(80, 23); 175 | this.BTN_ALIGN_BOTTOM.TabIndex = 5; 176 | this.BTN_ALIGN_BOTTOM.Text = "Bottom"; 177 | this.BTN_ALIGN_BOTTOM.UseVisualStyleBackColor = true; 178 | this.BTN_ALIGN_BOTTOM.Click += new System.EventHandler(this.BTN_ALIGN_BOTTOM_Click); 179 | // 180 | // BTN_ALIGN_RIGHT 181 | // 182 | this.BTN_ALIGN_RIGHT.Location = new System.Drawing.Point(187, 21); 183 | this.BTN_ALIGN_RIGHT.Name = "BTN_ALIGN_RIGHT"; 184 | this.BTN_ALIGN_RIGHT.Size = new System.Drawing.Size(80, 23); 185 | this.BTN_ALIGN_RIGHT.TabIndex = 2; 186 | this.BTN_ALIGN_RIGHT.Text = "Right"; 187 | this.BTN_ALIGN_RIGHT.UseVisualStyleBackColor = true; 188 | this.BTN_ALIGN_RIGHT.Click += new System.EventHandler(this.BTN_ALIGN_RIGHT_Click); 189 | // 190 | // BTN_ALIGN_VCENTER 191 | // 192 | this.BTN_ALIGN_VCENTER.Location = new System.Drawing.Point(101, 50); 193 | this.BTN_ALIGN_VCENTER.Name = "BTN_ALIGN_VCENTER"; 194 | this.BTN_ALIGN_VCENTER.Size = new System.Drawing.Size(80, 23); 195 | this.BTN_ALIGN_VCENTER.TabIndex = 4; 196 | this.BTN_ALIGN_VCENTER.Text = "V.Center"; 197 | this.BTN_ALIGN_VCENTER.UseVisualStyleBackColor = true; 198 | this.BTN_ALIGN_VCENTER.Click += new System.EventHandler(this.BTN_ALIGN_VCENTER_Click); 199 | // 200 | // BTN_ALIGN_TOP 201 | // 202 | this.BTN_ALIGN_TOP.Location = new System.Drawing.Point(15, 50); 203 | this.BTN_ALIGN_TOP.Name = "BTN_ALIGN_TOP"; 204 | this.BTN_ALIGN_TOP.Size = new System.Drawing.Size(80, 23); 205 | this.BTN_ALIGN_TOP.TabIndex = 3; 206 | this.BTN_ALIGN_TOP.Text = "Top"; 207 | this.BTN_ALIGN_TOP.UseVisualStyleBackColor = true; 208 | this.BTN_ALIGN_TOP.Click += new System.EventHandler(this.BTN_ALIGN_TOP_Click); 209 | // 210 | // BTN_ALIGN_HCENTER 211 | // 212 | this.BTN_ALIGN_HCENTER.Location = new System.Drawing.Point(101, 21); 213 | this.BTN_ALIGN_HCENTER.Name = "BTN_ALIGN_HCENTER"; 214 | this.BTN_ALIGN_HCENTER.Size = new System.Drawing.Size(80, 23); 215 | this.BTN_ALIGN_HCENTER.TabIndex = 1; 216 | this.BTN_ALIGN_HCENTER.Text = "H.Center"; 217 | this.BTN_ALIGN_HCENTER.UseVisualStyleBackColor = true; 218 | this.BTN_ALIGN_HCENTER.Click += new System.EventHandler(this.BTN_ALIGN_HCENTER_Click); 219 | // 220 | // BTN_ALIGN_LEFT 221 | // 222 | this.BTN_ALIGN_LEFT.Location = new System.Drawing.Point(15, 21); 223 | this.BTN_ALIGN_LEFT.Name = "BTN_ALIGN_LEFT"; 224 | this.BTN_ALIGN_LEFT.Size = new System.Drawing.Size(80, 23); 225 | this.BTN_ALIGN_LEFT.TabIndex = 0; 226 | this.BTN_ALIGN_LEFT.Text = "Left"; 227 | this.BTN_ALIGN_LEFT.UseVisualStyleBackColor = true; 228 | this.BTN_ALIGN_LEFT.Click += new System.EventHandler(this.BTN_ALIGN_LEFT_Click); 229 | // 230 | // groupBox3 231 | // 232 | groupBox3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 233 | | System.Windows.Forms.AnchorStyles.Right))); 234 | groupBox3.Controls.Add(label16); 235 | groupBox3.Controls.Add(label1); 236 | groupBox3.Controls.Add(label15); 237 | groupBox3.Controls.Add(this.EDT_CL_WIDTH); 238 | groupBox3.Controls.Add(this.EDT_CL_HEIGHT); 239 | groupBox3.Controls.Add(this.EDT_CL_POSY); 240 | groupBox3.Controls.Add(this.EDT_THREAD_ID); 241 | groupBox3.Controls.Add(this.EDT_HIER_NUM); 242 | groupBox3.Controls.Add(this.EDT_BORDER_CY); 243 | groupBox3.Controls.Add(this.EDT_BORDER_CX); 244 | groupBox3.Controls.Add(this.EDT_CL_POSX); 245 | groupBox3.Controls.Add(label6); 246 | groupBox3.Controls.Add(label7); 247 | groupBox3.Controls.Add(label8); 248 | groupBox3.Controls.Add(label22); 249 | groupBox3.Controls.Add(label21); 250 | groupBox3.Controls.Add(label14); 251 | groupBox3.Controls.Add(label11); 252 | groupBox3.Controls.Add(label10); 253 | groupBox3.Controls.Add(label9); 254 | groupBox3.Controls.Add(this.EDT_TEXT); 255 | groupBox3.Controls.Add(this.EDT_CLASS); 256 | groupBox3.Controls.Add(this.EDT_HANDLE); 257 | groupBox3.Location = new System.Drawing.Point(464, 8); 258 | groupBox3.Name = "groupBox3"; 259 | groupBox3.Size = new System.Drawing.Size(310, 502); 260 | groupBox3.TabIndex = 8; 261 | groupBox3.TabStop = false; 262 | groupBox3.Text = "Window Info"; 263 | // 264 | // label16 265 | // 266 | label16.AutoSize = true; 267 | label16.Location = new System.Drawing.Point(6, 174); 268 | label16.Margin = new System.Windows.Forms.Padding(3, 16, 3, 5); 269 | label16.Name = "label16"; 270 | label16.Size = new System.Drawing.Size(161, 14); 271 | label16.TabIndex = 0; 272 | label16.Text = "Client area position and size:"; 273 | // 274 | // label1 275 | // 276 | label1.AutoSize = true; 277 | label1.Location = new System.Drawing.Point(27, 136); 278 | label1.Name = "label1"; 279 | label1.Size = new System.Drawing.Size(66, 14); 280 | label1.TabIndex = 0; 281 | label1.Text = "Thread ID:"; 282 | // 283 | // label15 284 | // 285 | label15.AutoSize = true; 286 | label15.Location = new System.Drawing.Point(6, 108); 287 | label15.Name = "label15"; 288 | label15.Size = new System.Drawing.Size(87, 14); 289 | label15.TabIndex = 0; 290 | label15.Text = "Hierarchical ID:"; 291 | // 292 | // EDT_CL_WIDTH 293 | // 294 | this.EDT_CL_WIDTH.Location = new System.Drawing.Point(207, 196); 295 | this.EDT_CL_WIDTH.Margin = new System.Windows.Forms.Padding(3, 3, 8, 3); 296 | this.EDT_CL_WIDTH.MaxLength = 8; 297 | this.EDT_CL_WIDTH.Name = "EDT_CL_WIDTH"; 298 | this.EDT_CL_WIDTH.ReadOnly = true; 299 | this.EDT_CL_WIDTH.Size = new System.Drawing.Size(80, 22); 300 | this.EDT_CL_WIDTH.TabIndex = 6; 301 | this.EDT_CL_WIDTH.TabStop = false; 302 | this.EDT_CL_WIDTH.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; 303 | // 304 | // EDT_CL_HEIGHT 305 | // 306 | this.EDT_CL_HEIGHT.Location = new System.Drawing.Point(207, 224); 307 | this.EDT_CL_HEIGHT.Margin = new System.Windows.Forms.Padding(3, 3, 3, 8); 308 | this.EDT_CL_HEIGHT.MaxLength = 8; 309 | this.EDT_CL_HEIGHT.Name = "EDT_CL_HEIGHT"; 310 | this.EDT_CL_HEIGHT.ReadOnly = true; 311 | this.EDT_CL_HEIGHT.Size = new System.Drawing.Size(80, 22); 312 | this.EDT_CL_HEIGHT.TabIndex = 8; 313 | this.EDT_CL_HEIGHT.TabStop = false; 314 | this.EDT_CL_HEIGHT.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; 315 | // 316 | // EDT_CL_POSY 317 | // 318 | this.EDT_CL_POSY.Location = new System.Drawing.Point(49, 224); 319 | this.EDT_CL_POSY.MaxLength = 8; 320 | this.EDT_CL_POSY.Name = "EDT_CL_POSY"; 321 | this.EDT_CL_POSY.ReadOnly = true; 322 | this.EDT_CL_POSY.Size = new System.Drawing.Size(80, 22); 323 | this.EDT_CL_POSY.TabIndex = 7; 324 | this.EDT_CL_POSY.TabStop = false; 325 | this.EDT_CL_POSY.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; 326 | // 327 | // EDT_THREAD_ID 328 | // 329 | this.EDT_THREAD_ID.Location = new System.Drawing.Point(99, 133); 330 | this.EDT_THREAD_ID.MaxLength = 8; 331 | this.EDT_THREAD_ID.Name = "EDT_THREAD_ID"; 332 | this.EDT_THREAD_ID.ReadOnly = true; 333 | this.EDT_THREAD_ID.Size = new System.Drawing.Size(80, 22); 334 | this.EDT_THREAD_ID.TabIndex = 4; 335 | this.EDT_THREAD_ID.TabStop = false; 336 | // 337 | // EDT_HIER_NUM 338 | // 339 | this.EDT_HIER_NUM.Location = new System.Drawing.Point(99, 105); 340 | this.EDT_HIER_NUM.MaxLength = 8; 341 | this.EDT_HIER_NUM.Name = "EDT_HIER_NUM"; 342 | this.EDT_HIER_NUM.ReadOnly = true; 343 | this.EDT_HIER_NUM.Size = new System.Drawing.Size(80, 22); 344 | this.EDT_HIER_NUM.TabIndex = 3; 345 | this.EDT_HIER_NUM.TabStop = false; 346 | // 347 | // EDT_BORDER_CY 348 | // 349 | this.EDT_BORDER_CY.Location = new System.Drawing.Point(207, 295); 350 | this.EDT_BORDER_CY.MaxLength = 8; 351 | this.EDT_BORDER_CY.Name = "EDT_BORDER_CY"; 352 | this.EDT_BORDER_CY.ReadOnly = true; 353 | this.EDT_BORDER_CY.Size = new System.Drawing.Size(80, 22); 354 | this.EDT_BORDER_CY.TabIndex = 10; 355 | this.EDT_BORDER_CY.TabStop = false; 356 | this.EDT_BORDER_CY.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; 357 | // 358 | // EDT_BORDER_CX 359 | // 360 | this.EDT_BORDER_CX.Location = new System.Drawing.Point(207, 267); 361 | this.EDT_BORDER_CX.Margin = new System.Windows.Forms.Padding(3, 13, 3, 3); 362 | this.EDT_BORDER_CX.MaxLength = 8; 363 | this.EDT_BORDER_CX.Name = "EDT_BORDER_CX"; 364 | this.EDT_BORDER_CX.ReadOnly = true; 365 | this.EDT_BORDER_CX.Size = new System.Drawing.Size(80, 22); 366 | this.EDT_BORDER_CX.TabIndex = 9; 367 | this.EDT_BORDER_CX.TabStop = false; 368 | this.EDT_BORDER_CX.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; 369 | // 370 | // EDT_CL_POSX 371 | // 372 | this.EDT_CL_POSX.Location = new System.Drawing.Point(49, 196); 373 | this.EDT_CL_POSX.MaxLength = 8; 374 | this.EDT_CL_POSX.Name = "EDT_CL_POSX"; 375 | this.EDT_CL_POSX.ReadOnly = true; 376 | this.EDT_CL_POSX.Size = new System.Drawing.Size(80, 22); 377 | this.EDT_CL_POSX.TabIndex = 5; 378 | this.EDT_CL_POSX.TabStop = false; 379 | this.EDT_CL_POSX.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; 380 | // 381 | // label6 382 | // 383 | label6.AutoSize = true; 384 | label6.Location = new System.Drawing.Point(154, 227); 385 | label6.Margin = new System.Windows.Forms.Padding(8, 0, 3, 0); 386 | label6.Name = "label6"; 387 | label6.Size = new System.Drawing.Size(47, 14); 388 | label6.TabIndex = 0; 389 | label6.Text = "Height:"; 390 | // 391 | // label7 392 | // 393 | label7.AutoSize = true; 394 | label7.Location = new System.Drawing.Point(157, 199); 395 | label7.Name = "label7"; 396 | label7.Size = new System.Drawing.Size(44, 14); 397 | label7.TabIndex = 0; 398 | label7.Text = "Width:"; 399 | // 400 | // label8 401 | // 402 | label8.AutoSize = true; 403 | label8.Location = new System.Drawing.Point(24, 227); 404 | label8.Name = "label8"; 405 | label8.Size = new System.Drawing.Size(19, 14); 406 | label8.TabIndex = 0; 407 | label8.Text = "Y:"; 408 | // 409 | // label22 410 | // 411 | label22.AutoSize = true; 412 | label22.Location = new System.Drawing.Point(113, 298); 413 | label22.Margin = new System.Windows.Forms.Padding(8, 0, 3, 0); 414 | label22.Name = "label22"; 415 | label22.Size = new System.Drawing.Size(87, 14); 416 | label22.TabIndex = 0; 417 | label22.Text = "Border Height:"; 418 | // 419 | // label21 420 | // 421 | label21.AutoSize = true; 422 | label21.Location = new System.Drawing.Point(116, 270); 423 | label21.Margin = new System.Windows.Forms.Padding(8, 0, 3, 0); 424 | label21.Name = "label21"; 425 | label21.Size = new System.Drawing.Size(84, 14); 426 | label21.TabIndex = 0; 427 | label21.Text = "Border Width:"; 428 | // 429 | // label14 430 | // 431 | label14.AutoSize = true; 432 | label14.Location = new System.Drawing.Point(25, 199); 433 | label14.Margin = new System.Windows.Forms.Padding(8, 0, 3, 0); 434 | label14.Name = "label14"; 435 | label14.Size = new System.Drawing.Size(18, 14); 436 | label14.TabIndex = 0; 437 | label14.Text = "X:"; 438 | // 439 | // label11 440 | // 441 | label11.AutoSize = true; 442 | label11.Location = new System.Drawing.Point(57, 52); 443 | label11.Margin = new System.Windows.Forms.Padding(8, 0, 3, 0); 444 | label11.Name = "label11"; 445 | label11.Size = new System.Drawing.Size(36, 14); 446 | label11.TabIndex = 0; 447 | label11.Text = "Class:"; 448 | // 449 | // label10 450 | // 451 | label10.AutoSize = true; 452 | label10.Location = new System.Drawing.Point(56, 80); 453 | label10.Margin = new System.Windows.Forms.Padding(8, 0, 3, 0); 454 | label10.Name = "label10"; 455 | label10.Size = new System.Drawing.Size(37, 14); 456 | label10.TabIndex = 0; 457 | label10.Text = "Text:"; 458 | // 459 | // label9 460 | // 461 | label9.AutoSize = true; 462 | label9.Location = new System.Drawing.Point(45, 24); 463 | label9.Margin = new System.Windows.Forms.Padding(8, 0, 3, 0); 464 | label9.Name = "label9"; 465 | label9.Size = new System.Drawing.Size(48, 14); 466 | label9.TabIndex = 0; 467 | label9.Text = "Handle:"; 468 | // 469 | // EDT_TEXT 470 | // 471 | this.EDT_TEXT.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 472 | | System.Windows.Forms.AnchorStyles.Right))); 473 | this.EDT_TEXT.Location = new System.Drawing.Point(99, 77); 474 | this.EDT_TEXT.MaxLength = 256; 475 | this.EDT_TEXT.Name = "EDT_TEXT"; 476 | this.EDT_TEXT.ReadOnly = true; 477 | this.EDT_TEXT.Size = new System.Drawing.Size(199, 22); 478 | this.EDT_TEXT.TabIndex = 2; 479 | this.EDT_TEXT.TabStop = false; 480 | // 481 | // EDT_CLASS 482 | // 483 | this.EDT_CLASS.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 484 | | System.Windows.Forms.AnchorStyles.Right))); 485 | this.EDT_CLASS.Location = new System.Drawing.Point(99, 49); 486 | this.EDT_CLASS.Margin = new System.Windows.Forms.Padding(3, 3, 8, 3); 487 | this.EDT_CLASS.MaxLength = 256; 488 | this.EDT_CLASS.Name = "EDT_CLASS"; 489 | this.EDT_CLASS.ReadOnly = true; 490 | this.EDT_CLASS.Size = new System.Drawing.Size(199, 22); 491 | this.EDT_CLASS.TabIndex = 1; 492 | this.EDT_CLASS.TabStop = false; 493 | // 494 | // EDT_HANDLE 495 | // 496 | this.EDT_HANDLE.Location = new System.Drawing.Point(99, 21); 497 | this.EDT_HANDLE.MaxLength = 8; 498 | this.EDT_HANDLE.Name = "EDT_HANDLE"; 499 | this.EDT_HANDLE.ReadOnly = true; 500 | this.EDT_HANDLE.Size = new System.Drawing.Size(96, 22); 501 | this.EDT_HANDLE.TabIndex = 0; 502 | this.EDT_HANDLE.TabStop = false; 503 | // 504 | // groupBox1 505 | // 506 | groupBox1.Controls.Add(this.EDT_WINRC_SCALE); 507 | groupBox1.Controls.Add(label19); 508 | groupBox1.Controls.Add(this._setWindowPositionAndSizeButton); 509 | groupBox1.Controls.Add(this.EDT_WINRC_Y); 510 | groupBox1.Controls.Add(this.EDT_WINRC_HEIGHT); 511 | groupBox1.Controls.Add(this.EDT_WINRC_WIDTH); 512 | groupBox1.Controls.Add(this.EDT_WINRC_X); 513 | groupBox1.Controls.Add(label5); 514 | groupBox1.Controls.Add(label4); 515 | groupBox1.Controls.Add(label3); 516 | groupBox1.Controls.Add(label2); 517 | groupBox1.Location = new System.Drawing.Point(6, 8); 518 | groupBox1.Name = "groupBox1"; 519 | groupBox1.Size = new System.Drawing.Size(429, 91); 520 | groupBox1.TabIndex = 0; 521 | groupBox1.TabStop = false; 522 | groupBox1.Text = "Window position and size:"; 523 | // 524 | // EDT_WINRC_SCALE 525 | // 526 | this.EDT_WINRC_SCALE.Location = new System.Drawing.Point(324, 29); 527 | this.EDT_WINRC_SCALE.MaxLength = 6; 528 | this.EDT_WINRC_SCALE.Name = "EDT_WINRC_SCALE"; 529 | this.EDT_WINRC_SCALE.Size = new System.Drawing.Size(80, 22); 530 | this.EDT_WINRC_SCALE.TabIndex = 4; 531 | this.EDT_WINRC_SCALE.Text = "1"; 532 | this.EDT_WINRC_SCALE.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; 533 | this.EDT_WINRC_SCALE.TextChanged += new System.EventHandler(this.EDT_WINRC_TextChanged); 534 | // 535 | // label19 536 | // 537 | label19.AutoSize = true; 538 | label19.Location = new System.Drawing.Point(279, 32); 539 | label19.Name = "label19"; 540 | label19.Size = new System.Drawing.Size(39, 14); 541 | label19.TabIndex = 5; 542 | label19.Text = "Scale:"; 543 | // 544 | // _setWindowPositionAndSizeButton 545 | // 546 | this._setWindowPositionAndSizeButton.Location = new System.Drawing.Point(361, 57); 547 | this._setWindowPositionAndSizeButton.Name = "_setWindowPositionAndSizeButton"; 548 | this._setWindowPositionAndSizeButton.Size = new System.Drawing.Size(43, 23); 549 | this._setWindowPositionAndSizeButton.TabIndex = 5; 550 | this._setWindowPositionAndSizeButton.Text = "Set"; 551 | this._setWindowPositionAndSizeButton.UseVisualStyleBackColor = true; 552 | this._setWindowPositionAndSizeButton.Click += new System.EventHandler(this._setWindowPositionAndSizeButton_Click); 553 | // 554 | // EDT_WINRC_Y 555 | // 556 | this.EDT_WINRC_Y.Location = new System.Drawing.Point(31, 59); 557 | this.EDT_WINRC_Y.MaxLength = 6; 558 | this.EDT_WINRC_Y.Name = "EDT_WINRC_Y"; 559 | this.EDT_WINRC_Y.Size = new System.Drawing.Size(80, 22); 560 | this.EDT_WINRC_Y.TabIndex = 1; 561 | this.EDT_WINRC_Y.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; 562 | this.EDT_WINRC_Y.TextChanged += new System.EventHandler(this.EDT_WINRC_TextChanged); 563 | // 564 | // EDT_WINRC_HEIGHT 565 | // 566 | this.EDT_WINRC_HEIGHT.Location = new System.Drawing.Point(186, 59); 567 | this.EDT_WINRC_HEIGHT.MaxLength = 6; 568 | this.EDT_WINRC_HEIGHT.Name = "EDT_WINRC_HEIGHT"; 569 | this.EDT_WINRC_HEIGHT.Size = new System.Drawing.Size(80, 22); 570 | this.EDT_WINRC_HEIGHT.TabIndex = 3; 571 | this.EDT_WINRC_HEIGHT.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; 572 | this.EDT_WINRC_HEIGHT.TextChanged += new System.EventHandler(this.EDT_WINRC_TextChanged); 573 | // 574 | // EDT_WINRC_WIDTH 575 | // 576 | this.EDT_WINRC_WIDTH.Location = new System.Drawing.Point(186, 29); 577 | this.EDT_WINRC_WIDTH.MaxLength = 6; 578 | this.EDT_WINRC_WIDTH.Name = "EDT_WINRC_WIDTH"; 579 | this.EDT_WINRC_WIDTH.Size = new System.Drawing.Size(80, 22); 580 | this.EDT_WINRC_WIDTH.TabIndex = 2; 581 | this.EDT_WINRC_WIDTH.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; 582 | this.EDT_WINRC_WIDTH.TextChanged += new System.EventHandler(this.EDT_WINRC_TextChanged); 583 | // 584 | // EDT_WINRC_X 585 | // 586 | this.EDT_WINRC_X.Location = new System.Drawing.Point(31, 29); 587 | this.EDT_WINRC_X.MaxLength = 6; 588 | this.EDT_WINRC_X.Name = "EDT_WINRC_X"; 589 | this.EDT_WINRC_X.Size = new System.Drawing.Size(80, 22); 590 | this.EDT_WINRC_X.TabIndex = 0; 591 | this.EDT_WINRC_X.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; 592 | this.EDT_WINRC_X.TextChanged += new System.EventHandler(this.EDT_WINRC_TextChanged); 593 | // 594 | // label5 595 | // 596 | label5.AutoSize = true; 597 | label5.Location = new System.Drawing.Point(133, 62); 598 | label5.Name = "label5"; 599 | label5.Size = new System.Drawing.Size(47, 14); 600 | label5.TabIndex = 0; 601 | label5.Text = "Height:"; 602 | // 603 | // label4 604 | // 605 | label4.AutoSize = true; 606 | label4.Location = new System.Drawing.Point(136, 32); 607 | label4.Name = "label4"; 608 | label4.Size = new System.Drawing.Size(44, 14); 609 | label4.TabIndex = 0; 610 | label4.Text = "Width:"; 611 | // 612 | // label3 613 | // 614 | label3.AutoSize = true; 615 | label3.Location = new System.Drawing.Point(6, 62); 616 | label3.Name = "label3"; 617 | label3.Size = new System.Drawing.Size(19, 14); 618 | label3.TabIndex = 0; 619 | label3.Text = "Y:"; 620 | // 621 | // label2 622 | // 623 | label2.AutoSize = true; 624 | label2.Location = new System.Drawing.Point(6, 32); 625 | label2.Name = "label2"; 626 | label2.Size = new System.Drawing.Size(18, 14); 627 | label2.TabIndex = 0; 628 | label2.Text = "X:"; 629 | // 630 | // label13 631 | // 632 | label13.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 633 | label13.AutoSize = true; 634 | label13.Location = new System.Drawing.Point(310, 7); 635 | label13.Margin = new System.Windows.Forms.Padding(8, 0, 3, 0); 636 | label13.Name = "label13"; 637 | label13.Size = new System.Drawing.Size(149, 14); 638 | label13.TabIndex = 0; 639 | label13.Text = "Extended Window Styles:"; 640 | // 641 | // label12 642 | // 643 | label12.AutoSize = true; 644 | label12.Location = new System.Drawing.Point(8, 7); 645 | label12.Margin = new System.Windows.Forms.Padding(8, 16, 3, 0); 646 | label12.Name = "label12"; 647 | label12.Size = new System.Drawing.Size(92, 14); 648 | label12.TabIndex = 0; 649 | label12.Text = "Window Styles:"; 650 | // 651 | // groupBox4 652 | // 653 | groupBox4.Controls.Add(this.label20); 654 | groupBox4.Controls.Add(this.EDT_OUTPUT_RESOLUTION); 655 | groupBox4.Controls.Add(this.EDT_WINRC_ASPRAT); 656 | groupBox4.Controls.Add(this._setWindowResolutionFromMegapixels); 657 | groupBox4.Controls.Add(this.EDT_WINRC_MPX); 658 | groupBox4.Controls.Add(label23); 659 | groupBox4.Location = new System.Drawing.Point(6, 116); 660 | groupBox4.Name = "groupBox4"; 661 | groupBox4.Size = new System.Drawing.Size(429, 91); 662 | groupBox4.TabIndex = 1; 663 | groupBox4.TabStop = false; 664 | groupBox4.Text = "Window scaling from megapixels"; 665 | // 666 | // label20 667 | // 668 | this.label20.AutoSize = true; 669 | this.label20.Location = new System.Drawing.Point(177, 30); 670 | this.label20.Name = "label20"; 671 | this.label20.Size = new System.Drawing.Size(111, 14); 672 | this.label20.TabIndex = 10; 673 | this.label20.Text = "Output Resolution:"; 674 | // 675 | // EDT_OUTPUT_RESOLUTION 676 | // 677 | this.EDT_OUTPUT_RESOLUTION.Location = new System.Drawing.Point(294, 25); 678 | this.EDT_OUTPUT_RESOLUTION.Name = "EDT_OUTPUT_RESOLUTION"; 679 | this.EDT_OUTPUT_RESOLUTION.ReadOnly = true; 680 | this.EDT_OUTPUT_RESOLUTION.Size = new System.Drawing.Size(110, 22); 681 | this.EDT_OUTPUT_RESOLUTION.TabIndex = 9; 682 | // 683 | // EDT_WINRC_ASPRAT 684 | // 685 | this.EDT_WINRC_ASPRAT.FormattingEnabled = true; 686 | this.EDT_WINRC_ASPRAT.Items.AddRange(new object[] { 687 | "1:1", 688 | "16:10", 689 | "16:9", 690 | "21:9", 691 | "4:5"}); 692 | this.EDT_WINRC_ASPRAT.Location = new System.Drawing.Point(77, 27); 693 | this.EDT_WINRC_ASPRAT.Name = "EDT_WINRC_ASPRAT"; 694 | this.EDT_WINRC_ASPRAT.Size = new System.Drawing.Size(80, 22); 695 | this.EDT_WINRC_ASPRAT.Sorted = true; 696 | this.EDT_WINRC_ASPRAT.TabIndex = 0; 697 | this.EDT_WINRC_ASPRAT.Text = "1:1"; 698 | // 699 | // _setWindowResolutionFromMegapixels 700 | // 701 | this._setWindowResolutionFromMegapixels.Location = new System.Drawing.Point(361, 57); 702 | this._setWindowResolutionFromMegapixels.Name = "_setWindowResolutionFromMegapixels"; 703 | this._setWindowResolutionFromMegapixels.Size = new System.Drawing.Size(43, 23); 704 | this._setWindowResolutionFromMegapixels.TabIndex = 2; 705 | this._setWindowResolutionFromMegapixels.Text = "Set"; 706 | this._setWindowResolutionFromMegapixels.UseVisualStyleBackColor = true; 707 | this._setWindowResolutionFromMegapixels.Click += new System.EventHandler(this._setWindowResolutionFromMegapixels_Click); 708 | // 709 | // EDT_WINRC_MPX 710 | // 711 | this.EDT_WINRC_MPX.Location = new System.Drawing.Point(77, 58); 712 | this.EDT_WINRC_MPX.MaxLength = 6; 713 | this.EDT_WINRC_MPX.Name = "EDT_WINRC_MPX"; 714 | this.EDT_WINRC_MPX.Size = new System.Drawing.Size(80, 22); 715 | this.EDT_WINRC_MPX.TabIndex = 1; 716 | this.EDT_WINRC_MPX.Text = "3"; 717 | this.EDT_WINRC_MPX.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; 718 | this.EDT_WINRC_MPX.TextChanged += new System.EventHandler(this.EDT_WINRC_TextChanged); 719 | // 720 | // label23 721 | // 722 | label23.AutoSize = true; 723 | label23.Location = new System.Drawing.Point(6, 62); 724 | label23.Name = "label23"; 725 | label23.Size = new System.Drawing.Size(69, 14); 726 | label23.TabIndex = 0; 727 | label23.Text = "Megapixels:"; 728 | // 729 | // TS_MAIN 730 | // 731 | this.TS_MAIN.Font = new System.Drawing.Font("Tahoma", 9F); 732 | this.TS_MAIN.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { 733 | this.TSI_OPEN_PROCESS, 734 | this.TSI_REFRESH, 735 | this.toolStripSeparator1, 736 | this.TSI_PROFILE_LOAD, 737 | this.TSI_PROFILE_SAVE, 738 | this.TSI_PROFILE_RECENT}); 739 | this.TS_MAIN.Location = new System.Drawing.Point(0, 0); 740 | this.TS_MAIN.Name = "TS_MAIN"; 741 | this.TS_MAIN.Size = new System.Drawing.Size(1082, 25); 742 | this.TS_MAIN.TabIndex = 0; 743 | this.TS_MAIN.Text = "Main Toolbar"; 744 | // 745 | // TSI_OPEN_PROCESS 746 | // 747 | this.TSI_OPEN_PROCESS.Image = global::SRWE.Properties.Resources.Application_EXE; 748 | this.TSI_OPEN_PROCESS.ImageTransparentColor = System.Drawing.Color.Magenta; 749 | this.TSI_OPEN_PROCESS.Name = "TSI_OPEN_PROCESS"; 750 | this.TSI_OPEN_PROCESS.Size = new System.Drawing.Size(169, 22); 751 | this.TSI_OPEN_PROCESS.Text = "&Select running Application"; 752 | this.TSI_OPEN_PROCESS.Click += new System.EventHandler(this.TSI_OPEN_PROCESS_Click); 753 | // 754 | // TSI_REFRESH 755 | // 756 | this.TSI_REFRESH.Image = global::SRWE.Properties.Resources.RefreshTree; 757 | this.TSI_REFRESH.ImageTransparentColor = System.Drawing.Color.Magenta; 758 | this.TSI_REFRESH.Name = "TSI_REFRESH"; 759 | this.TSI_REFRESH.Size = new System.Drawing.Size(147, 22); 760 | this.TSI_REFRESH.Text = "&Refresh Window Tree"; 761 | this.TSI_REFRESH.Click += new System.EventHandler(this.TSI_REFRESH_Click); 762 | this.TSI_REFRESH.EnabledChanged += new System.EventHandler(this.TSI_REFRESH_EnabledChanged); 763 | // 764 | // toolStripSeparator1 765 | // 766 | this.toolStripSeparator1.Name = "toolStripSeparator1"; 767 | this.toolStripSeparator1.Size = new System.Drawing.Size(6, 25); 768 | // 769 | // TSI_PROFILE_LOAD 770 | // 771 | this.TSI_PROFILE_LOAD.Image = global::SRWE.Properties.Resources.LoadProfile; 772 | this.TSI_PROFILE_LOAD.ImageTransparentColor = System.Drawing.Color.Magenta; 773 | this.TSI_PROFILE_LOAD.Name = "TSI_PROFILE_LOAD"; 774 | this.TSI_PROFILE_LOAD.Size = new System.Drawing.Size(90, 22); 775 | this.TSI_PROFILE_LOAD.Text = "&Load Profile"; 776 | this.TSI_PROFILE_LOAD.Click += new System.EventHandler(this.TSI_PROFILE_LOAD_Click); 777 | // 778 | // TSI_PROFILE_SAVE 779 | // 780 | this.TSI_PROFILE_SAVE.Image = global::SRWE.Properties.Resources.SaveProfile; 781 | this.TSI_PROFILE_SAVE.ImageTransparentColor = System.Drawing.Color.Magenta; 782 | this.TSI_PROFILE_SAVE.Name = "TSI_PROFILE_SAVE"; 783 | this.TSI_PROFILE_SAVE.Size = new System.Drawing.Size(90, 22); 784 | this.TSI_PROFILE_SAVE.Text = "&Save Profile"; 785 | this.TSI_PROFILE_SAVE.Click += new System.EventHandler(this.TSI_PROFILE_SAVE_Click); 786 | // 787 | // TSI_PROFILE_RECENT 788 | // 789 | this.TSI_PROFILE_RECENT.Image = global::SRWE.Properties.Resources.Recent; 790 | this.TSI_PROFILE_RECENT.ImageTransparentColor = System.Drawing.Color.Magenta; 791 | this.TSI_PROFILE_RECENT.Name = "TSI_PROFILE_RECENT"; 792 | this.TSI_PROFILE_RECENT.Size = new System.Drawing.Size(117, 22); 793 | this.TSI_PROFILE_RECENT.Text = "Recent &Profiles"; 794 | // 795 | // TV_WINDOW_TREE 796 | // 797 | this.TV_WINDOW_TREE.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 798 | | System.Windows.Forms.AnchorStyles.Left))); 799 | this.TV_WINDOW_TREE.CheckBoxes = true; 800 | this.TV_WINDOW_TREE.HideSelection = false; 801 | this.TV_WINDOW_TREE.Location = new System.Drawing.Point(12, 28); 802 | this.TV_WINDOW_TREE.Name = "TV_WINDOW_TREE"; 803 | this.TV_WINDOW_TREE.Size = new System.Drawing.Size(264, 564); 804 | this.TV_WINDOW_TREE.TabIndex = 1; 805 | this.TV_WINDOW_TREE.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.TV_WINDOW_TREE_AfterCheck); 806 | this.TV_WINDOW_TREE.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.TV_WINDOW_TREE_AfterSelect); 807 | // 808 | // TABCTRL_MAIN 809 | // 810 | this.TABCTRL_MAIN.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 811 | | System.Windows.Forms.AnchorStyles.Left) 812 | | System.Windows.Forms.AnchorStyles.Right))); 813 | this.TABCTRL_MAIN.Controls.Add(this.TABPG_GENERAL); 814 | this.TABCTRL_MAIN.Controls.Add(this.TABPG_STYLES); 815 | this.TABCTRL_MAIN.Location = new System.Drawing.Point(282, 28); 816 | this.TABCTRL_MAIN.Name = "TABCTRL_MAIN"; 817 | this.TABCTRL_MAIN.SelectedIndex = 0; 818 | this.TABCTRL_MAIN.Size = new System.Drawing.Size(788, 545); 819 | this.TABCTRL_MAIN.TabIndex = 2; 820 | this.TABCTRL_MAIN.SelectedIndexChanged += new System.EventHandler(this.TABCTRL_MAIN_SelectedIndexChanged); 821 | // 822 | // TABPG_GENERAL 823 | // 824 | this.TABPG_GENERAL.Controls.Add(this._autoAttachToLastKnownCheckBox); 825 | this.TABPG_GENERAL.Controls.Add(this._forceExitSizeMoveCheckBox); 826 | this.TABPG_GENERAL.Controls.Add(groupBox2); 827 | this.TABPG_GENERAL.Controls.Add(groupBox3); 828 | this.TABPG_GENERAL.Controls.Add(this.BTN_TASKBAR_MODE); 829 | this.TABPG_GENERAL.Controls.Add(this.BTN_FAKE_FULLSCREEN); 830 | this.TABPG_GENERAL.Controls.Add(this.BTN_REM_BORDERS); 831 | this.TABPG_GENERAL.Controls.Add(groupBox4); 832 | this.TABPG_GENERAL.Controls.Add(groupBox1); 833 | this.TABPG_GENERAL.Location = new System.Drawing.Point(4, 23); 834 | this.TABPG_GENERAL.Name = "TABPG_GENERAL"; 835 | this.TABPG_GENERAL.Padding = new System.Windows.Forms.Padding(3); 836 | this.TABPG_GENERAL.Size = new System.Drawing.Size(780, 518); 837 | this.TABPG_GENERAL.TabIndex = 0; 838 | this.TABPG_GENERAL.Text = "General"; 839 | this.TABPG_GENERAL.UseVisualStyleBackColor = true; 840 | // 841 | // _autoAttachToLastKnownCheckBox 842 | // 843 | this._autoAttachToLastKnownCheckBox.AutoSize = true; 844 | this._autoAttachToLastKnownCheckBox.Location = new System.Drawing.Point(21, 372); 845 | this._autoAttachToLastKnownCheckBox.Name = "_autoAttachToLastKnownCheckBox"; 846 | this._autoAttachToLastKnownCheckBox.Size = new System.Drawing.Size(216, 18); 847 | this._autoAttachToLastKnownCheckBox.TabIndex = 4; 848 | this._autoAttachToLastKnownCheckBox.Text = "Auto-attach to last known process"; 849 | this.toolTip1.SetToolTip(this._autoAttachToLastKnownCheckBox, "Check this checkbox if you want SRWE to attach automatically at startup to the la" + 850 | "st process known"); 851 | this._autoAttachToLastKnownCheckBox.UseVisualStyleBackColor = true; 852 | this._autoAttachToLastKnownCheckBox.CheckedChanged += new System.EventHandler(this._autoAttachToLastKnownCheckBox_CheckedChanged); 853 | // 854 | // _forceExitSizeMoveCheckBox 855 | // 856 | this._forceExitSizeMoveCheckBox.AutoSize = true; 857 | this._forceExitSizeMoveCheckBox.Location = new System.Drawing.Point(21, 348); 858 | this._forceExitSizeMoveCheckBox.Name = "_forceExitSizeMoveCheckBox"; 859 | this._forceExitSizeMoveCheckBox.Size = new System.Drawing.Size(255, 18); 860 | this._forceExitSizeMoveCheckBox.TabIndex = 3; 861 | this._forceExitSizeMoveCheckBox.Text = "Force EXITSIZEMOVE after window resize"; 862 | this.toolTip1.SetToolTip(this._forceExitSizeMoveCheckBox, "Check this checkbox if, after window resizing, the game stretches the viewport in" + 863 | "stead of resizing it (so it\'s pixelated). Sometimes required for Frostbyte games" + 864 | " like Dragon Age:Inquisition"); 865 | this._forceExitSizeMoveCheckBox.UseVisualStyleBackColor = true; 866 | this._forceExitSizeMoveCheckBox.CheckedChanged += new System.EventHandler(this._forceExitSizeMoveCheckBox_CheckedChanged); 867 | // 868 | // BTN_TASKBAR_MODE 869 | // 870 | this.BTN_TASKBAR_MODE.Location = new System.Drawing.Point(67, 470); 871 | this.BTN_TASKBAR_MODE.Name = "BTN_TASKBAR_MODE"; 872 | this.BTN_TASKBAR_MODE.Size = new System.Drawing.Size(160, 25); 873 | this.BTN_TASKBAR_MODE.TabIndex = 7; 874 | this.BTN_TASKBAR_MODE.Text = "&Taskbar mode"; 875 | this.BTN_TASKBAR_MODE.UseVisualStyleBackColor = true; 876 | this.BTN_TASKBAR_MODE.Click += new System.EventHandler(this.BTN_TASKBAR_MODE_Click); 877 | // 878 | // BTN_FAKE_FULLSCREEN 879 | // 880 | this.BTN_FAKE_FULLSCREEN.Location = new System.Drawing.Point(67, 439); 881 | this.BTN_FAKE_FULLSCREEN.Name = "BTN_FAKE_FULLSCREEN"; 882 | this.BTN_FAKE_FULLSCREEN.Size = new System.Drawing.Size(160, 25); 883 | this.BTN_FAKE_FULLSCREEN.TabIndex = 6; 884 | this.BTN_FAKE_FULLSCREEN.Text = "&Fake fullscreen"; 885 | this.BTN_FAKE_FULLSCREEN.UseVisualStyleBackColor = true; 886 | this.BTN_FAKE_FULLSCREEN.Click += new System.EventHandler(this.BTN_FAKE_FULLSCREEN_Click); 887 | // 888 | // BTN_REM_BORDERS 889 | // 890 | this.BTN_REM_BORDERS.Location = new System.Drawing.Point(67, 408); 891 | this.BTN_REM_BORDERS.Name = "BTN_REM_BORDERS"; 892 | this.BTN_REM_BORDERS.Size = new System.Drawing.Size(160, 25); 893 | this.BTN_REM_BORDERS.TabIndex = 5; 894 | this.BTN_REM_BORDERS.Text = "Remove &borders"; 895 | this.BTN_REM_BORDERS.UseVisualStyleBackColor = true; 896 | this.BTN_REM_BORDERS.Click += new System.EventHandler(this.BTN_REM_BORDERS_Click); 897 | // 898 | // TABPG_STYLES 899 | // 900 | this.TABPG_STYLES.Controls.Add(this.EDT_WSEX_HEX); 901 | this.TABPG_STYLES.Controls.Add(this.label18); 902 | this.TABPG_STYLES.Controls.Add(this.EDT_WS_HEX); 903 | this.TABPG_STYLES.Controls.Add(this.label17); 904 | this.TABPG_STYLES.Controls.Add(this.DGV_WS_EX); 905 | this.TABPG_STYLES.Controls.Add(this.DGV_WS); 906 | this.TABPG_STYLES.Controls.Add(label13); 907 | this.TABPG_STYLES.Controls.Add(label12); 908 | this.TABPG_STYLES.Location = new System.Drawing.Point(4, 22); 909 | this.TABPG_STYLES.Name = "TABPG_STYLES"; 910 | this.TABPG_STYLES.Padding = new System.Windows.Forms.Padding(3); 911 | this.TABPG_STYLES.Size = new System.Drawing.Size(780, 519); 912 | this.TABPG_STYLES.TabIndex = 2; 913 | this.TABPG_STYLES.Text = "Window Styles"; 914 | this.TABPG_STYLES.UseVisualStyleBackColor = true; 915 | // 916 | // EDT_WSEX_HEX 917 | // 918 | this.EDT_WSEX_HEX.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 919 | this.EDT_WSEX_HEX.Location = new System.Drawing.Point(507, 328); 920 | this.EDT_WSEX_HEX.MaxLength = 10; 921 | this.EDT_WSEX_HEX.Name = "EDT_WSEX_HEX"; 922 | this.EDT_WSEX_HEX.Size = new System.Drawing.Size(96, 22); 923 | this.EDT_WSEX_HEX.TabIndex = 4; 924 | this.EDT_WSEX_HEX.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; 925 | this.EDT_WSEX_HEX.TextChanged += new System.EventHandler(this.EDT_WSEX_HEX_TextChanged); 926 | // 927 | // label18 928 | // 929 | this.label18.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 930 | this.label18.AutoSize = true; 931 | this.label18.Location = new System.Drawing.Point(438, 331); 932 | this.label18.Name = "label18"; 933 | this.label18.Size = new System.Drawing.Size(63, 14); 934 | this.label18.TabIndex = 0; 935 | this.label18.Text = "Hex code:"; 936 | // 937 | // EDT_WS_HEX 938 | // 939 | this.EDT_WS_HEX.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 940 | this.EDT_WS_HEX.Location = new System.Drawing.Point(205, 328); 941 | this.EDT_WS_HEX.MaxLength = 10; 942 | this.EDT_WS_HEX.Name = "EDT_WS_HEX"; 943 | this.EDT_WS_HEX.Size = new System.Drawing.Size(96, 22); 944 | this.EDT_WS_HEX.TabIndex = 3; 945 | this.EDT_WS_HEX.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; 946 | this.EDT_WS_HEX.TextChanged += new System.EventHandler(this.EDT_WS_HEX_TextChanged); 947 | // 948 | // label17 949 | // 950 | this.label17.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 951 | this.label17.AutoSize = true; 952 | this.label17.Location = new System.Drawing.Point(136, 331); 953 | this.label17.Name = "label17"; 954 | this.label17.Size = new System.Drawing.Size(63, 14); 955 | this.label17.TabIndex = 0; 956 | this.label17.Text = "Hex code:"; 957 | // 958 | // DGV_WS_EX 959 | // 960 | this.DGV_WS_EX.AllowUserToAddRows = false; 961 | this.DGV_WS_EX.AllowUserToDeleteRows = false; 962 | this.DGV_WS_EX.AllowUserToResizeRows = false; 963 | this.DGV_WS_EX.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 964 | | System.Windows.Forms.AnchorStyles.Right))); 965 | dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; 966 | dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control; 967 | dataGridViewCellStyle1.Font = new System.Drawing.Font("Tahoma", 9F); 968 | dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText; 969 | dataGridViewCellStyle1.Padding = new System.Windows.Forms.Padding(0, 3, 0, 4); 970 | dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight; 971 | dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText; 972 | dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True; 973 | this.DGV_WS_EX.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1; 974 | this.DGV_WS_EX.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; 975 | this.DGV_WS_EX.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { 976 | this.dataGridViewCheckBoxColumn1, 977 | this.dataGridViewTextBoxColumn1}); 978 | this.DGV_WS_EX.Location = new System.Drawing.Point(309, 25); 979 | this.DGV_WS_EX.Margin = new System.Windows.Forms.Padding(4); 980 | this.DGV_WS_EX.Name = "DGV_WS_EX"; 981 | this.DGV_WS_EX.RowHeadersVisible = false; 982 | this.DGV_WS_EX.Size = new System.Drawing.Size(294, 296); 983 | this.DGV_WS_EX.TabIndex = 2; 984 | this.DGV_WS_EX.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.DGV_WS_EX_CellContentClick); 985 | this.DGV_WS_EX.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.DGV_WS_EX_CellDoubleClick); 986 | this.DGV_WS_EX.KeyUp += new System.Windows.Forms.KeyEventHandler(this.DGV_WS_EX_KeyUp); 987 | // 988 | // dataGridViewCheckBoxColumn1 989 | // 990 | this.dataGridViewCheckBoxColumn1.DataPropertyName = "Activated"; 991 | this.dataGridViewCheckBoxColumn1.HeaderText = ""; 992 | this.dataGridViewCheckBoxColumn1.Name = "dataGridViewCheckBoxColumn1"; 993 | this.dataGridViewCheckBoxColumn1.Width = 24; 994 | // 995 | // dataGridViewTextBoxColumn1 996 | // 997 | this.dataGridViewTextBoxColumn1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; 998 | this.dataGridViewTextBoxColumn1.DataPropertyName = "Name"; 999 | this.dataGridViewTextBoxColumn1.HeaderText = "Extended Style Name"; 1000 | this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1"; 1001 | this.dataGridViewTextBoxColumn1.ReadOnly = true; 1002 | // 1003 | // DGV_WS 1004 | // 1005 | this.DGV_WS.AllowUserToAddRows = false; 1006 | this.DGV_WS.AllowUserToDeleteRows = false; 1007 | this.DGV_WS.AllowUserToResizeRows = false; 1008 | this.DGV_WS.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 1009 | | System.Windows.Forms.AnchorStyles.Left) 1010 | | System.Windows.Forms.AnchorStyles.Right))); 1011 | dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; 1012 | dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control; 1013 | dataGridViewCellStyle2.Font = new System.Drawing.Font("Tahoma", 9F); 1014 | dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText; 1015 | dataGridViewCellStyle2.Padding = new System.Windows.Forms.Padding(0, 3, 0, 4); 1016 | dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight; 1017 | dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText; 1018 | dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True; 1019 | this.DGV_WS.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2; 1020 | this.DGV_WS.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; 1021 | this.DGV_WS.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { 1022 | this.COL_ACTIVATED, 1023 | this.COL_NAME}); 1024 | this.DGV_WS.Location = new System.Drawing.Point(7, 25); 1025 | this.DGV_WS.Margin = new System.Windows.Forms.Padding(4); 1026 | this.DGV_WS.Name = "DGV_WS"; 1027 | this.DGV_WS.RowHeadersVisible = false; 1028 | this.DGV_WS.Size = new System.Drawing.Size(294, 296); 1029 | this.DGV_WS.TabIndex = 1; 1030 | this.DGV_WS.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.DGV_WS_CellContentClick); 1031 | this.DGV_WS.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.DGV_WS_CellDoubleClick); 1032 | this.DGV_WS.KeyUp += new System.Windows.Forms.KeyEventHandler(this.DGV_WS_KeyUp); 1033 | // 1034 | // COL_ACTIVATED 1035 | // 1036 | this.COL_ACTIVATED.DataPropertyName = "Activated"; 1037 | this.COL_ACTIVATED.HeaderText = ""; 1038 | this.COL_ACTIVATED.Name = "COL_ACTIVATED"; 1039 | this.COL_ACTIVATED.Width = 24; 1040 | // 1041 | // COL_NAME 1042 | // 1043 | this.COL_NAME.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; 1044 | this.COL_NAME.DataPropertyName = "Name"; 1045 | this.COL_NAME.HeaderText = "Style Name"; 1046 | this.COL_NAME.Name = "COL_NAME"; 1047 | this.COL_NAME.ReadOnly = true; 1048 | // 1049 | // TIMER_MAIN 1050 | // 1051 | this.TIMER_MAIN.Enabled = true; 1052 | this.TIMER_MAIN.Interval = 1000; 1053 | this.TIMER_MAIN.Tick += new System.EventHandler(this.TIMER_MAIN_Tick); 1054 | // 1055 | // OFD_PROFILE 1056 | // 1057 | this.OFD_PROFILE.Filter = "SRWE Profile(*.xml)|*.xml|All Files(*.*)|*.*"; 1058 | this.OFD_PROFILE.Title = "Load SRWE Profile"; 1059 | // 1060 | // SFD_PROFILE 1061 | // 1062 | this.SFD_PROFILE.Filter = "SRWE Profile(*.xml)|*.xml|All Files(*.*)|*.*"; 1063 | this.SFD_PROFILE.Title = "Save SRWE Profile"; 1064 | // 1065 | // TIMER_HOTKEYS 1066 | // 1067 | this.TIMER_HOTKEYS.Enabled = true; 1068 | this.TIMER_HOTKEYS.Interval = 200; 1069 | this.TIMER_HOTKEYS.Tick += new System.EventHandler(this.TIMER_HOTKEYS_Tick); 1070 | // 1071 | // toolTip1 1072 | // 1073 | this.toolTip1.AutomaticDelay = 200; 1074 | this.toolTip1.AutoPopDelay = 7000; 1075 | this.toolTip1.InitialDelay = 200; 1076 | this.toolTip1.ReshowDelay = 40; 1077 | // 1078 | // _aboutLinkLabel 1079 | // 1080 | this._aboutLinkLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 1081 | this._aboutLinkLabel.AutoSize = true; 1082 | this._aboutLinkLabel.Location = new System.Drawing.Point(282, 576); 1083 | this._aboutLinkLabel.Name = "_aboutLinkLabel"; 1084 | this._aboutLinkLabel.Size = new System.Drawing.Size(51, 14); 1085 | this._aboutLinkLabel.TabIndex = 3; 1086 | this._aboutLinkLabel.TabStop = true; 1087 | this._aboutLinkLabel.Text = "[About]"; 1088 | this.toolTip1.SetToolTip(this._aboutLinkLabel, "Visit SRWE on GitHub: https://github.com/dtgDTGdtg/SRWE"); 1089 | this._aboutLinkLabel.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this._aboutLinkLabel_LinkClicked); 1090 | // 1091 | // MainForm 1092 | // 1093 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; 1094 | this.ClientSize = new System.Drawing.Size(1082, 604); 1095 | this.Controls.Add(this._aboutLinkLabel); 1096 | this.Controls.Add(this.TABCTRL_MAIN); 1097 | this.Controls.Add(this.TV_WINDOW_TREE); 1098 | this.Controls.Add(this.TS_MAIN); 1099 | this.Font = new System.Drawing.Font("Tahoma", 9F); 1100 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); 1101 | this.MaximizeBox = false; 1102 | this.Name = "MainForm"; 1103 | this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; 1104 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; 1105 | this.Text = "Simple Runtime Window Editor"; 1106 | this.Activated += new System.EventHandler(this.MainForm_Activated); 1107 | this.Load += new System.EventHandler(this.MainForm_Load); 1108 | groupBox2.ResumeLayout(false); 1109 | groupBox3.ResumeLayout(false); 1110 | groupBox3.PerformLayout(); 1111 | groupBox1.ResumeLayout(false); 1112 | groupBox1.PerformLayout(); 1113 | groupBox4.ResumeLayout(false); 1114 | groupBox4.PerformLayout(); 1115 | this.TS_MAIN.ResumeLayout(false); 1116 | this.TS_MAIN.PerformLayout(); 1117 | this.TABCTRL_MAIN.ResumeLayout(false); 1118 | this.TABPG_GENERAL.ResumeLayout(false); 1119 | this.TABPG_GENERAL.PerformLayout(); 1120 | this.TABPG_STYLES.ResumeLayout(false); 1121 | this.TABPG_STYLES.PerformLayout(); 1122 | ((System.ComponentModel.ISupportInitialize)(this.DGV_WS_EX)).EndInit(); 1123 | ((System.ComponentModel.ISupportInitialize)(this.DGV_WS)).EndInit(); 1124 | this.ResumeLayout(false); 1125 | this.PerformLayout(); 1126 | 1127 | } 1128 | 1129 | #endregion 1130 | 1131 | private System.Windows.Forms.ToolStrip TS_MAIN; 1132 | private System.Windows.Forms.ToolStripButton TSI_OPEN_PROCESS; 1133 | private System.Windows.Forms.ToolStripButton TSI_REFRESH; 1134 | private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; 1135 | private System.Windows.Forms.ToolStripButton TSI_PROFILE_LOAD; 1136 | private System.Windows.Forms.ToolStripButton TSI_PROFILE_SAVE; 1137 | private System.Windows.Forms.ToolStripDropDownButton TSI_PROFILE_RECENT; 1138 | private System.Windows.Forms.TreeView TV_WINDOW_TREE; 1139 | private System.Windows.Forms.TabControl TABCTRL_MAIN; 1140 | private System.Windows.Forms.TabPage TABPG_GENERAL; 1141 | private System.Windows.Forms.Button BTN_ALIGN_BOTTOM; 1142 | private System.Windows.Forms.Button BTN_ALIGN_RIGHT; 1143 | private System.Windows.Forms.Button BTN_ALIGN_VCENTER; 1144 | private System.Windows.Forms.Button BTN_ALIGN_TOP; 1145 | private System.Windows.Forms.Button BTN_ALIGN_HCENTER; 1146 | private System.Windows.Forms.Button BTN_ALIGN_LEFT; 1147 | private System.Windows.Forms.TextBox EDT_CL_WIDTH; 1148 | private System.Windows.Forms.TextBox EDT_CL_HEIGHT; 1149 | private System.Windows.Forms.TextBox EDT_CL_POSY; 1150 | private System.Windows.Forms.TextBox EDT_THREAD_ID; 1151 | private System.Windows.Forms.TextBox EDT_HIER_NUM; 1152 | private System.Windows.Forms.TextBox EDT_BORDER_CY; 1153 | private System.Windows.Forms.TextBox EDT_BORDER_CX; 1154 | private System.Windows.Forms.TextBox EDT_CL_POSX; 1155 | private System.Windows.Forms.TextBox EDT_TEXT; 1156 | private System.Windows.Forms.TextBox EDT_CLASS; 1157 | private System.Windows.Forms.TextBox EDT_HANDLE; 1158 | private System.Windows.Forms.Button BTN_TASKBAR_MODE; 1159 | private System.Windows.Forms.Button BTN_FAKE_FULLSCREEN; 1160 | private System.Windows.Forms.Button BTN_REM_BORDERS; 1161 | private System.Windows.Forms.TextBox EDT_WINRC_Y; 1162 | private System.Windows.Forms.TextBox EDT_WINRC_HEIGHT; 1163 | private System.Windows.Forms.TextBox EDT_WINRC_WIDTH; 1164 | private System.Windows.Forms.TextBox EDT_WINRC_X; 1165 | private System.Windows.Forms.TabPage TABPG_STYLES; 1166 | private System.Windows.Forms.TextBox EDT_WSEX_HEX; 1167 | private System.Windows.Forms.Label label18; 1168 | private System.Windows.Forms.TextBox EDT_WS_HEX; 1169 | private System.Windows.Forms.Label label17; 1170 | private System.Windows.Forms.DataGridView DGV_WS_EX; 1171 | private System.Windows.Forms.DataGridViewCheckBoxColumn dataGridViewCheckBoxColumn1; 1172 | private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn1; 1173 | private System.Windows.Forms.DataGridView DGV_WS; 1174 | private System.Windows.Forms.DataGridViewCheckBoxColumn COL_ACTIVATED; 1175 | private System.Windows.Forms.DataGridViewTextBoxColumn COL_NAME; 1176 | private System.Windows.Forms.Timer TIMER_MAIN; 1177 | private System.Windows.Forms.OpenFileDialog OFD_PROFILE; 1178 | private System.Windows.Forms.SaveFileDialog SFD_PROFILE; 1179 | private System.Windows.Forms.Timer TIMER_HOTKEYS; 1180 | private System.Windows.Forms.CheckBox _forceExitSizeMoveCheckBox; 1181 | private System.Windows.Forms.ToolTip toolTip1; 1182 | private System.Windows.Forms.LinkLabel _aboutLinkLabel; 1183 | private System.Windows.Forms.CheckBox _autoAttachToLastKnownCheckBox; 1184 | private System.Windows.Forms.Button _setWindowPositionAndSizeButton; 1185 | private System.Windows.Forms.TextBox EDT_WINRC_SCALE; 1186 | private System.Windows.Forms.Button _setWindowResolutionFromMegapixels; 1187 | private System.Windows.Forms.TextBox EDT_WINRC_MPX; 1188 | private System.Windows.Forms.ComboBox EDT_WINRC_ASPRAT; 1189 | private System.Windows.Forms.Label label20; 1190 | private System.Windows.Forms.TextBox EDT_OUTPUT_RESOLUTION; 1191 | } 1192 | } 1193 | -------------------------------------------------------------------------------- /SRWE/MainForm.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Text; 7 | using System.Windows.Forms; 8 | using System.Diagnostics; 9 | using System.IO; 10 | using System.Xml; 11 | using System.Xml.XPath; 12 | using System.Linq; 13 | 14 | namespace SRWE 15 | { 16 | public partial class MainForm : Form 17 | { 18 | [Flags] 19 | private enum States 20 | { 21 | None = 0, 22 | SkipRefreshData = 1, 23 | UpdateWindowRect = 2, 24 | UpdateWindowStyle = 4, 25 | UpdateWindowExStyle = 8, 26 | IgnoreChangedEvents = 0x10, 27 | SkipUpdateGUI = 0x20, 28 | FixMultipleActivatedCalls = 0x40 29 | } 30 | 31 | private Process m_selectedProcess; 32 | private States m_states; 33 | private DataTable m_dtWS; 34 | private DataTable m_dtWS_EX; 35 | private bool _windowSizeSpecificationManuallyChanged = false; 36 | 37 | public MainForm() 38 | { 39 | InitializeComponent(); 40 | this.MinimumSize = this.Size; 41 | 42 | m_states = States.None; 43 | 44 | OFD_PROFILE.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory); 45 | SFD_PROFILE.InitialDirectory = OFD_PROFILE.InitialDirectory; 46 | TIMER_MAIN.Interval = SRWE_Settings.UpdateInterval; 47 | 48 | // initialize Recent profile menu with proper default elements 49 | for(int i = 0; i < SRWE_Defaults.MaxNumberOfRecentProfiles; i++) 50 | { 51 | var toAdd = new ToolStripMenuItem() { 52 | Name = "TSMI_PROFILE1", 53 | Text = "Profile-" + i 54 | }; 55 | toAdd.Click += new System.EventHandler(this.TSMI_PROFILE_Click); 56 | this.TSI_PROFILE_RECENT.DropDownItems.Add(toAdd); 57 | } 58 | InitializeWindowStyles(); 59 | } 60 | 61 | #region Events 62 | private void MainForm_Load(object sender, EventArgs e) 63 | { 64 | _aboutLinkLabel.Text = Application.ProductName + " v" + Application.ProductVersion + ". © _DTG_ / Others"; 65 | ReflectSettingsInUI(); 66 | UpdateCaption(); 67 | RefreshRecentProfilesMenu(); 68 | AutoAttachToLastProcess(); 69 | } 70 | 71 | private void AutoAttachToLastProcess() 72 | { 73 | if(!SRWE_Settings.AutoAttachToLastKnownProcess) 74 | { 75 | return; 76 | } 77 | var moduleNameToProcess = new Dictionary(); 78 | foreach(var process in Process.GetProcesses()) 79 | { 80 | if(moduleNameToProcess.ContainsKey(process.ProcessName)) 81 | { 82 | continue; 83 | } 84 | moduleNameToProcess[process.ProcessName] = process; 85 | } 86 | foreach(var lastAttachedProcess in SRWE_Settings.RecentProcesses) 87 | { 88 | Process activeProcess = null; 89 | if(moduleNameToProcess.TryGetValue(lastAttachedProcess, out activeProcess)) 90 | { 91 | // process is active. Attach to it! 92 | AttachToProcess(activeProcess); 93 | break; 94 | } 95 | } 96 | } 97 | 98 | private void MainForm_Activated(object sender, EventArgs e) 99 | { 100 | if ((m_states & States.FixMultipleActivatedCalls) != 0) return; 101 | 102 | m_states |= States.FixMultipleActivatedCalls; 103 | 104 | UpdateGUI(false); 105 | RefreshData(false); 106 | } 107 | 108 | 109 | private void _forceExitSizeMoveCheckBox_CheckedChanged(object sender, EventArgs e) 110 | { 111 | SRWE_Settings.ForceExitSizeMoveMessage = _forceExitSizeMoveCheckBox.Checked; 112 | } 113 | 114 | 115 | private void _aboutLinkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) 116 | { 117 | Process.Start("https://github.com/dtgDTGdtg/SRWE"); 118 | } 119 | 120 | private void _autoAttachToLastKnownCheckBox_CheckedChanged(object sender, EventArgs e) 121 | { 122 | SRWE_Settings.AutoAttachToLastKnownProcess = _autoAttachToLastKnownCheckBox.Checked; 123 | } 124 | 125 | private void TIMER_MAIN_Tick(object sender, EventArgs e) 126 | { 127 | if (!this.ContainsFocus) return; 128 | 129 | UpdateGUI(true); 130 | 131 | if ((m_states & States.UpdateWindowStyle) != 0) 132 | UpdateWindowStyles(false); 133 | if ((m_states & States.UpdateWindowExStyle) != 0) 134 | UpdateWindowStyles(true); 135 | 136 | RefreshData(true); 137 | } 138 | 139 | private void TSI_OPEN_PROCESS_Click(object sender, EventArgs e) 140 | { 141 | OpenProcessDialog opd = new OpenProcessDialog(); 142 | 143 | if (opd.ShowDialog(this) == System.Windows.Forms.DialogResult.OK) 144 | { 145 | AttachToProcess(opd.SelectedProcess); 146 | } 147 | } 148 | 149 | private void AttachToProcess(Process toAttachTo) 150 | { 151 | m_selectedProcess = toAttachTo; 152 | UpdateCaption(); 153 | UpdateWindowTree(); 154 | SRWE_Settings.AddRecentProcess(m_selectedProcess.ProcessName); 155 | } 156 | 157 | private void TSI_REFRESH_Click(object sender, EventArgs e) 158 | { 159 | UpdateWindowTree(); 160 | } 161 | 162 | private void TSI_PROFILE_LOAD_Click(object sender, EventArgs e) 163 | { 164 | if (OFD_PROFILE.ShowDialog(this) != System.Windows.Forms.DialogResult.OK) return; 165 | 166 | XPathDocument xpDoc = new XPathDocument(OFD_PROFILE.FileName); 167 | XPathNavigator navProfile = xpDoc.CreateNavigator().SelectSingleNode("SRWE/Profile"); 168 | XPathNodeIterator iterator = navProfile.Select("Window"); 169 | 170 | UncheckTreeViewNodes(TV_WINDOW_TREE.Nodes); 171 | 172 | while (iterator.MoveNext()) 173 | UpdateWindowFromProfile(iterator.Current); 174 | 175 | SRWE_Settings.AddRecentProfile(OFD_PROFILE.FileName); 176 | RefreshRecentProfilesMenu(); 177 | } 178 | 179 | private void TSI_PROFILE_SAVE_Click(object sender, EventArgs e) 180 | { 181 | if (SFD_PROFILE.ShowDialog(this) != System.Windows.Forms.DialogResult.OK) return; 182 | 183 | MemoryStream ms = new MemoryStream(Properties.Resources.XML_Profile); 184 | XmlDocument xmlDoc = new XmlDocument(); 185 | xmlDoc.Load(ms); 186 | ms.Close(); 187 | 188 | XmlElement xmlProfile = xmlDoc.DocumentElement["Profile"]; 189 | AddWindowsToProfile(xmlProfile, TV_WINDOW_TREE.Nodes); 190 | xmlDoc.Save(SFD_PROFILE.FileName); 191 | 192 | SRWE_Settings.AddRecentProfile(SFD_PROFILE.FileName); 193 | RefreshRecentProfilesMenu(); 194 | } 195 | 196 | private void TSMI_PROFILE_Click(object sender, EventArgs e) 197 | { 198 | string profilePath = (sender as ToolStripDropDownItem).ToolTipText; 199 | 200 | if (File.Exists(profilePath)) 201 | { 202 | XPathDocument xpDoc = new XPathDocument(profilePath); 203 | XPathNavigator navProfile = xpDoc.CreateNavigator().SelectSingleNode("SRWE/Profile"); 204 | XPathNodeIterator iterator = navProfile.Select("Window"); 205 | 206 | UncheckTreeViewNodes(TV_WINDOW_TREE.Nodes); 207 | 208 | while (iterator.MoveNext()) 209 | UpdateWindowFromProfile(iterator.Current); 210 | 211 | SRWE_Settings.AddRecentProfile(profilePath); // Brings profile to TOP of the Recent Profiles list. 212 | } 213 | else 214 | SRWE_Settings.RemoveRecentProfile(profilePath); 215 | 216 | RefreshRecentProfilesMenu(); 217 | } 218 | 219 | private void TV_WINDOW_TREE_AfterSelect(object sender, TreeViewEventArgs e) 220 | { 221 | _windowSizeSpecificationManuallyChanged = false; 222 | UpdateGUI(false); 223 | RefreshData(false); 224 | } 225 | 226 | private void TV_WINDOW_TREE_AfterCheck(object sender, TreeViewEventArgs e) 227 | { 228 | _windowSizeSpecificationManuallyChanged = false; 229 | UpdateGUI(false); 230 | } 231 | 232 | private void TABCTRL_MAIN_SelectedIndexChanged(object sender, EventArgs e) 233 | { 234 | // Tab page change 235 | UpdateGUI(false); 236 | RefreshData(false); 237 | } 238 | 239 | private void EDT_WINRC_TextChanged(object sender, EventArgs e) 240 | { 241 | if ((m_states & States.IgnoreChangedEvents) != 0) return; 242 | 243 | m_states |= States.UpdateWindowRect; 244 | _windowSizeSpecificationManuallyChanged = true; 245 | } 246 | 247 | private void BTN_ALIGN_LEFT_Click(object sender, EventArgs e) 248 | { 249 | if (TV_WINDOW_TREE.SelectedNode == null) return; 250 | 251 | Window win = (Window)TV_WINDOW_TREE.SelectedNode.Tag; 252 | 253 | if (win.Parent == null) 254 | win.PosX = Screen.PrimaryScreen.WorkingArea.Left; 255 | else 256 | win.PosX = 0; 257 | 258 | win.ApplyChanges(); 259 | } 260 | 261 | private void BTN_ALIGN_HCENTER_Click(object sender, EventArgs e) 262 | { 263 | Window win = (Window)TV_WINDOW_TREE.SelectedNode.Tag; 264 | 265 | if (win.Parent == null) 266 | win.PosX = (Screen.PrimaryScreen.WorkingArea.Width - win.Width) / 2; 267 | else 268 | { 269 | win.Parent.RefreshRectangles(); 270 | win.PosX = (win.Parent.ClientRect.Width - win.Width) / 2; 271 | } 272 | win.ApplyChanges(); 273 | } 274 | 275 | private void BTN_ALIGN_RIGHT_Click(object sender, EventArgs e) 276 | { 277 | Window win = (Window)TV_WINDOW_TREE.SelectedNode.Tag; 278 | 279 | if (win.Parent == null) 280 | win.PosX = Screen.PrimaryScreen.WorkingArea.Width - win.Width; 281 | else 282 | { 283 | win.Parent.RefreshRectangles(); 284 | win.PosX = win.Parent.ClientRect.Width - win.Width; 285 | } 286 | win.ApplyChanges(); 287 | } 288 | 289 | private void BTN_ALIGN_TOP_Click(object sender, EventArgs e) 290 | { 291 | Window win = (Window)TV_WINDOW_TREE.SelectedNode.Tag; 292 | 293 | if (win.Parent == null) 294 | win.PosY = Screen.PrimaryScreen.WorkingArea.Top; 295 | else 296 | win.PosY = 0; 297 | 298 | win.ApplyChanges(); 299 | } 300 | 301 | private void BTN_ALIGN_VCENTER_Click(object sender, EventArgs e) 302 | { 303 | Window win = (Window)TV_WINDOW_TREE.SelectedNode.Tag; 304 | 305 | if (win.Parent == null) 306 | win.PosY = (Screen.PrimaryScreen.WorkingArea.Height - win.Height) / 2; 307 | else 308 | { 309 | win.Parent.RefreshRectangles(); 310 | win.PosY = (win.Parent.ClientRect.Height - win.Height) / 2; 311 | } 312 | win.ApplyChanges(); 313 | } 314 | 315 | private void BTN_ALIGN_BOTTOM_Click(object sender, EventArgs e) 316 | { 317 | Window win = (Window)TV_WINDOW_TREE.SelectedNode.Tag; 318 | 319 | if (win.Parent == null) 320 | win.PosY = Screen.PrimaryScreen.WorkingArea.Height - win.Height; 321 | else 322 | { 323 | win.Parent.RefreshRectangles(); 324 | win.PosY = win.Parent.ClientRect.Height - win.Height; 325 | } 326 | win.ApplyChanges(); 327 | } 328 | 329 | private void BTN_REM_BORDERS_Click(object sender, EventArgs e) 330 | { 331 | if (TV_WINDOW_TREE.SelectedNode == null) return; 332 | 333 | (TV_WINDOW_TREE.SelectedNode.Tag as Window).RemoveBorders(); 334 | } 335 | 336 | private void BTN_FAKE_FULLSCREEN_Click(object sender, EventArgs e) 337 | { 338 | if (TV_WINDOW_TREE.SelectedNode == null) return; 339 | 340 | Window win = (Window)TV_WINDOW_TREE.SelectedNode.Tag; 341 | 342 | if (win.Parent == null) 343 | { 344 | win.PosX = 0; 345 | win.PosY = 0; 346 | win.Width = Screen.PrimaryScreen.Bounds.Width; 347 | win.Height = Screen.PrimaryScreen.Bounds.Height; 348 | win.ApplyChanges(); 349 | } 350 | } 351 | 352 | private void BTN_TASKBAR_MODE_Click(object sender, EventArgs e) 353 | { 354 | if (TV_WINDOW_TREE.SelectedNode == null) return; 355 | 356 | Window win = (Window)TV_WINDOW_TREE.SelectedNode.Tag; 357 | 358 | if (win.Parent == null) 359 | { 360 | win.PosX = Screen.PrimaryScreen.WorkingArea.Left; 361 | win.PosY = Screen.PrimaryScreen.WorkingArea.Top; 362 | win.Width = Screen.PrimaryScreen.WorkingArea.Width; 363 | win.Height = Screen.PrimaryScreen.WorkingArea.Height; 364 | win.ApplyChanges(); 365 | } 366 | } 367 | 368 | private void DGV_WS_CellContentClick(object sender, DataGridViewCellEventArgs e) 369 | { 370 | if (e.RowIndex < 0) return; 371 | 372 | if (DGV_WS.IsCurrentCellDirty) 373 | DGV_WS.CommitEdit(DataGridViewDataErrorContexts.CurrentCellChange); 374 | 375 | UpdateWindowStyleFromGrid(); 376 | } 377 | 378 | private void DGV_WS_CellDoubleClick(object sender, DataGridViewCellEventArgs e) 379 | { 380 | if (e.RowIndex < 0) return; 381 | 382 | DGV_WS.Rows[e.RowIndex].Cells[0].Value = !(bool)DGV_WS.Rows[e.RowIndex].Cells[0].Value; 383 | UpdateWindowStyleFromGrid(); 384 | } 385 | 386 | private void DGV_WS_KeyUp(object sender, KeyEventArgs e) 387 | { 388 | if (DGV_WS.CurrentCell == null || DGV_WS.CurrentCell.RowIndex < 0 || DGV_WS.CurrentCell.ColumnIndex == 0) return; 389 | 390 | if (e.KeyCode == Keys.Space && !e.Control && !e.Alt && !e.Shift) 391 | { 392 | DGV_WS.Rows[DGV_WS.CurrentCell.RowIndex].Cells[0].Value = !(bool)DGV_WS.Rows[DGV_WS.CurrentCell.RowIndex].Cells[0].Value; 393 | UpdateWindowStyleFromGrid(); 394 | } 395 | } 396 | 397 | private void DGV_WS_EX_CellContentClick(object sender, DataGridViewCellEventArgs e) 398 | { 399 | if (e.RowIndex < 0) return; 400 | 401 | if (DGV_WS_EX.IsCurrentCellDirty) 402 | DGV_WS_EX.CommitEdit(DataGridViewDataErrorContexts.CurrentCellChange); 403 | 404 | UpdateWindowExStyleFromGrid(); 405 | } 406 | 407 | private void DGV_WS_EX_CellDoubleClick(object sender, DataGridViewCellEventArgs e) 408 | { 409 | if (e.RowIndex < 0) return; 410 | 411 | DGV_WS_EX.Rows[e.RowIndex].Cells[0].Value = !(bool)DGV_WS_EX.Rows[e.RowIndex].Cells[0].Value; 412 | UpdateWindowExStyleFromGrid(); 413 | } 414 | 415 | private void DGV_WS_EX_KeyUp(object sender, KeyEventArgs e) 416 | { 417 | if (DGV_WS_EX.CurrentCell == null || DGV_WS_EX.CurrentCell.RowIndex < 0 || DGV_WS_EX.CurrentCell.ColumnIndex == 0) return; 418 | 419 | if (e.KeyCode == Keys.Space && !e.Control && !e.Alt && !e.Shift) 420 | { 421 | DGV_WS_EX.Rows[DGV_WS_EX.CurrentCell.RowIndex].Cells[0].Value = !(bool)DGV_WS_EX.Rows[DGV_WS_EX.CurrentCell.RowIndex].Cells[0].Value; 422 | UpdateWindowExStyleFromGrid(); 423 | } 424 | } 425 | 426 | private void EDT_WS_HEX_TextChanged(object sender, EventArgs e) 427 | { 428 | if ((m_states & States.IgnoreChangedEvents) != 0) return; 429 | 430 | m_states |= States.UpdateWindowStyle; 431 | } 432 | 433 | private void EDT_WSEX_HEX_TextChanged(object sender, EventArgs e) 434 | { 435 | if ((m_states & States.IgnoreChangedEvents) != 0) return; 436 | 437 | m_states |= States.UpdateWindowExStyle; 438 | } 439 | 440 | private void TSI_REFRESH_EnabledChanged(object sender, EventArgs e) 441 | { 442 | if (!TSI_REFRESH.Enabled) // Refresh button is disabled when no process is selected or selected process has exited. 443 | { 444 | TV_WINDOW_TREE.Nodes.Clear(); 445 | ClearWindowInfo(); 446 | m_selectedProcess = null; 447 | UpdateCaption(); 448 | } 449 | } 450 | #endregion 451 | 452 | 453 | private void InitializeWindowStyles() 454 | { 455 | // Init DGV_WS 456 | m_dtWS = new DataTable(); 457 | DataColumn[] pmKey = new DataColumn[1]; 458 | pmKey[0] = m_dtWS.Columns.Add("Value", typeof(uint)); // ColIndex = 0 459 | m_dtWS.PrimaryKey = pmKey; 460 | m_dtWS.Columns.Add("Activated", typeof(bool)); // ColIndex = 1 461 | m_dtWS.Columns.Add("Name"); // ColIndex = 2 462 | 463 | // Load from XML 464 | MemoryStream ms = new MemoryStream(Properties.Resources.XML_WindowStyles); 465 | XPathDocument xpDoc = new XPathDocument(ms); 466 | ms.Close(); 467 | 468 | XPathNodeIterator iterator = xpDoc.CreateNavigator().Select("WindowStyles/WS/Item"); 469 | DataRow row; 470 | 471 | while (iterator.MoveNext()) 472 | { 473 | row = m_dtWS.NewRow(); 474 | row[0] = uint.Parse(iterator.Current.SelectSingleNode("@Value").Value.Replace("0x", ""), System.Globalization.NumberStyles.AllowHexSpecifier); 475 | row[1] = false; 476 | row[2] = iterator.Current.SelectSingleNode("@Name").Value; 477 | m_dtWS.Rows.Add(row); 478 | } 479 | DGV_WS.AutoGenerateColumns = false; 480 | DGV_WS.DataSource = m_dtWS.DefaultView; 481 | 482 | // Init DGV_WS_EX 483 | m_dtWS_EX = new DataTable(); 484 | pmKey = new DataColumn[1]; 485 | pmKey[0] = m_dtWS_EX.Columns.Add("Value", typeof(uint)); // ColIndex = 0 486 | m_dtWS_EX.PrimaryKey = pmKey; 487 | m_dtWS_EX.Columns.Add("Activated", typeof(bool)); // ColIndex = 1 488 | m_dtWS_EX.Columns.Add("Name"); // ColIndex = 2 489 | 490 | // Load from XML 491 | ms = new MemoryStream(Properties.Resources.XML_WindowStyles); 492 | xpDoc = new XPathDocument(ms); 493 | ms.Close(); 494 | 495 | iterator = xpDoc.CreateNavigator().Select("WindowStyles/WS_EX/Item"); 496 | 497 | while (iterator.MoveNext()) 498 | { 499 | row = m_dtWS_EX.NewRow(); 500 | row[0] = uint.Parse(iterator.Current.SelectSingleNode("@Value").Value.Replace("0x", ""), System.Globalization.NumberStyles.AllowHexSpecifier); 501 | row[1] = false; 502 | row[2] = iterator.Current.SelectSingleNode("@Name").Value; 503 | m_dtWS_EX.Rows.Add(row); 504 | } 505 | DGV_WS_EX.AutoGenerateColumns = false; 506 | DGV_WS_EX.DataSource = m_dtWS_EX.DefaultView; 507 | } 508 | 509 | private void UpdateCaption() 510 | { 511 | if (m_selectedProcess != null && IsProcessRunning(m_selectedProcess)) 512 | this.Text = Application.ProductName + " v" + Application.ProductVersion + " - " + m_selectedProcess.MainModule.ModuleName; 513 | else 514 | this.Text = Application.ProductName + " v" + Application.ProductVersion; 515 | } 516 | 517 | private static bool IsProcessRunning(Process process) 518 | { 519 | try { return !process.HasExited; } 520 | catch { return false; } 521 | } 522 | 523 | private void RefreshRecentProfilesMenu() 524 | { 525 | int nRecentProfilesMax = SRWE_Settings.RecentProfiles.Count; 526 | 527 | for (int i = 0, iMax = TSI_PROFILE_RECENT.DropDownItems.Count; i < iMax; i++) 528 | { 529 | if (i < nRecentProfilesMax) 530 | { 531 | TSI_PROFILE_RECENT.DropDownItems[i].ToolTipText = SRWE_Settings.RecentProfiles[i]; 532 | TSI_PROFILE_RECENT.DropDownItems[i].Text = Path.GetFileName(TSI_PROFILE_RECENT.DropDownItems[i].ToolTipText); 533 | TSI_PROFILE_RECENT.DropDownItems[i].Visible = true; 534 | } 535 | else 536 | TSI_PROFILE_RECENT.DropDownItems[i].Visible = false; 537 | } 538 | } 539 | 540 | private void UpdateGUI(bool isCallerTimer) 541 | { 542 | if (!isCallerTimer) 543 | m_states |= States.SkipUpdateGUI; 544 | else if ((m_states & States.SkipUpdateGUI) != 0) 545 | { 546 | m_states ^= States.SkipUpdateGUI; 547 | return; 548 | } 549 | 550 | TSI_REFRESH.Enabled = IsProcessRunning(m_selectedProcess); 551 | TSI_PROFILE_LOAD.Enabled = (TSI_REFRESH.Enabled && TV_WINDOW_TREE.Nodes.Count > 0); 552 | TSI_PROFILE_SAVE.Enabled = (TSI_PROFILE_LOAD.Enabled && HasCheckedTreeNode(TV_WINDOW_TREE.Nodes)); 553 | TSI_PROFILE_RECENT.Enabled = TSI_PROFILE_LOAD.Enabled; 554 | 555 | bool canEdit = (TV_WINDOW_TREE.SelectedNode != null && (TV_WINDOW_TREE.SelectedNode.Tag as Window).IsWindow); 556 | 557 | if (TABCTRL_MAIN.SelectedTab == TABPG_GENERAL) 558 | { 559 | EDT_WINRC_X.Enabled = canEdit; 560 | EDT_WINRC_Y.Enabled = canEdit; 561 | EDT_WINRC_WIDTH.Enabled = canEdit; 562 | EDT_WINRC_HEIGHT.Enabled = canEdit; 563 | EDT_WINRC_SCALE.Enabled = canEdit; 564 | _setWindowPositionAndSizeButton.Enabled = canEdit; 565 | _setWindowResolutionFromMegapixels.Enabled = canEdit; 566 | EDT_WINRC_MPX.Enabled = canEdit; 567 | EDT_WINRC_ASPRAT.Enabled = canEdit; 568 | 569 | BTN_ALIGN_LEFT.Enabled = canEdit; 570 | BTN_ALIGN_HCENTER.Enabled = canEdit; 571 | BTN_ALIGN_RIGHT.Enabled = canEdit; 572 | BTN_ALIGN_TOP.Enabled = canEdit; 573 | BTN_ALIGN_VCENTER.Enabled = canEdit; 574 | BTN_ALIGN_BOTTOM.Enabled = canEdit; 575 | 576 | BTN_REM_BORDERS.Enabled = canEdit; 577 | 578 | BTN_FAKE_FULLSCREEN.Enabled = (canEdit && (TV_WINDOW_TREE.SelectedNode.Tag as Window).Parent == null); 579 | BTN_TASKBAR_MODE.Enabled = BTN_FAKE_FULLSCREEN.Enabled; 580 | UpdateOutputResolution(); 581 | } 582 | else if (TABCTRL_MAIN.SelectedTab == TABPG_STYLES) 583 | { 584 | DGV_WS.Enabled = canEdit; 585 | DGV_WS_EX.Enabled = canEdit; 586 | EDT_WS_HEX.Enabled = canEdit; 587 | EDT_WSEX_HEX.Enabled = canEdit; 588 | } 589 | } 590 | 591 | private bool HasCheckedTreeNode(TreeNodeCollection treeNodes) 592 | { 593 | foreach (TreeNode tn in treeNodes) 594 | { 595 | if (tn.Checked || HasCheckedTreeNode(tn.Nodes)) 596 | return true; 597 | } 598 | return false; 599 | } 600 | 601 | private void UpdateWindowRect() 602 | { 603 | m_states = (m_states | States.UpdateWindowRect) ^ States.UpdateWindowRect; 604 | if (TV_WINDOW_TREE.SelectedNode == null) return; 605 | 606 | Window win = (Window)TV_WINDOW_TREE.SelectedNode.Tag; 607 | 608 | win.PosX = SRWE_Utility.SAFE_String_2_Int(EDT_WINRC_X.Text, win.PosX); 609 | win.PosY = SRWE_Utility.SAFE_String_2_Int(EDT_WINRC_Y.Text, win.PosY); 610 | win.Scale = SRWE_Utility.SAFE_String_2_Float(EDT_WINRC_SCALE.Text); 611 | win.Width = (int)(SRWE_Utility.SAFE_String_2_Int(EDT_WINRC_WIDTH.Text, win.Width)*win.Scale); 612 | win.Height = (int)(SRWE_Utility.SAFE_String_2_Int(EDT_WINRC_HEIGHT.Text, win.Height)*win.Scale); 613 | win.ApplyChanges(); 614 | EDT_WINRC_SCALE.Text = "1"; 615 | _windowSizeSpecificationManuallyChanged = false; 616 | 617 | } 618 | 619 | private int[] CalculateResolution() 620 | { 621 | // Width and Height 622 | int[] resolution = { 0, 0 }; 623 | float ratio = SRWE_Utility.SAFE_ParseRatio(EDT_WINRC_ASPRAT.Text); 624 | float mpx = SRWE_Utility.SAFE_String_2_Float(EDT_WINRC_MPX.Text)*1e6f; 625 | resolution[1] = (int)Math.Sqrt(mpx / ratio); 626 | resolution[0] = (int)(resolution[1] * ratio); 627 | 628 | return resolution; 629 | } 630 | 631 | private void UpdateOutputResolution() 632 | { 633 | var resolution = CalculateResolution(); 634 | EDT_OUTPUT_RESOLUTION.Text = String.Format("{0}x{1}", resolution[0], resolution[1]); 635 | } 636 | 637 | private void UpdateWindowFromMegapixels() 638 | { 639 | m_states = (m_states | States.UpdateWindowRect) ^ States.UpdateWindowRect; 640 | if (TV_WINDOW_TREE.SelectedNode == null) return; 641 | 642 | Window win = (Window)TV_WINDOW_TREE.SelectedNode.Tag; 643 | 644 | var resolution = CalculateResolution(); 645 | win.Width = resolution[0]; 646 | win.Height = resolution[1]; 647 | 648 | win.ApplyChanges(); 649 | 650 | } 651 | 652 | private void UpdateWindowStyles(bool exStyles) 653 | { 654 | if (exStyles) 655 | m_states = (m_states | States.UpdateWindowExStyle) ^ States.UpdateWindowExStyle; 656 | else 657 | m_states = (m_states | States.UpdateWindowStyle) ^ States.UpdateWindowStyle; 658 | 659 | if (TV_WINDOW_TREE.SelectedNode == null) return; 660 | 661 | Window win = (Window)TV_WINDOW_TREE.SelectedNode.Tag; 662 | 663 | if (exStyles) 664 | { 665 | win.ExStyle = (uint)SRWE_Utility.SAFE_HexString_2_Int(EDT_WSEX_HEX.Text, (int)win.ExStyle); 666 | foreach (DataRow dr in m_dtWS_EX.Rows) dr[1] = (win.ExStyle & (uint)dr[0]) != 0; 667 | } 668 | else 669 | { 670 | win.Style = (uint)SRWE_Utility.SAFE_HexString_2_Int(EDT_WS_HEX.Text, (int)win.Style); 671 | foreach (DataRow dr in m_dtWS.Rows) dr[1] = (win.Style & (uint)dr[0]) != 0; 672 | } 673 | win.ApplyChanges(); 674 | } 675 | 676 | private void RefreshData(bool isCallerTimer) 677 | { 678 | if (!isCallerTimer) 679 | m_states |= States.SkipRefreshData; 680 | else if ((m_states & States.SkipRefreshData) != 0) 681 | { 682 | m_states ^= States.SkipRefreshData; 683 | return; 684 | } 685 | 686 | m_states |= States.IgnoreChangedEvents; 687 | 688 | if (TV_WINDOW_TREE.SelectedNode == null) return; 689 | 690 | Window win = (Window)TV_WINDOW_TREE.SelectedNode.Tag; 691 | win.Refresh(); 692 | 693 | if (TABCTRL_MAIN.SelectedTab == TABPG_GENERAL) 694 | RefreshGeneralTab(win); 695 | else if (TABCTRL_MAIN.SelectedTab == TABPG_STYLES) 696 | RefreshWindowStylesTab(win); 697 | 698 | m_states ^= States.IgnoreChangedEvents; 699 | } 700 | 701 | private void RefreshGeneralTab(Window win) 702 | { 703 | if (!EDT_WINRC_X.Focused) EDT_WINRC_X.Text = win.PosX.ToString(); 704 | if (!EDT_WINRC_Y.Focused) EDT_WINRC_Y.Text = win.PosY.ToString(); 705 | if (!EDT_WINRC_WIDTH.Focused && !_windowSizeSpecificationManuallyChanged) EDT_WINRC_WIDTH.Text = win.Width.ToString(); 706 | if (!EDT_WINRC_HEIGHT.Focused && !_windowSizeSpecificationManuallyChanged) EDT_WINRC_HEIGHT.Text = win.Height.ToString(); 707 | 708 | EDT_HANDLE.Text = win.Handle.ToString("X8"); 709 | EDT_CLASS.Text = win.Class; 710 | EDT_TEXT.Text = win.Text; 711 | EDT_HIER_NUM.Text = win.HierarchicalID; 712 | EDT_THREAD_ID.Text = win.ThreadID.ToString("X8"); 713 | 714 | EDT_CL_POSX.Text = win.ClientRect.left.ToString(); 715 | EDT_CL_POSY.Text = win.ClientRect.top.ToString(); 716 | EDT_CL_WIDTH.Text = win.ClientRect.Width.ToString(); 717 | EDT_CL_HEIGHT.Text = win.ClientRect.Height.ToString(); 718 | 719 | EDT_BORDER_CX.Text = win.BorderWidth.ToString(); 720 | EDT_BORDER_CY.Text = win.BorderHeight.ToString(); 721 | } 722 | 723 | private void RefreshWindowStylesTab(Window win) 724 | { 725 | foreach (DataRow dr in m_dtWS.Rows) dr[1] = (win.Style & (uint)dr[0]) != 0; 726 | foreach (DataRow dr in m_dtWS_EX.Rows) dr[1] = (win.ExStyle & (uint)dr[0]) != 0; 727 | 728 | if (!EDT_WS_HEX.Focused) EDT_WS_HEX.Text = win.Style.ToString("X8"); 729 | if (!EDT_WSEX_HEX.Focused) EDT_WSEX_HEX.Text = win.ExStyle.ToString("X8"); 730 | } 731 | 732 | private void UpdateWindowTree() 733 | { 734 | TV_WINDOW_TREE.Nodes.Clear(); 735 | ClearWindowInfo(); 736 | 737 | if (m_selectedProcess != null && IsProcessRunning(m_selectedProcess)) 738 | { 739 | List wndList = Window.GetProcessWindows(m_selectedProcess); 740 | CreateTreeElements(TV_WINDOW_TREE.Nodes, wndList); 741 | TV_WINDOW_TREE.Focus(); 742 | if(TV_WINDOW_TREE.Nodes.Count > 0) 743 | { 744 | TV_WINDOW_TREE.SelectedNode = TV_WINDOW_TREE.Nodes[0]; 745 | } 746 | } 747 | } 748 | 749 | private void ClearWindowInfo() 750 | { 751 | EDT_WINRC_X.Text = ""; 752 | EDT_WINRC_Y.Text = ""; 753 | EDT_WINRC_WIDTH.Text = ""; 754 | EDT_WINRC_HEIGHT.Text = ""; 755 | EDT_HANDLE.Text = ""; 756 | EDT_CLASS.Text = ""; 757 | EDT_TEXT.Text = ""; 758 | EDT_HIER_NUM.Text = ""; 759 | EDT_THREAD_ID.Text = ""; 760 | EDT_CL_POSX.Text = ""; 761 | EDT_CL_POSY.Text = ""; 762 | EDT_CL_WIDTH.Text = ""; 763 | EDT_CL_HEIGHT.Text = ""; 764 | EDT_BORDER_CX.Text = ""; 765 | EDT_BORDER_CY.Text = ""; 766 | 767 | foreach (DataRow dRow in m_dtWS.Rows) dRow[1] = false; 768 | foreach (DataRow dRow in m_dtWS_EX.Rows) dRow[1] = false; 769 | 770 | EDT_WS_HEX.Text = ""; 771 | EDT_WSEX_HEX.Text = ""; 772 | } 773 | 774 | private void CreateTreeElements(TreeNodeCollection treeNodes, List wndList) 775 | { 776 | if (wndList == null || wndList.Count < 1) return; 777 | 778 | foreach (Window wi in wndList) 779 | { 780 | TreeNode newNode = treeNodes.Add(wi.DisplayName); 781 | newNode.Tag = wi; 782 | CreateTreeElements(newNode.Nodes, wi.m_childList); 783 | } 784 | } 785 | 786 | private void UncheckTreeViewNodes(TreeNodeCollection treeNodes) 787 | { 788 | foreach (TreeNode tn in treeNodes) 789 | { 790 | tn.Checked = false; 791 | UncheckTreeViewNodes(tn.Nodes); 792 | } 793 | } 794 | 795 | private void UpdateWindowFromProfile(XPathNavigator navWindow) 796 | { 797 | string hierID = navWindow.SelectSingleNode("@HierID").Value; 798 | string[] numbers = hierID.Split(new char[] { '.' }, StringSplitOptions.RemoveEmptyEntries); 799 | int[] ordinals = new int[numbers.Length]; 800 | for (int i = 0, iMax = ordinals.Length; i < iMax; i++) ordinals[i] = int.Parse(numbers[i]) - 1; 801 | 802 | TreeNodeCollection treeNodes = TV_WINDOW_TREE.Nodes; 803 | TreeNode tNode = null; 804 | int nTopOrdinal = ordinals.Length - 1; 805 | 806 | for (int i = 0, iMax = ordinals.Length; i < iMax; i++) 807 | { 808 | if (ordinals[i] >= treeNodes.Count) throw new Exception("A window with hierarchical ID '" + hierID + "' not found"); 809 | tNode = treeNodes[ordinals[i]]; 810 | if (i < nTopOrdinal) treeNodes = tNode.Nodes; 811 | } 812 | 813 | if (tNode != null) 814 | { 815 | tNode.Checked = true; 816 | Window win = (Window)tNode.Tag; 817 | win.Refresh(); 818 | 819 | win.PosX = SRWE_Utility.SAFE_String_2_Int(navWindow.SelectSingleNode("@PosX").Value, win.PosX); 820 | win.PosY = SRWE_Utility.SAFE_String_2_Int(navWindow.SelectSingleNode("@PosY").Value, win.PosY); 821 | win.Width = SRWE_Utility.SAFE_String_2_Int(navWindow.SelectSingleNode("@Width").Value, win.Width); 822 | win.Height = SRWE_Utility.SAFE_String_2_Int(navWindow.SelectSingleNode("@Height").Value, win.Height); 823 | win.Style = (uint)SRWE_Utility.SAFE_HexString_2_Int(navWindow.SelectSingleNode("@Style").Value, (int)win.Style); 824 | win.ExStyle = (uint)SRWE_Utility.SAFE_HexString_2_Int(navWindow.SelectSingleNode("@ExStyle").Value, (int)win.ExStyle); 825 | win.ApplyChanges(); 826 | } 827 | } 828 | 829 | private void AddWindowsToProfile(XmlElement xmlProfile, TreeNodeCollection treeNodes) 830 | { 831 | if (treeNodes == null || treeNodes.Count < 1) return; 832 | 833 | foreach (TreeNode tNode in treeNodes) 834 | { 835 | if (tNode.Checked) 836 | { 837 | Window win = (Window)tNode.Tag; 838 | win.Refresh(); 839 | XmlElement xmlWindow = xmlProfile.OwnerDocument.CreateElement("Window"); 840 | xmlWindow.Attributes.Append(xmlProfile.OwnerDocument.CreateAttribute("HierID")).Value = win.HierarchicalID; 841 | xmlWindow.Attributes.Append(xmlProfile.OwnerDocument.CreateAttribute("PosX")).Value = win.PosX.ToString(); 842 | xmlWindow.Attributes.Append(xmlProfile.OwnerDocument.CreateAttribute("PosY")).Value = win.PosY.ToString(); 843 | xmlWindow.Attributes.Append(xmlProfile.OwnerDocument.CreateAttribute("Width")).Value = win.Width.ToString(); 844 | xmlWindow.Attributes.Append(xmlProfile.OwnerDocument.CreateAttribute("Height")).Value = win.Height.ToString(); 845 | xmlWindow.Attributes.Append(xmlProfile.OwnerDocument.CreateAttribute("Style")).Value = win.Style.ToString("X8"); 846 | xmlWindow.Attributes.Append(xmlProfile.OwnerDocument.CreateAttribute("ExStyle")).Value = win.ExStyle.ToString("X8"); 847 | xmlProfile.AppendChild(xmlWindow); 848 | } 849 | AddWindowsToProfile(xmlProfile, tNode.Nodes); 850 | } 851 | } 852 | 853 | private void UpdateWindowStyleFromGrid() 854 | { 855 | if (TV_WINDOW_TREE.SelectedNode == null) return; 856 | Window win = (Window)TV_WINDOW_TREE.SelectedNode.Tag; 857 | 858 | uint dwStyle = 0; 859 | 860 | foreach (DataRow dr in m_dtWS.Rows) 861 | { 862 | dwStyle |= (uint)dr[0]; 863 | if ((bool)dr[1] == false) dwStyle ^= (uint)dr[0]; 864 | } 865 | 866 | win.Style = dwStyle; 867 | win.ApplyChanges(); 868 | 869 | m_states |= States.IgnoreChangedEvents; 870 | EDT_WS_HEX.Text = dwStyle.ToString("X8"); 871 | m_states ^= States.IgnoreChangedEvents; 872 | } 873 | 874 | private void UpdateWindowExStyleFromGrid() 875 | { 876 | if (TV_WINDOW_TREE.SelectedNode == null) return; 877 | Window win = (Window)TV_WINDOW_TREE.SelectedNode.Tag; 878 | 879 | uint dwExStyle = 0; 880 | 881 | foreach (DataRow dr in m_dtWS_EX.Rows) 882 | { 883 | dwExStyle |= (uint)dr[0]; 884 | if ((bool)dr[1] == false) dwExStyle ^= (uint)dr[0]; 885 | } 886 | 887 | win.ExStyle = dwExStyle; 888 | win.ApplyChanges(); 889 | 890 | m_states |= States.IgnoreChangedEvents; 891 | EDT_WSEX_HEX.Text = dwExStyle.ToString("X8"); 892 | m_states ^= States.IgnoreChangedEvents; 893 | } 894 | 895 | private void TIMER_HOTKEYS_Tick(object sender, EventArgs e) 896 | { 897 | bool ctrl = (WinAPI.GetAsyncKeyState(Keys.ControlKey) & 0x8000) != 0; 898 | bool alt = (WinAPI.GetAsyncKeyState(Keys.Menu) & 0x8000) != 0; 899 | bool shift = (WinAPI.GetAsyncKeyState(Keys.ShiftKey) & 0x8000) != 0; 900 | 901 | foreach (SRWE_HotKey hotKey in SRWE_Settings.HotKeys) 902 | { 903 | if (!hotKey.HotKey.HasValue || hotKey.CTRL != ctrl || hotKey.ALT != alt || hotKey.SHIFT != shift) continue; 904 | 905 | if ((WinAPI.GetAsyncKeyState(hotKey.HotKey.Value) & 0x8000) != 0) 906 | { 907 | switch (hotKey.Name) 908 | { 909 | case "RemoveBorders": 910 | ActiveWindow_RemoveBorders(); break; 911 | case "FakeFullScreen": 912 | ActiveWindow_FakeFullScreen(); break; 913 | default: 914 | break; 915 | } 916 | } 917 | } 918 | } 919 | 920 | private void ActiveWindow_RemoveBorders() 921 | { 922 | int hWnd = WinAPI.GetForegroundWindow(); 923 | if (hWnd == 0 || hWnd == (int)this.Handle) return; 924 | Window window = Window.GetFromHWND(hWnd); 925 | 926 | if (window != null) window.RemoveBorders(); 927 | } 928 | 929 | private void ActiveWindow_FakeFullScreen() 930 | { 931 | int hWnd = WinAPI.GetForegroundWindow(); 932 | if (hWnd == 0 || hWnd == (int)this.Handle) return; 933 | Window window = Window.GetFromHWND(hWnd); 934 | 935 | if (window != null) 936 | { 937 | window.PosX = 0; 938 | window.PosY = 0; 939 | window.Width = Screen.PrimaryScreen.Bounds.Width; 940 | window.Height = Screen.PrimaryScreen.Bounds.Height; 941 | window.ApplyChanges(); 942 | } 943 | } 944 | 945 | 946 | private void ReflectSettingsInUI() 947 | { 948 | _forceExitSizeMoveCheckBox.Checked = SRWE_Settings.ForceExitSizeMoveMessage; 949 | _autoAttachToLastKnownCheckBox.Checked = SRWE_Settings.AutoAttachToLastKnownProcess; 950 | // grab the first profile (if any) and use that folder as the default folder for profiles. 951 | var firstProfile = SRWE_Settings.RecentProfiles.FirstOrDefault(); 952 | if(!string.IsNullOrEmpty(firstProfile)) 953 | { 954 | try 955 | { 956 | OFD_PROFILE.InitialDirectory = Path.GetDirectoryName(firstProfile); 957 | SFD_PROFILE.InitialDirectory = OFD_PROFILE.InitialDirectory; 958 | } 959 | catch 960 | { 961 | // folder name is wrong, nothing we can do, silently skip it. 962 | } 963 | } 964 | } 965 | 966 | private void _setWindowPositionAndSizeButton_Click(object sender, EventArgs e) 967 | { 968 | UpdateWindowRect(); 969 | } 970 | 971 | private void _setWindowResolutionFromMegapixels_Click(object sender, EventArgs e) 972 | { 973 | UpdateWindowFromMegapixels(); 974 | } 975 | 976 | } 977 | } 978 | -------------------------------------------------------------------------------- /SRWE/OpenProcessDialog.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Text; 7 | using System.Windows.Forms; 8 | using System.Diagnostics; 9 | 10 | namespace SRWE 11 | { 12 | public partial class OpenProcessDialog : Form 13 | { 14 | private ProcessSelectorCtrl m_ctrlProcessSelector; 15 | 16 | public OpenProcessDialog() 17 | { 18 | InitializeComponent(); 19 | 20 | Point location = new Point(4, 4); 21 | 22 | m_ctrlProcessSelector = new ProcessSelectorCtrl(); 23 | m_ctrlProcessSelector.Location = location; 24 | m_ctrlProcessSelector.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Bottom; 25 | m_ctrlProcessSelector.BTN_OPEN.Click += new EventHandler(BTN_OPEN_Click); 26 | m_ctrlProcessSelector.DGV_PROCESS_LIST.CellDoubleClick += new DataGridViewCellEventHandler(DGV_PROCESS_LIST_CellDoubleClick); 27 | m_ctrlProcessSelector.BTN_CANCEL.Click += new EventHandler(BTN_CANCEL_Click); 28 | this.Controls.Add(m_ctrlProcessSelector); 29 | this.AcceptButton = m_ctrlProcessSelector.BTN_OPEN; 30 | this.CancelButton = m_ctrlProcessSelector.BTN_CANCEL; 31 | } 32 | 33 | private void OpenProcessDialog_Load(object sender, EventArgs e) 34 | { 35 | if (Owner != null) 36 | this.Icon = this.Owner.Icon; 37 | 38 | m_ctrlProcessSelector.RefreshProcessList(); 39 | } 40 | 41 | void BTN_OPEN_Click(object sender, EventArgs e) 42 | { 43 | if (m_ctrlProcessSelector.SelectedProcess == null) 44 | { 45 | MessageBox.Show("Please select a process.", "SRWE", MessageBoxButtons.OK, MessageBoxIcon.Information); 46 | return; 47 | } 48 | this.DialogResult = System.Windows.Forms.DialogResult.OK; 49 | } 50 | 51 | void DGV_PROCESS_LIST_CellDoubleClick(object sender, DataGridViewCellEventArgs e) 52 | { 53 | if (e.RowIndex < 0) return; 54 | 55 | BTN_OPEN_Click(sender, EventArgs.Empty); 56 | } 57 | 58 | void BTN_CANCEL_Click(object sender, EventArgs e) 59 | { 60 | this.DialogResult = System.Windows.Forms.DialogResult.Cancel; 61 | } 62 | 63 | public Process SelectedProcess 64 | { 65 | get { return m_ctrlProcessSelector.SelectedProcess; } 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /SRWE/OpenProcessDialog.designer.cs: -------------------------------------------------------------------------------- 1 | namespace SRWE 2 | { 3 | partial class OpenProcessDialog 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.SuspendLayout(); 32 | // 33 | // OpenProcessDialog 34 | // 35 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 36 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 37 | this.ClientSize = new System.Drawing.Size(624, 442); 38 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; 39 | this.MaximizeBox = false; 40 | this.MinimizeBox = false; 41 | this.Name = "OpenProcessDialog"; 42 | this.ShowInTaskbar = false; 43 | this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; 44 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; 45 | this.Text = "Select Process"; 46 | this.Load += new System.EventHandler(this.OpenProcessDialog_Load); 47 | this.ResumeLayout(false); 48 | 49 | } 50 | 51 | #endregion 52 | } 53 | } -------------------------------------------------------------------------------- /SRWE/OpenProcessDialog.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /SRWE/ProcessSelectorCtrl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Drawing; 5 | using System.Data; 6 | using System.Text; 7 | using System.Windows.Forms; 8 | using System.Diagnostics; 9 | 10 | namespace SRWE 11 | { 12 | public partial class ProcessSelectorCtrl : UserControl 13 | { 14 | private DataTable m_dtProcessList; 15 | private Process m_process; 16 | 17 | public ProcessSelectorCtrl() 18 | { 19 | InitializeComponent(); 20 | 21 | m_dtProcessList = new DataTable(); 22 | DataColumn[] pKeys = new DataColumn[1]; 23 | pKeys[0] = m_dtProcessList.Columns.Add("ProcessID", typeof(int)); 24 | m_dtProcessList.PrimaryKey = pKeys; 25 | m_dtProcessList.Columns.Add("ModuleIcon", typeof(Image)); 26 | m_dtProcessList.Columns.Add("ProcessName"); 27 | m_dtProcessList.Columns.Add("WindowTitle"); 28 | m_dtProcessList.Columns.Add("FileName"); 29 | 30 | DGV_PROCESS_LIST.AutoGenerateColumns = false; 31 | DGV_PROCESS_LIST.DataSource = m_dtProcessList.DefaultView; 32 | } 33 | 34 | public Process SelectedProcess 35 | { 36 | get 37 | { 38 | if (DGV_PROCESS_LIST.SelectedRows.Count > 0) 39 | { 40 | DataRowView drv = (DataRowView)DGV_PROCESS_LIST.SelectedRows[0].DataBoundItem; 41 | 42 | if (m_process == null || m_process.HasExited || m_process.Id != (int)drv[0]) 43 | m_process = Process.GetProcessById((int)drv[0]); 44 | return m_process; 45 | } 46 | return null; 47 | } 48 | } 49 | 50 | private void BTN_REFRESH_Click(object sender, EventArgs e) 51 | { 52 | RefreshProcessList(); 53 | } 54 | 55 | private void DGV_PROCESS_LIST_SelectionChanged(object sender, EventArgs e) 56 | { 57 | BTN_OPEN.Enabled = (DGV_PROCESS_LIST.SelectedRows.Count > 0); 58 | } 59 | 60 | public void RefreshProcessList() 61 | { 62 | m_dtProcessList.Clear(); 63 | DataRow row; 64 | Process currentProcess = Process.GetCurrentProcess(); 65 | 66 | foreach (Process process in Process.GetProcesses()) 67 | { 68 | try 69 | { 70 | if (process.SessionId == currentProcess.SessionId && process.Id != currentProcess.Id) 71 | { 72 | row = m_dtProcessList.NewRow(); 73 | row[0] = process.Id; 74 | row[1] = System.Drawing.Icon.ExtractAssociatedIcon(process.MainModule.FileName).ToBitmap(); 75 | row[2] = process.MainModule.ModuleName; 76 | row[3] = process.MainWindowTitle; 77 | row[4] = process.MainModule.FileName; 78 | 79 | if (IsRecentProcess(process.ProcessName)) 80 | m_dtProcessList.Rows.InsertAt(row, 0); 81 | else 82 | m_dtProcessList.Rows.Add(row); 83 | } 84 | } 85 | catch 86 | { 87 | // exception can be caused by anything, e.g. lack of access rights. Ignore process. 88 | } 89 | } 90 | if (DGV_PROCESS_LIST.RowCount > 0) 91 | { 92 | DGV_PROCESS_LIST.ClearSelection(); 93 | DGV_PROCESS_LIST.CurrentCell = DGV_PROCESS_LIST.Rows[0].Cells[1]; 94 | } 95 | } 96 | 97 | private bool IsRecentProcess(string processName) 98 | { 99 | foreach (string name in SRWE_Settings.RecentProcesses) 100 | { 101 | if (!string.IsNullOrEmpty(name) && name.Equals(processName, StringComparison.CurrentCultureIgnoreCase)) 102 | return true; 103 | } 104 | return false; 105 | } 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /SRWE/ProcessSelectorCtrl.designer.cs: -------------------------------------------------------------------------------- 1 | namespace SRWE 2 | { 3 | partial class ProcessSelectorCtrl 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Component Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); 32 | System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); 33 | this.COL_WINDOW_TITLE = new System.Windows.Forms.DataGridViewTextBoxColumn(); 34 | this.COL_PROCESS_NAME = new System.Windows.Forms.DataGridViewTextBoxColumn(); 35 | this.COL_ICON = new System.Windows.Forms.DataGridViewImageColumn(); 36 | this.DGV_PROCESS_LIST = new System.Windows.Forms.DataGridView(); 37 | this.COL_LOCATION = new System.Windows.Forms.DataGridViewTextBoxColumn(); 38 | this.BTN_CANCEL = new System.Windows.Forms.Button(); 39 | this.BTN_OPEN = new System.Windows.Forms.Button(); 40 | this.BTN_REFRESH = new System.Windows.Forms.Button(); 41 | ((System.ComponentModel.ISupportInitialize)(this.DGV_PROCESS_LIST)).BeginInit(); 42 | this.SuspendLayout(); 43 | // 44 | // COL_WINDOW_TITLE 45 | // 46 | this.COL_WINDOW_TITLE.DataPropertyName = "WindowTitle"; 47 | this.COL_WINDOW_TITLE.HeaderText = "Window Title"; 48 | this.COL_WINDOW_TITLE.Name = "COL_WINDOW_TITLE"; 49 | this.COL_WINDOW_TITLE.ReadOnly = true; 50 | this.COL_WINDOW_TITLE.Width = 240; 51 | // 52 | // COL_PROCESS_NAME 53 | // 54 | this.COL_PROCESS_NAME.DataPropertyName = "ProcessName"; 55 | dataGridViewCellStyle1.Padding = new System.Windows.Forms.Padding(3, 0, 0, 0); 56 | this.COL_PROCESS_NAME.DefaultCellStyle = dataGridViewCellStyle1; 57 | this.COL_PROCESS_NAME.HeaderText = "Process Name"; 58 | this.COL_PROCESS_NAME.Name = "COL_PROCESS_NAME"; 59 | this.COL_PROCESS_NAME.ReadOnly = true; 60 | this.COL_PROCESS_NAME.Width = 160; 61 | // 62 | // COL_ICON 63 | // 64 | this.COL_ICON.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCellsExceptHeader; 65 | this.COL_ICON.DataPropertyName = "ModuleIcon"; 66 | this.COL_ICON.HeaderText = ""; 67 | this.COL_ICON.Name = "COL_ICON"; 68 | this.COL_ICON.ReadOnly = true; 69 | this.COL_ICON.Width = 5; 70 | // 71 | // DGV_PROCESS_LIST 72 | // 73 | this.DGV_PROCESS_LIST.AllowUserToAddRows = false; 74 | this.DGV_PROCESS_LIST.AllowUserToDeleteRows = false; 75 | this.DGV_PROCESS_LIST.AllowUserToResizeRows = false; 76 | this.DGV_PROCESS_LIST.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 77 | | System.Windows.Forms.AnchorStyles.Left) 78 | | System.Windows.Forms.AnchorStyles.Right))); 79 | this.DGV_PROCESS_LIST.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells; 80 | this.DGV_PROCESS_LIST.BackgroundColor = System.Drawing.SystemColors.Window; 81 | this.DGV_PROCESS_LIST.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; 82 | dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; 83 | dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control; 84 | dataGridViewCellStyle2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); 85 | dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText; 86 | dataGridViewCellStyle2.Padding = new System.Windows.Forms.Padding(0, 3, 0, 4); 87 | dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight; 88 | dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText; 89 | dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True; 90 | this.DGV_PROCESS_LIST.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2; 91 | this.DGV_PROCESS_LIST.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; 92 | this.DGV_PROCESS_LIST.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { 93 | this.COL_ICON, 94 | this.COL_PROCESS_NAME, 95 | this.COL_WINDOW_TITLE, 96 | this.COL_LOCATION}); 97 | this.DGV_PROCESS_LIST.Location = new System.Drawing.Point(4, 4); 98 | this.DGV_PROCESS_LIST.Margin = new System.Windows.Forms.Padding(4); 99 | this.DGV_PROCESS_LIST.MultiSelect = false; 100 | this.DGV_PROCESS_LIST.Name = "DGV_PROCESS_LIST"; 101 | this.DGV_PROCESS_LIST.ReadOnly = true; 102 | this.DGV_PROCESS_LIST.RowHeadersVisible = false; 103 | this.DGV_PROCESS_LIST.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; 104 | this.DGV_PROCESS_LIST.Size = new System.Drawing.Size(608, 395); 105 | this.DGV_PROCESS_LIST.TabIndex = 0; 106 | this.DGV_PROCESS_LIST.SelectionChanged += new System.EventHandler(this.DGV_PROCESS_LIST_SelectionChanged); 107 | // 108 | // COL_LOCATION 109 | // 110 | this.COL_LOCATION.DataPropertyName = "FileName"; 111 | this.COL_LOCATION.HeaderText = "Location"; 112 | this.COL_LOCATION.Name = "COL_LOCATION"; 113 | this.COL_LOCATION.ReadOnly = true; 114 | this.COL_LOCATION.Width = 240; 115 | // 116 | // BTN_CANCEL 117 | // 118 | this.BTN_CANCEL.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 119 | this.BTN_CANCEL.Location = new System.Drawing.Point(532, 407); 120 | this.BTN_CANCEL.Margin = new System.Windows.Forms.Padding(4); 121 | this.BTN_CANCEL.Name = "BTN_CANCEL"; 122 | this.BTN_CANCEL.Size = new System.Drawing.Size(80, 23); 123 | this.BTN_CANCEL.TabIndex = 3; 124 | this.BTN_CANCEL.Text = "Cancel"; 125 | this.BTN_CANCEL.UseVisualStyleBackColor = true; 126 | // 127 | // BTN_OPEN 128 | // 129 | this.BTN_OPEN.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 130 | this.BTN_OPEN.Location = new System.Drawing.Point(444, 407); 131 | this.BTN_OPEN.Margin = new System.Windows.Forms.Padding(4); 132 | this.BTN_OPEN.Name = "BTN_OPEN"; 133 | this.BTN_OPEN.Size = new System.Drawing.Size(80, 23); 134 | this.BTN_OPEN.TabIndex = 1; 135 | this.BTN_OPEN.Text = "Open"; 136 | this.BTN_OPEN.UseVisualStyleBackColor = true; 137 | // 138 | // BTN_REFRESH 139 | // 140 | this.BTN_REFRESH.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 141 | this.BTN_REFRESH.Location = new System.Drawing.Point(4, 407); 142 | this.BTN_REFRESH.Margin = new System.Windows.Forms.Padding(4); 143 | this.BTN_REFRESH.Name = "BTN_REFRESH"; 144 | this.BTN_REFRESH.Size = new System.Drawing.Size(80, 23); 145 | this.BTN_REFRESH.TabIndex = 2; 146 | this.BTN_REFRESH.Text = "Refresh"; 147 | this.BTN_REFRESH.UseVisualStyleBackColor = true; 148 | this.BTN_REFRESH.Click += new System.EventHandler(this.BTN_REFRESH_Click); 149 | // 150 | // ProcessSelectorCtrl 151 | // 152 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 153 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 154 | this.Controls.Add(this.DGV_PROCESS_LIST); 155 | this.Controls.Add(this.BTN_CANCEL); 156 | this.Controls.Add(this.BTN_OPEN); 157 | this.Controls.Add(this.BTN_REFRESH); 158 | this.Name = "ProcessSelectorCtrl"; 159 | this.Size = new System.Drawing.Size(616, 434); 160 | ((System.ComponentModel.ISupportInitialize)(this.DGV_PROCESS_LIST)).EndInit(); 161 | this.ResumeLayout(false); 162 | 163 | } 164 | 165 | #endregion 166 | 167 | private System.Windows.Forms.DataGridViewTextBoxColumn COL_WINDOW_TITLE; 168 | private System.Windows.Forms.DataGridViewTextBoxColumn COL_PROCESS_NAME; 169 | private System.Windows.Forms.DataGridViewImageColumn COL_ICON; 170 | internal System.Windows.Forms.DataGridView DGV_PROCESS_LIST; 171 | private System.Windows.Forms.DataGridViewTextBoxColumn COL_LOCATION; 172 | internal System.Windows.Forms.Button BTN_CANCEL; 173 | internal System.Windows.Forms.Button BTN_OPEN; 174 | private System.Windows.Forms.Button BTN_REFRESH; 175 | 176 | } 177 | } 178 | -------------------------------------------------------------------------------- /SRWE/ProcessSelectorCtrl.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | True 122 | 123 | 124 | True 125 | 126 | 127 | True 128 | 129 | 130 | True 131 | 132 | -------------------------------------------------------------------------------- /SRWE/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Windows.Forms; 4 | 5 | namespace SRWE 6 | { 7 | static class Program 8 | { 9 | /// 10 | /// The main entry point for the application. 11 | /// 12 | [STAThread] 13 | static void Main() 14 | { 15 | Application.EnableVisualStyles(); 16 | Application.SetCompatibleTextRenderingDefault(false); 17 | Application.Run(new MainForm()); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /SRWE/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Simple Runtime Window Editor")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Simple Runtime Window Editor")] 13 | [assembly: AssemblyCopyright("Copyright © _DTG_ / Others 2012-2020")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("67c42701-4277-4d29-ae2c-42de10c77309")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("2.3.6")] 36 | [assembly: AssemblyFileVersion("2.3.6")] 37 | -------------------------------------------------------------------------------- /SRWE/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.18408 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace SRWE.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SRWE.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | /// 64 | /// Looks up a localized resource of type System.Drawing.Bitmap. 65 | /// 66 | internal static System.Drawing.Bitmap Application_EXE { 67 | get { 68 | object obj = ResourceManager.GetObject("Application_EXE", resourceCulture); 69 | return ((System.Drawing.Bitmap)(obj)); 70 | } 71 | } 72 | 73 | /// 74 | /// Looks up a localized resource of type System.Drawing.Bitmap. 75 | /// 76 | internal static System.Drawing.Bitmap LoadProfile { 77 | get { 78 | object obj = ResourceManager.GetObject("LoadProfile", resourceCulture); 79 | return ((System.Drawing.Bitmap)(obj)); 80 | } 81 | } 82 | 83 | /// 84 | /// Looks up a localized resource of type System.Drawing.Bitmap. 85 | /// 86 | internal static System.Drawing.Bitmap Recent { 87 | get { 88 | object obj = ResourceManager.GetObject("Recent", resourceCulture); 89 | return ((System.Drawing.Bitmap)(obj)); 90 | } 91 | } 92 | 93 | /// 94 | /// Looks up a localized resource of type System.Drawing.Bitmap. 95 | /// 96 | internal static System.Drawing.Bitmap RefreshTree { 97 | get { 98 | object obj = ResourceManager.GetObject("RefreshTree", resourceCulture); 99 | return ((System.Drawing.Bitmap)(obj)); 100 | } 101 | } 102 | 103 | /// 104 | /// Looks up a localized resource of type System.Drawing.Bitmap. 105 | /// 106 | internal static System.Drawing.Bitmap SaveProfile { 107 | get { 108 | object obj = ResourceManager.GetObject("SaveProfile", resourceCulture); 109 | return ((System.Drawing.Bitmap)(obj)); 110 | } 111 | } 112 | 113 | /// 114 | /// Looks up a localized resource of type System.Byte[]. 115 | /// 116 | internal static byte[] XML_Profile { 117 | get { 118 | object obj = ResourceManager.GetObject("XML_Profile", resourceCulture); 119 | return ((byte[])(obj)); 120 | } 121 | } 122 | 123 | /// 124 | /// Looks up a localized resource of type System.Byte[]. 125 | /// 126 | internal static byte[] XML_Settings { 127 | get { 128 | object obj = ResourceManager.GetObject("XML_Settings", resourceCulture); 129 | return ((byte[])(obj)); 130 | } 131 | } 132 | 133 | /// 134 | /// Looks up a localized resource of type System.Byte[]. 135 | /// 136 | internal static byte[] XML_WindowStyles { 137 | get { 138 | object obj = ResourceManager.GetObject("XML_WindowStyles", resourceCulture); 139 | return ((byte[])(obj)); 140 | } 141 | } 142 | } 143 | } 144 | -------------------------------------------------------------------------------- /SRWE/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 122 | ..\Resources\Application_EXE.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 123 | 124 | 125 | ..\Resources\LoadProfile.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 126 | 127 | 128 | ..\Resources\Recent.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 129 | 130 | 131 | ..\Resources\RefreshTree.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 132 | 133 | 134 | ..\Resources\SaveProfile.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 135 | 136 | 137 | ..\Resources\Profile.xml;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 138 | 139 | 140 | ..\Resources\Settings.xml;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 141 | 142 | 143 | ..\Resources\WindowStyles.xml;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 144 | 145 | -------------------------------------------------------------------------------- /SRWE/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.18408 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace SRWE.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /SRWE/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /SRWE/Resources/Application_EXE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dtgDTGdtg/SRWE/b439859e15ca44b6c4715fdb015c321a49ef634a/SRWE/Resources/Application_EXE.png -------------------------------------------------------------------------------- /SRWE/Resources/LoadProfile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dtgDTGdtg/SRWE/b439859e15ca44b6c4715fdb015c321a49ef634a/SRWE/Resources/LoadProfile.png -------------------------------------------------------------------------------- /SRWE/Resources/Profile.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /SRWE/Resources/Recent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dtgDTGdtg/SRWE/b439859e15ca44b6c4715fdb015c321a49ef634a/SRWE/Resources/Recent.png -------------------------------------------------------------------------------- /SRWE/Resources/RefreshTree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dtgDTGdtg/SRWE/b439859e15ca44b6c4715fdb015c321a49ef634a/SRWE/Resources/RefreshTree.png -------------------------------------------------------------------------------- /SRWE/Resources/SaveProfile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dtgDTGdtg/SRWE/b439859e15ca44b6c4715fdb015c321a49ef634a/SRWE/Resources/SaveProfile.png -------------------------------------------------------------------------------- /SRWE/Resources/Settings.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 20 | F6 21 | F7 22 | 23 | -------------------------------------------------------------------------------- /SRWE/Resources/WindowStyles.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /SRWE/SRWE.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | x86 6 | 8.0.30703 7 | 2.0 8 | {FF37255C-B8F8-4866-BB83-0E825A5CB132} 9 | WinExe 10 | Properties 11 | SRWE 12 | SRWE 13 | v4.0 14 | 512 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | AnyCPU 27 | true 28 | full 29 | false 30 | bin\Debug\ 31 | DEBUG;TRACE 32 | prompt 33 | 4 34 | 35 | 36 | AnyCPU 37 | pdbonly 38 | true 39 | bin\Release\ 40 | TRACE 41 | prompt 42 | 4 43 | 44 | 45 | SRWE.ico 46 | 47 | 48 | true 49 | bin\Debug\ 50 | DEBUG;TRACE 51 | full 52 | AnyCPU 53 | prompt 54 | MinimumRecommendedRules.ruleset 55 | 56 | 57 | bin\Release\ 58 | TRACE 59 | true 60 | pdbonly 61 | AnyCPU 62 | prompt 63 | MinimumRecommendedRules.ruleset 64 | 65 | 66 | app.manifest 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | Form 79 | 80 | 81 | MainForm.cs 82 | 83 | 84 | Form 85 | 86 | 87 | OpenProcessDialog.cs 88 | 89 | 90 | UserControl 91 | 92 | 93 | ProcessSelectorCtrl.cs 94 | 95 | 96 | 97 | 98 | 99 | 100 | MainForm.cs 101 | 102 | 103 | OpenProcessDialog.cs 104 | 105 | 106 | ProcessSelectorCtrl.cs 107 | 108 | 109 | ResXFileCodeGenerator 110 | Resources.Designer.cs 111 | Designer 112 | 113 | 114 | True 115 | Resources.resx 116 | True 117 | 118 | 119 | 120 | 121 | SettingsSingleFileGenerator 122 | Settings.Designer.cs 123 | 124 | 125 | True 126 | Settings.settings 127 | True 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | Designer 142 | 143 | 144 | 145 | 146 | 153 | -------------------------------------------------------------------------------- /SRWE/SRWE.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dtgDTGdtg/SRWE/b439859e15ca44b6c4715fdb015c321a49ef634a/SRWE/SRWE.ico -------------------------------------------------------------------------------- /SRWE/SRWE_Settings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using System.IO; 5 | using System.Xml; 6 | using System.Xml.XPath; 7 | using System.Globalization; 8 | using System.Windows.Forms; 9 | 10 | 11 | namespace SRWE 12 | { 13 | static class SRWE_Defaults 14 | { 15 | internal static readonly bool ForceExitSizeMoveMessage = false; 16 | internal static readonly bool AutoAttachToLastKnownProcess = false; 17 | internal static readonly int MaxNumberOfRecentProfiles = 20; 18 | } 19 | 20 | /// 21 | /// SRWE_Settings class. 22 | /// 23 | static class SRWE_Settings 24 | { 25 | private static string s_settingsPath; 26 | private static XmlDocument s_xmlSettings, s_xmlDefaultSettings; 27 | private static int s_nUpdateInterval; 28 | private static bool s_bForceExitSizeMoveMessage, s_bAutoAttachToLastKnownProcess; 29 | private static List s_recentProfiles; 30 | private static List s_recentProcesses; 31 | private static List s_hotKeys = new List(); 32 | 33 | static SRWE_Settings() 34 | { 35 | using(MemoryStream ms = new MemoryStream(Properties.Resources.XML_Settings)) 36 | { 37 | s_xmlDefaultSettings = new XmlDocument(); 38 | s_xmlDefaultSettings.Load(ms); 39 | ms.Close(); 40 | } 41 | try 42 | { 43 | s_settingsPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); 44 | s_settingsPath = Path.Combine(s_settingsPath, "SRWE"); 45 | Directory.CreateDirectory(s_settingsPath); 46 | s_settingsPath = Path.Combine(s_settingsPath, "Settings.xml"); 47 | 48 | if(!File.Exists(s_settingsPath)) 49 | { 50 | File.WriteAllBytes(s_settingsPath, Properties.Resources.XML_Settings); 51 | } 52 | s_xmlSettings = new XmlDocument(); 53 | try 54 | { 55 | s_xmlSettings.Load(s_settingsPath); 56 | } 57 | catch 58 | { 59 | // failure during load, write out new settings file and load that one instead. This is nicer than flushing any older settings file as 60 | // we can now migrate any old file to new versions without flushing old settings. 61 | File.WriteAllBytes(s_settingsPath, Properties.Resources.XML_Settings); 62 | s_xmlSettings.Load(s_settingsPath); 63 | } 64 | bool versionMisMatch = !CheckSettingsVersion(s_xmlSettings.DocumentElement.Attributes["Version"]); 65 | LoadSettings(); 66 | if(versionMisMatch) 67 | { 68 | // bump version to one in default xml document 69 | s_xmlSettings.DocumentElement.Attributes["Version"].Value = s_xmlDefaultSettings.DocumentElement.Attributes["Version"].Value; 70 | // write the settings out again, as they've been migrated to a new version 71 | s_xmlSettings.Save(s_settingsPath); 72 | } 73 | } 74 | catch 75 | { 76 | s_xmlSettings = (XmlDocument)s_xmlDefaultSettings.Clone(); 77 | LoadSettings(); 78 | } 79 | } 80 | 81 | public static void AddRecentProcess(string name) 82 | { 83 | XmlNode xmlProcess = s_xmlSettings.DocumentElement.SelectSingleNode("RecentProcesses/Process[@Name='" + name + "']"); 84 | 85 | if (xmlProcess != null) 86 | { 87 | if (xmlProcess != xmlProcess.ParentNode.FirstChild) 88 | { 89 | XmlNode xmlParent = xmlProcess.ParentNode; 90 | xmlParent.RemoveChild(xmlProcess); 91 | xmlParent.PrependChild(xmlProcess); 92 | } 93 | } 94 | else 95 | { 96 | XmlNode xmlRecentProcesses = s_xmlSettings.DocumentElement["RecentProcesses"]; 97 | if(xmlRecentProcesses.ChildNodes.Count > SRWE_Defaults.MaxNumberOfRecentProfiles) 98 | { 99 | xmlRecentProcesses.RemoveChild(xmlRecentProcesses.ChildNodes[xmlRecentProcesses.ChildNodes.Count - 1]); 100 | } 101 | xmlProcess = s_xmlSettings.CreateElement("Process"); 102 | xmlProcess.Attributes.Append(s_xmlSettings.CreateAttribute("Name")).Value = name; 103 | s_xmlSettings.DocumentElement["RecentProcesses"].PrependChild(xmlProcess); 104 | } 105 | 106 | s_recentProcesses = new List(); 107 | 108 | foreach (XmlNode xmlItem in s_xmlSettings.DocumentElement.SelectNodes("RecentProcesses/Process")) 109 | s_recentProcesses.Add(xmlItem.Attributes["Name"].Value); 110 | 111 | s_xmlSettings.Save(s_settingsPath); 112 | } 113 | 114 | public static void RemoveRecentProcess(string name) 115 | { 116 | XmlNode xmlParent = s_xmlSettings.DocumentElement["RecentProcesses"]; 117 | XmlNodeList xmlProcesses = xmlParent.SelectNodes("Process[@Name='" + name + "']"); 118 | 119 | for (int i = xmlProcesses.Count - 1; i >= 0; i--) 120 | xmlParent.RemoveChild(xmlProcesses[i]); 121 | 122 | s_recentProcesses = new List(); 123 | 124 | foreach (XmlNode xmlItem in xmlParent.SelectNodes("Process")) 125 | s_recentProcesses.Add(xmlItem.Attributes["name"].Value); 126 | 127 | s_xmlSettings.Save(s_settingsPath); 128 | } 129 | 130 | public static void AddRecentProfile(string filepath) 131 | { 132 | if (!File.Exists(filepath)) return; 133 | 134 | XmlNode xmlProfile = s_xmlSettings.DocumentElement.SelectSingleNode("RecentProfiles/Profile[@FilePath='" + filepath + "']"); 135 | 136 | if (xmlProfile != null) 137 | { 138 | if (xmlProfile != xmlProfile.ParentNode.FirstChild) 139 | { 140 | XmlNode xmlParent = xmlProfile.ParentNode; 141 | xmlParent.RemoveChild(xmlProfile); 142 | xmlParent.PrependChild(xmlProfile); 143 | } 144 | } 145 | else 146 | { 147 | XmlNode xmlRecentProfiles = s_xmlSettings.DocumentElement["RecentProfiles"]; 148 | if(xmlRecentProfiles.ChildNodes.Count > 19) 149 | { 150 | xmlRecentProfiles.RemoveChild(xmlRecentProfiles.ChildNodes[xmlRecentProfiles.ChildNodes.Count - 1]); 151 | } 152 | 153 | xmlProfile = s_xmlSettings.CreateElement("Profile"); 154 | xmlProfile.Attributes.Append(s_xmlSettings.CreateAttribute("FilePath")).Value = filepath; 155 | s_xmlSettings.DocumentElement["RecentProfiles"].PrependChild(xmlProfile); 156 | } 157 | 158 | s_recentProfiles = new List(); 159 | 160 | foreach (XmlNode xmlItem in s_xmlSettings.DocumentElement.SelectNodes("RecentProfiles/Profile")) 161 | s_recentProfiles.Add(xmlItem.Attributes["FilePath"].Value); 162 | 163 | s_xmlSettings.Save(s_settingsPath); 164 | } 165 | 166 | public static void RemoveRecentProfile(string filepath) 167 | { 168 | XmlNode xmlParent = s_xmlSettings.DocumentElement["RecentProfiles"]; 169 | XmlNodeList xmlProfiles = xmlParent.SelectNodes("Profile[@FilePath='" + filepath + "']"); 170 | 171 | for (int i = xmlProfiles.Count - 1; i >= 0; i--) 172 | xmlParent.RemoveChild(xmlProfiles[i]); 173 | 174 | s_recentProfiles = new List(); 175 | 176 | foreach (XmlNode xmlItem in xmlParent.SelectNodes("Profile")) 177 | s_recentProfiles.Add(xmlItem.Attributes["FilePath"].Value); 178 | 179 | s_xmlSettings.Save(s_settingsPath); 180 | } 181 | 182 | 183 | 184 | private static bool CheckSettingsVersion(XmlAttribute attribVersion) 185 | { 186 | return (attribVersion != null && attribVersion.Value == s_xmlDefaultSettings.DocumentElement.Attributes["Version"].Value); 187 | } 188 | 189 | 190 | private static void LoadSettings() 191 | { 192 | var settingsElement = s_xmlSettings.DocumentElement["Settings"]; 193 | s_nUpdateInterval = SRWE_Utility.SAFE_String_2_Int(settingsElement["UpdateInterval"].Attributes["Value"].Value, 1000); 194 | var forceExitSizeMoveMessageElement = settingsElement["ForceExitSizeMoveMessage"]; 195 | if(forceExitSizeMoveMessageElement == null) 196 | { 197 | // migrate settings file. 198 | forceExitSizeMoveMessageElement = SRWE_Utility.AppendChildElement(s_xmlSettings, settingsElement, "ForceExitSizeMoveMessage"); 199 | SRWE_Utility.AppendAttribute(s_xmlSettings, forceExitSizeMoveMessageElement, "Value"); 200 | SetForceExitSizeMoveMessageValue(); 201 | } 202 | else 203 | { 204 | s_bForceExitSizeMoveMessage = SRWE_Utility.SAFE_String_2_Bool(forceExitSizeMoveMessageElement.Attributes["Value"].Value, SRWE_Defaults.ForceExitSizeMoveMessage); 205 | } 206 | var autoAttachToLastKnownProcessElement = settingsElement["AutoAttachToLastKnownProcess"]; 207 | if(autoAttachToLastKnownProcessElement==null) 208 | { 209 | // migrate settings file 210 | autoAttachToLastKnownProcessElement = SRWE_Utility.AppendChildElement(s_xmlSettings, settingsElement, "AutoAttachToLastKnownProcess"); 211 | SRWE_Utility.AppendAttribute(s_xmlSettings, autoAttachToLastKnownProcessElement, "Value"); 212 | SetAutoAttachToLastKnownProcessValue(); 213 | } 214 | else 215 | { 216 | s_bAutoAttachToLastKnownProcess = SRWE_Utility.SAFE_String_2_Bool(autoAttachToLastKnownProcessElement.Attributes["Value"].Value, SRWE_Defaults.AutoAttachToLastKnownProcess); 217 | } 218 | 219 | if(s_nUpdateInterval < 100) 220 | s_nUpdateInterval = 100; 221 | else if(s_nUpdateInterval > 30000) 222 | s_nUpdateInterval = 30000; 223 | 224 | XmlNodeList xmlNodes = s_xmlSettings.DocumentElement.SelectNodes("RecentProcesses/Process"); 225 | s_recentProcesses = new List(); 226 | 227 | foreach(XmlNode xmlItem in xmlNodes) 228 | s_recentProcesses.Add(xmlItem.Attributes["Name"].Value); 229 | 230 | xmlNodes = s_xmlSettings.DocumentElement.SelectNodes("RecentProfiles/Profile"); 231 | s_recentProfiles = new List(); 232 | 233 | foreach(XmlNode xmlItem in xmlNodes) 234 | s_recentProfiles.Add(xmlItem.Attributes["FilePath"].Value); 235 | 236 | s_hotKeys.Clear(); 237 | xmlNodes = s_xmlSettings.DocumentElement.SelectNodes("HotKeys/HotKey"); 238 | foreach(XmlNode hotkey in xmlNodes) s_hotKeys.Add(new SRWE_HotKey((XmlElement)hotkey)); 239 | } 240 | 241 | private static void SetForceExitSizeMoveMessageValue() 242 | { 243 | s_xmlSettings.DocumentElement["Settings"]["ForceExitSizeMoveMessage"].Attributes["Value"].Value = XmlConvert.ToString(s_bForceExitSizeMoveMessage); 244 | } 245 | 246 | 247 | private static void SetAutoAttachToLastKnownProcessValue() 248 | { 249 | s_xmlSettings.DocumentElement["Settings"]["AutoAttachToLastKnownProcess"].Attributes["Value"].Value = XmlConvert.ToString(s_bAutoAttachToLastKnownProcess); 250 | } 251 | 252 | 253 | public static int UpdateInterval 254 | { 255 | get { return s_nUpdateInterval; } 256 | } 257 | 258 | public static List RecentProcesses 259 | { 260 | get { return s_recentProcesses; } 261 | } 262 | 263 | public static List RecentProfiles 264 | { 265 | get { return s_recentProfiles; } 266 | } 267 | 268 | public static List HotKeys 269 | { 270 | get { return s_hotKeys; } 271 | } 272 | 273 | public static bool ForceExitSizeMoveMessage 274 | { 275 | get { return s_bForceExitSizeMoveMessage; } 276 | set 277 | { 278 | bool currentValue = s_bForceExitSizeMoveMessage; 279 | if(value != currentValue) 280 | { 281 | s_bForceExitSizeMoveMessage = value; 282 | SetForceExitSizeMoveMessageValue(); 283 | s_xmlSettings.Save(s_settingsPath); 284 | } 285 | } 286 | } 287 | 288 | public static bool AutoAttachToLastKnownProcess 289 | { 290 | get { return s_bAutoAttachToLastKnownProcess; } 291 | set 292 | { 293 | bool currentValue = s_bAutoAttachToLastKnownProcess; 294 | if(currentValue != value) 295 | { 296 | s_bAutoAttachToLastKnownProcess = value; 297 | SetAutoAttachToLastKnownProcessValue(); 298 | s_xmlSettings.Save(s_settingsPath); 299 | } 300 | } 301 | } 302 | } 303 | 304 | /// 305 | /// SRWE_Utility class. 306 | /// 307 | static class SRWE_Utility 308 | { 309 | public static XmlElement AppendChildElement(XmlDocument document, XmlNode parent, string elementName) 310 | { 311 | var toAdd = document.CreateElement(elementName); 312 | parent.AppendChild(toAdd); 313 | return toAdd; 314 | } 315 | 316 | public static XmlAttribute AppendAttribute(XmlDocument document, XmlNode node, string attributeName) 317 | { 318 | var toAdd = document.CreateAttribute(attributeName); 319 | node.Attributes.Append(toAdd); 320 | return toAdd; 321 | } 322 | 323 | public static int SAFE_String_2_Int(string value, int nDefValue) 324 | { 325 | int nResult; 326 | 327 | if (int.TryParse(value, out nResult)) 328 | return nResult; 329 | return nDefValue; 330 | } 331 | 332 | public static float SAFE_String_2_Float(string value) 333 | { 334 | if(string.IsNullOrEmpty(value)) 335 | { 336 | return 0.0f; 337 | } 338 | 339 | var cultureInfoToUse = value.Contains(".") ? CultureInfo.InvariantCulture : CultureInfo.CurrentCulture; 340 | if(float.TryParse(value, NumberStyles.Any, cultureInfoToUse, out var result)) 341 | { 342 | return result; 343 | } 344 | return 1f; 345 | } 346 | 347 | public static int SAFE_HexString_2_Int(string hexString, int nDefValue) 348 | { 349 | int nResult; 350 | 351 | if(int.TryParse(hexString, NumberStyles.AllowHexSpecifier, CultureInfo.CurrentCulture, out nResult)) 352 | { 353 | return nResult; 354 | } 355 | 356 | return nDefValue; 357 | } 358 | 359 | public static bool SAFE_String_2_Bool(string value, bool defaultValue) 360 | { 361 | if(string.IsNullOrEmpty(value)) 362 | { 363 | return defaultValue; 364 | } 365 | // TryParse doesn't work, as it can't deal with 1, 0, and true/false case differences. 366 | try 367 | { 368 | return XmlConvert.ToBoolean(value); 369 | } 370 | catch 371 | { 372 | // not a bool 373 | return defaultValue; 374 | } 375 | } 376 | 377 | public static string SAFE_XmlNodeValue(XmlNode xmlNode) 378 | { 379 | if (xmlNode != null) return xmlNode.InnerText; 380 | 381 | return ""; 382 | } 383 | 384 | internal static float SAFE_ParseRatio(string text) 385 | { 386 | string[] ratios = text.Split(':'); 387 | float w, h; 388 | 389 | if (ratios.Length != 2) 390 | return 1f; 391 | 392 | if (!float.TryParse(ratios[0], out w)) 393 | return 1f; 394 | if (!float.TryParse(ratios[1], out h)) 395 | return 1f; 396 | 397 | if (w <= 0 || h <= 0) 398 | return 1f; 399 | 400 | return w / h; 401 | } 402 | } 403 | 404 | /// 405 | /// SRWE_HotKey class. 406 | /// 407 | class SRWE_HotKey 408 | { 409 | public string Name { get; private set; } 410 | public Keys? HotKey { get; private set; } 411 | public bool CTRL { get; private set; } 412 | public bool ALT { get; private set; } 413 | public bool SHIFT { get; private set; } 414 | 415 | public SRWE_HotKey(XmlElement xmlHotKey) 416 | { 417 | this.Name = SRWE_Utility.SAFE_XmlNodeValue(xmlHotKey.Attributes["Name"]); 418 | 419 | Keys key; 420 | if (Enum.TryParse(xmlHotKey.InnerText, out key)) this.HotKey = key; 421 | 422 | this.CTRL = SRWE_Utility.SAFE_XmlNodeValue(xmlHotKey.Attributes["CTRL"]) == "1"; 423 | this.ALT = SRWE_Utility.SAFE_XmlNodeValue(xmlHotKey.Attributes["ALT"]) == "1"; 424 | this.SHIFT = SRWE_Utility.SAFE_XmlNodeValue(xmlHotKey.Attributes["SHIFT"]) == "1"; 425 | } 426 | } 427 | } 428 | -------------------------------------------------------------------------------- /SRWE/Window.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using System.Runtime.InteropServices; 5 | using System.Diagnostics; 6 | 7 | namespace SRWE 8 | { 9 | /// 10 | /// Window class 11 | /// 12 | class Window 13 | { 14 | private class ETWP_Param 15 | { 16 | public int m_nThreadID; 17 | public Window m_parent; 18 | public int m_hAppMainWnd; 19 | public List m_windowList; 20 | } 21 | 22 | [Flags] 23 | private enum Changes 24 | { 25 | None = 0, 26 | Pos = 1, 27 | Size = 2, 28 | Style = 4, 29 | ExStyle = 8 30 | } 31 | 32 | private int m_hWnd; 33 | private Window m_parent; 34 | private int m_nThreadID; 35 | private string m_hierID; 36 | public List m_childList; 37 | private WINDOWINFO m_windowInfo; 38 | private RECT m_relWindowRC; 39 | private RECT m_relClientRC; 40 | private string m_text; 41 | private string m_class; 42 | private Changes m_changes; 43 | 44 | private Window(int nHandle, Window parent, int nThreadID) 45 | { 46 | m_hWnd = nHandle; 47 | m_parent = parent; 48 | m_nThreadID = nThreadID; 49 | m_childList = new List(); 50 | 51 | StringBuilder sb = new StringBuilder(256); 52 | WinAPI.RealGetWindowClass(m_hWnd, sb, sb.Capacity - 1); 53 | m_class = sb.ToString(); 54 | 55 | m_windowInfo = new WINDOWINFO(); 56 | m_windowInfo.cbSize = (uint)Marshal.SizeOf(m_windowInfo); 57 | 58 | m_relWindowRC = new RECT(); 59 | m_relClientRC = new RECT(); 60 | 61 | m_changes = Changes.None; 62 | 63 | Refresh(); 64 | GetChildWindows(); 65 | } 66 | 67 | public static List GetProcessWindows(Process process) 68 | { 69 | WinAPI.EnumWindowsProc etwp = new WinAPI.EnumWindowsProc(EnumThreadWndProc); 70 | ETWP_Param lParam = new ETWP_Param(); 71 | lParam.m_hAppMainWnd = (int)process.MainWindowHandle; 72 | lParam.m_windowList = new List(); 73 | GCHandle gch = GCHandle.Alloc(lParam); 74 | 75 | RestoreWindow(lParam.m_hAppMainWnd); 76 | 77 | foreach (ProcessThread thread in process.Threads) 78 | { 79 | lParam.m_nThreadID = thread.Id; 80 | WinAPI.EnumThreadWindows(thread.Id, etwp, GCHandle.ToIntPtr(gch)); 81 | } 82 | gch.Free(); 83 | 84 | GenerateHierarchicalIDs(lParam.m_windowList); 85 | 86 | return lParam.m_windowList; 87 | } 88 | 89 | public static Window GetFromHWND(int hWnd) 90 | { 91 | if (hWnd == 0 || !WinAPI.IsWindow(hWnd)) return null; 92 | 93 | return new Window(hWnd, null, 0); 94 | } 95 | 96 | private static void RestoreWindow(int hWnd) 97 | { 98 | if (hWnd == 0 || !WinAPI.IsWindow(hWnd)) return; 99 | 100 | if (WinAPI.IsIconic(hWnd)) WinAPI.ShowWindow(hWnd, WinAPI.SW_SHOWNOACTIVATE); 101 | } 102 | 103 | private static bool EnumThreadWndProc(int hwnd, IntPtr lParam) 104 | { 105 | if (lParam != IntPtr.Zero) 106 | { 107 | ETWP_Param param = (ETWP_Param)GCHandle.FromIntPtr(lParam).Target; 108 | 109 | if (param.m_hAppMainWnd != 0 && param.m_hAppMainWnd == hwnd) 110 | param.m_windowList.Insert(0, new Window(hwnd, null, param.m_nThreadID)); 111 | else 112 | param.m_windowList.Add(new Window(hwnd, null, param.m_nThreadID)); 113 | 114 | return true; 115 | } 116 | return false; 117 | } 118 | 119 | private static void GenerateHierarchicalIDs(List windowList) 120 | { 121 | for (int i = 0, iMax = windowList.Count; i < iMax; i++) 122 | { 123 | if (windowList[i].m_parent == null) windowList[i].m_hierID = (i + 1).ToString(); 124 | else windowList[i].m_hierID = windowList[i].m_parent.m_hierID + '.' + (i + 1).ToString(); 125 | GenerateHierarchicalIDs(windowList[i].m_childList); 126 | } 127 | } 128 | 129 | private void GetChildWindows() 130 | { 131 | WinAPI.EnumWindowsProc ecwp = new WinAPI.EnumWindowsProc(EnumChildProc); 132 | ETWP_Param lParam = new ETWP_Param(); 133 | lParam.m_parent = this; 134 | lParam.m_nThreadID = m_nThreadID; 135 | GCHandle gch = GCHandle.Alloc(lParam); 136 | WinAPI.EnumChildWindows(m_hWnd, ecwp, GCHandle.ToIntPtr(gch)); 137 | gch.Free(); 138 | } 139 | 140 | private static bool EnumChildProc(int hwnd, IntPtr lParam) 141 | { 142 | if (lParam != IntPtr.Zero) 143 | { 144 | ETWP_Param param = (ETWP_Param)GCHandle.FromIntPtr(lParam).Target; 145 | param.m_parent.m_childList.Add(new Window(hwnd, param.m_parent, param.m_nThreadID)); 146 | return true; 147 | } 148 | return false; 149 | } 150 | 151 | public void Refresh() 152 | { 153 | StringBuilder sb = new StringBuilder(256); 154 | WinAPI.GetWindowText(m_hWnd, sb, sb.Capacity - 1); 155 | m_text = sb.ToString(); 156 | 157 | WinAPI.GetWindowInfo(m_hWnd, ref m_windowInfo); 158 | RECT.CopyRect(m_windowInfo.rcWindow, ref m_relWindowRC); 159 | RECT.CopyRect(m_windowInfo.rcClient, ref m_relClientRC); 160 | 161 | if (m_parent != null) 162 | { 163 | WINDOWINFO winInfoParent = new WINDOWINFO(); 164 | winInfoParent.cbSize = (uint)Marshal.SizeOf(typeof(WINDOWINFO)); 165 | WinAPI.GetWindowInfo(m_parent.m_hWnd, ref winInfoParent); 166 | 167 | MakeRectRelative(winInfoParent.rcClient, ref m_relWindowRC); 168 | MakeRectRelative(winInfoParent.rcClient, ref m_relClientRC); 169 | } 170 | } 171 | 172 | public void RefreshRectangles() 173 | { 174 | WinAPI.GetWindowInfo(m_hWnd, ref m_windowInfo); 175 | RECT.CopyRect(m_windowInfo.rcWindow, ref m_relWindowRC); 176 | RECT.CopyRect(m_windowInfo.rcClient, ref m_relClientRC); 177 | 178 | if (m_parent != null) 179 | { 180 | WINDOWINFO winInfoParent = new WINDOWINFO(); 181 | winInfoParent.cbSize = (uint)Marshal.SizeOf(typeof(WINDOWINFO)); 182 | WinAPI.GetWindowInfo(m_parent.m_hWnd, ref winInfoParent); 183 | 184 | MakeRectRelative(winInfoParent.rcClient, ref m_relWindowRC); 185 | MakeRectRelative(winInfoParent.rcClient, ref m_relClientRC); 186 | } 187 | } 188 | 189 | public void ApplyChanges() 190 | { 191 | uint uFlags = WinAPI.SWP_NOSIZE | WinAPI.SWP_NOMOVE | WinAPI.SWP_NOZORDER | WinAPI.SWP_NOACTIVATE | WinAPI.SWP_NOOWNERZORDER | WinAPI.SWP_NOSENDCHANGING; 192 | 193 | if ((m_changes & Changes.Style) != 0) 194 | { 195 | WinAPI.SetWindowLong(m_hWnd, WinAPI.GWL_STYLE, m_windowInfo.dwStyle); 196 | uFlags |= WinAPI.SWP_FRAMECHANGED; 197 | } 198 | if ((m_changes & Changes.ExStyle) != 0) 199 | { 200 | WinAPI.SetWindowLong(m_hWnd, WinAPI.GWL_EXSTYLE, m_windowInfo.dwExStyle); 201 | uFlags |= WinAPI.SWP_FRAMECHANGED; 202 | } 203 | if ((m_changes & Changes.Pos) != 0) 204 | uFlags ^= WinAPI.SWP_NOMOVE; 205 | if ((m_changes & Changes.Size) != 0) 206 | uFlags ^= WinAPI.SWP_NOSIZE; 207 | 208 | if ((uFlags & (WinAPI.SWP_NOMOVE + WinAPI.SWP_NOSIZE)) != (WinAPI.SWP_NOMOVE + WinAPI.SWP_NOSIZE) && (WinAPI.IsIconic(m_hWnd) || WinAPI.IsZoomed(m_hWnd))) 209 | WinAPI.ShowWindow(m_hWnd, WinAPI.SW_SHOWNOACTIVATE); 210 | 211 | WinAPI.SetWindowPos(m_hWnd, 0, m_relWindowRC.left, m_relWindowRC.top, m_relWindowRC.Width, m_relWindowRC.Height, uFlags); 212 | if(SRWE_Settings.ForceExitSizeMoveMessage) 213 | { 214 | WinAPI.SendMessage(m_hWnd, WinAPI.WM_EXITSIZEMOVE, 0, 0); 215 | } 216 | m_changes = Changes.None; 217 | } 218 | 219 | public void RemoveBorders() 220 | { 221 | uint nStyle = (uint)WinAPI.GetWindowLong(m_hWnd, WinAPI.GWL_STYLE); 222 | nStyle = (nStyle | (WinAPI.WS_THICKFRAME + WinAPI.WS_DLGFRAME + WinAPI.WS_BORDER)) ^ (WinAPI.WS_THICKFRAME + WinAPI.WS_DLGFRAME + WinAPI.WS_BORDER); 223 | WinAPI.SetWindowLong(m_hWnd, WinAPI.GWL_STYLE, nStyle); 224 | 225 | nStyle = (uint)WinAPI.GetWindowLong(m_hWnd, WinAPI.GWL_EXSTYLE); 226 | nStyle = (nStyle | (WinAPI.WS_EX_DLGMODALFRAME + WinAPI.WS_EX_WINDOWEDGE + WinAPI.WS_EX_CLIENTEDGE + WinAPI.WS_EX_STATICEDGE)) ^ (WinAPI.WS_EX_DLGMODALFRAME + WinAPI.WS_EX_WINDOWEDGE + WinAPI.WS_EX_CLIENTEDGE + WinAPI.WS_EX_STATICEDGE); 227 | WinAPI.SetWindowLong(m_hWnd, WinAPI.GWL_EXSTYLE, nStyle); 228 | 229 | uint uFlags = WinAPI.SWP_NOSIZE | WinAPI.SWP_NOMOVE | WinAPI.SWP_NOZORDER | WinAPI.SWP_NOACTIVATE | WinAPI.SWP_NOOWNERZORDER | WinAPI.SWP_NOSENDCHANGING | WinAPI.SWP_FRAMECHANGED; 230 | WinAPI.SetWindowPos(m_hWnd, 0, 0, 0, 0, 0, uFlags); 231 | } 232 | 233 | public int PosX 234 | { 235 | get { return m_relWindowRC.left; } 236 | set 237 | { 238 | if (m_relWindowRC.left != value) 239 | { 240 | int nWidth = m_relWindowRC.Width; 241 | m_relWindowRC.left = value; 242 | m_relWindowRC.right = value + nWidth; 243 | m_changes |= Changes.Pos; 244 | } 245 | } 246 | } 247 | 248 | public int PosY 249 | { 250 | get { return m_relWindowRC.top; } 251 | set 252 | { 253 | if (m_relWindowRC.top != value) 254 | { 255 | int nHeight = m_relWindowRC.Height; 256 | m_relWindowRC.top = value; 257 | m_relWindowRC.bottom = value + nHeight; 258 | m_changes |= Changes.Pos; 259 | } 260 | } 261 | } 262 | 263 | public int Width 264 | { 265 | get { return m_relWindowRC.Width; } 266 | set 267 | { 268 | if (m_relWindowRC.Width != value) 269 | { 270 | m_relWindowRC.right = m_relWindowRC.left + value; 271 | m_changes |= Changes.Size; 272 | } 273 | } 274 | } 275 | 276 | public int Height 277 | { 278 | get { return m_relWindowRC.Height; } 279 | set 280 | { 281 | if (m_relWindowRC.Height != value) 282 | { 283 | m_relWindowRC.bottom = m_relWindowRC.top + value; 284 | m_changes |= Changes.Size; 285 | } 286 | } 287 | } 288 | 289 | public float Scale = 1f; 290 | 291 | public uint Style 292 | { 293 | get { return m_windowInfo.dwStyle; } 294 | set 295 | { 296 | if (m_windowInfo.dwStyle != value) 297 | { 298 | m_windowInfo.dwStyle = value; 299 | m_changes |= Changes.Style; 300 | } 301 | } 302 | } 303 | 304 | public uint ExStyle 305 | { 306 | get { return m_windowInfo.dwExStyle; } 307 | set 308 | { 309 | if (m_windowInfo.dwExStyle != value) 310 | { 311 | m_windowInfo.dwExStyle = value; 312 | m_changes |= Changes.ExStyle; 313 | } 314 | } 315 | } 316 | 317 | public RECT ClientRect 318 | { 319 | get { return m_relClientRC; } 320 | } 321 | 322 | public uint BorderWidth 323 | { 324 | get { return m_windowInfo.cxWindowBorders; } 325 | } 326 | 327 | public uint BorderHeight 328 | { 329 | get { return m_windowInfo.cyWindowBorders; } 330 | } 331 | 332 | public string DisplayName 333 | { 334 | get 335 | { 336 | if (string.IsNullOrEmpty(m_text)) 337 | return m_hierID + ". (" + m_hWnd.ToString("X8") + ')'; 338 | 339 | string winName; 340 | 341 | if (m_text.Length > 64) 342 | winName = m_text.Substring(0, 61) + "..."; 343 | else 344 | winName = m_text; 345 | 346 | return m_hierID + ". " + winName; 347 | } 348 | } 349 | 350 | public int Handle 351 | { 352 | get { return m_hWnd; } 353 | } 354 | 355 | public bool IsWindow 356 | { 357 | get { return WinAPI.IsWindow(m_hWnd); } 358 | } 359 | 360 | public Window Parent 361 | { 362 | get { return m_parent; } 363 | } 364 | 365 | public string Class 366 | { 367 | get { return m_class; } 368 | } 369 | 370 | public string Text 371 | { 372 | get { return m_text; } 373 | } 374 | 375 | public string HierarchicalID 376 | { 377 | get { return m_hierID; } 378 | } 379 | 380 | public int ThreadID 381 | { 382 | get { return m_nThreadID; } 383 | } 384 | 385 | private static void MakeRectRelative(RECT rcParent, ref RECT rcDest) 386 | { 387 | rcDest.left = rcDest.left - rcParent.left; 388 | rcDest.top = rcDest.top - rcParent.top; 389 | rcDest.right = rcDest.right - rcParent.left; 390 | rcDest.bottom = rcDest.bottom - rcParent.top; 391 | } 392 | } 393 | 394 | /// 395 | /// WinAPI class. 396 | /// 397 | static class WinAPI 398 | { 399 | public const int GWL_STYLE = -16; 400 | public const int GWL_EXSTYLE = -20; 401 | 402 | public const uint SWP_NOSIZE = 0x01; 403 | public const uint SWP_NOMOVE = 0x02; 404 | public const uint SWP_NOZORDER = 0x04; 405 | public const uint SWP_NOACTIVATE = 0x10; 406 | public const uint SWP_NOOWNERZORDER = 0x200; 407 | public const uint SWP_NOSENDCHANGING = 0x400; 408 | public const uint SWP_FRAMECHANGED = 0x20; 409 | 410 | public const uint WS_THICKFRAME = 0x40000; 411 | public const uint WS_DLGFRAME = 0x400000; 412 | public const uint WS_BORDER = 0x800000; 413 | 414 | public const uint WS_EX_DLGMODALFRAME = 1; 415 | public const uint WS_EX_WINDOWEDGE = 0x100; 416 | public const uint WS_EX_CLIENTEDGE = 0200; 417 | public const uint WS_EX_STATICEDGE = 0x20000; 418 | 419 | public const int SW_SHOWNOACTIVATE = 4; 420 | public const int SW_RESTORE = 9; 421 | 422 | public const int WM_EXITSIZEMOVE = 0x0232; 423 | 424 | [UnmanagedFunctionPointer(CallingConvention.StdCall, CharSet = CharSet.Unicode)] 425 | public delegate bool EnumWindowsProc(int hwnd, IntPtr lParam); 426 | 427 | [DllImport("USER32.DLL", CharSet = CharSet.Unicode)] 428 | public static extern bool EnumThreadWindows(int dwThreadId, EnumWindowsProc lpfn, IntPtr lParam); 429 | 430 | [DllImport("USER32.DLL", CharSet = CharSet.Unicode)] 431 | public static extern bool EnumChildWindows(int hWndParent, EnumWindowsProc lpEnumFunc, IntPtr lParam); 432 | 433 | [DllImport("USER32.DLL", CharSet = CharSet.Unicode)] 434 | public static extern int GetWindowText(int hWnd, StringBuilder lpString, int nMaxCount); 435 | 436 | [DllImport("USER32.DLL", CharSet = CharSet.Unicode)] 437 | public static extern uint RealGetWindowClass(int hwnd, StringBuilder pszType, int cchType); 438 | 439 | [DllImport("USER32.DLL", CharSet = CharSet.Unicode)] 440 | public static extern bool IsWindow(int hWnd); 441 | 442 | [DllImport("USER32.DLL", CharSet = CharSet.Unicode)] 443 | public static extern bool GetWindowInfo(int hwnd, ref WINDOWINFO pwi); 444 | 445 | [DllImport("USER32.DLL", CharSet = CharSet.Unicode)] 446 | public static extern int GetWindowLong(int hWnd, int nIndex); 447 | 448 | [DllImport("USER32.DLL", CharSet = CharSet.Unicode)] 449 | public static extern int SetWindowLong(int hWnd, int nIndex, uint dwNewLong); 450 | 451 | [DllImport("USER32.DLL", CharSet = CharSet.Unicode)] 452 | public static extern bool SetWindowPos(int hWnd, int hWndInsertAfter, int x, int y, int cx, int cy, uint uFlags); 453 | 454 | [DllImport("USER32.DLL", CharSet = CharSet.Unicode)] 455 | public static extern bool IsIconic(int hWnd); 456 | 457 | [DllImport("USER32.DLL", CharSet = CharSet.Unicode)] 458 | public static extern bool IsZoomed(int hWnd); 459 | 460 | [DllImport("USER32.DLL", CharSet = CharSet.Unicode)] 461 | public static extern bool ShowWindow(int hWnd, int nCmdShow); 462 | 463 | [DllImport("USER32.DLL", CharSet = CharSet.Unicode)] 464 | public static extern int GetForegroundWindow(); 465 | 466 | [DllImport("USER32.DLL", CharSet = CharSet.Unicode)] 467 | public static extern ushort GetAsyncKeyState(System.Windows.Forms.Keys vKey); 468 | 469 | [DllImport("USER32.DLL", CharSet = CharSet.Unicode)] 470 | public static extern int SendMessage(int hWnd, int msg, int wParam, int lParam); 471 | } 472 | 473 | /// 474 | /// RECT struct. 475 | /// 476 | [StructLayout(LayoutKind.Sequential)] 477 | struct RECT 478 | { 479 | public int left; 480 | public int top; 481 | public int right; 482 | public int bottom; 483 | 484 | public int Width { get { return right - left; } } 485 | public int Height { get { return bottom - top; } } 486 | 487 | public static void CopyRect(RECT rcSrc, ref RECT rcDest) 488 | { 489 | rcDest.left = rcSrc.left; 490 | rcDest.top = rcSrc.top; 491 | rcDest.right = rcSrc.right; 492 | rcDest.bottom = rcSrc.bottom; 493 | } 494 | } 495 | 496 | /// 497 | /// WINDOWINFO struct. 498 | /// 499 | [StructLayout(LayoutKind.Sequential)] 500 | struct WINDOWINFO 501 | { 502 | public uint cbSize; 503 | public RECT rcWindow; 504 | public RECT rcClient; 505 | public uint dwStyle; 506 | public uint dwExStyle; 507 | public uint dwWindowStatus; 508 | public uint cxWindowBorders; 509 | public uint cyWindowBorders; 510 | public ushort atomWindowType; 511 | public ushort wCreatorVersion; 512 | } 513 | } 514 | -------------------------------------------------------------------------------- /SRWE/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /SRWE/app.manifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 52 | 53 | 54 | 55 | true 56 | 57 | 58 | 59 | 60 | 61 | 75 | 76 | 77 | --------------------------------------------------------------------------------