Last active
July 20, 2024 14:37
-
-
Save simply-coded/4838cc069349037d811ddab515804501 to your computer and use it in GitHub Desktop.
An always on top notepad for taking notes and such.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# makes a notepad process that remains on top of other windows. | |
$cs = Add-Type -MemberDefinition ' | |
[DllImport("user32.dll")] public static extern bool SetWindowPos(IntPtr a, IntPtr b, int c, int d, int e, int f, uint g); | |
public static void AlwaysOnTop(IntPtr a, int d) { SetWindowPos(a, (IntPtr)(-1), 0, d-250, 300, 200, 64); } | |
' -Name PS -PassThru; | |
$hWnd = Start-Process -FilePath notepad -PassThru; | |
$screen = Get-WmiObject -Class Win32_VideoController | Select-Object CurrentVerticalResolution; | |
$cs::AlwaysOnTop($hWnd.MainWindowHandle, $screen.CurrentVerticalResolution); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment