This has been updated and moved here: https://gist.github.com/codeartery/8bed157ff8ede837ee423c9ab3ce9562
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
Class ClipBoardText | |
REM @author: Jeremy England ( SimplyCoded ) | |
REM @info: Set, get, append, and clear your clipboard text. | |
REM @mini: Class ClipBoardText:Property Get Text:Text=CreateObject("HTMLFile").parentWindow.clipboardData.getData("Text"):If IsNull(Text)Then Text="":End If:End Property:Property Let Text(s):CreateObject("WScript.Shell").Run "mshta.exe javascript:eval(""document.parentWindow.clipboardData.setData('text','"&Replace(Replace(s,"'","\\u0027"),"""","\\u0022")&"');close()"")",0,True:End Property:Sub ClearText:Text="":End Sub:Sub AddText(s):Text=Text&s:End Sub:End Class | |
Property Get Text | |
Text = CreateObject( "HTMLFile" ).parentWindow.clipboardData.getData( "Text" ) | |
If IsNull( Text )Then Text = "" | |
End Property | |
Property Let Text( str ) |
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); |
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
Sub AlwaysOnTop(appName, regExpTitle, setOnTop) | |
' @description: Makes a window always on top if setOnTop is true, else makes it normal again. Will wait up to 10 seconds for window to load. | |
' @author: Jeremy England (SimplyCoded) | |
If (setOnTop) Then setOnTop = "-1" Else setOnTop = "-2" | |
CreateObject("wscript.shell").Run "powershell -Command """ & _ | |
"$Code = Add-Type -MemberDefinition '" & vbcrlf & _ | |
" [DllImport(\""user32.dll\"")] public static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X,int Y, int cx, int cy, uint uFlags);" & vbcrlf & _ | |
" [DllImport(\""user32.dll\"")] public static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);" & vbcrlf & _ | |
" public static void AlwaysOnTop (IntPtr fHandle, int insertAfter) {" & vbcrlf & _ | |
" if (insertAfter == -1) { ShowWindow(fHandle, 7); ShowWindow(fHandle, 9); }" & vbcrlf & _ |
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
Class Window | |
'@description: Create a custom window with MSHTA. | |
'@author: Jeremy England (SimplyCoded). | |
Private title, style, body, options, width, height, xpos, ypos | |
Private Sub Class_Initialize() | |
title = " " : width = 350 : height = 250 | |
xpos = "(screen.width - " & width & ")/2" | |
ypos = "(screen.height -" & height & ")/2" | |
style = "html{display:table;}body{display:table-cell;font-family:Arial;background-color:#f6f6f6;}html,body{width:100%;height:100%;margin:0;}" | |
End Sub |
This has been updated and moved here: https://gist.github.com/codeartery/0ea3a74e92d39ce520cffb05a8b99446
This has been updated and moved here: https://gist.github.com/codeartery/1252670806e4b7d8993a38be448f58f0
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
Function BrowseForFolder() | |
'@description: Browse for folder dialog. | |
'@author: Jeremy England (SimplyCoded) | |
Dim oFolder | |
Set oFolder = CreateObject("Shell.Application").BrowseForFolder(0,"Select a Folder",0,0) | |
If (oFolder Is Nothing) Then | |
BrowseForFolder = Empty | |
Else | |
BrowseForFolder = oFolder.Self.Path | |
End If |
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
Function QuickZip(path) | |
'@description: Compress and uncompress zip files. | |
'@author: Jeremy England (SimplyCoded) | |
Dim oFso : Set oFso = CreateObject("Scripting.FileSystemObject") | |
Dim oSap : Set oSap = CreateObject("Shell.Application") | |
Dim oWss : Set oWss = CreateObject("WScript.Shell") | |
Dim isZip, count, root, base, add, out | |
Dim isZipping, isCancelable | |
Const NOT_FOUND = 1 | |
Const NOT_A_ZIP = 2 |
This has been updated and moved here: https://gist.github.com/codeartery/9c0317129b64ce63733ba692a7211dc1
NewerOlder