-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEmojiPaster.ps1
More file actions
120 lines (99 loc) · 4.49 KB
/
EmojiPaster.ps1
File metadata and controls
120 lines (99 loc) · 4.49 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
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
110
111
112
113
114
115
116
117
118
119
120
$MainBlock = {
[Void](Add-Type -ReferencedAssemblies System.Windows.Forms,System.Drawing,Microsoft.VisualBasic -TypeDefinition @'
using System;
using System.Runtime.InteropServices;
using DR = System.Drawing;
using SWF = System.Windows.Forms;
namespace Emoji{
public class Wind{
[DllImport("Kernel32.dll")]
public static extern IntPtr GetConsoleWindow();
[DllImport("user32.dll")]
public static extern bool ShowWindow(IntPtr hWnd, Int32 nCmdShow);
public static void Visual (){
SWF.Application.EnableVisualStyles();
}
}
public class F : SWF.Form{
public F (int sx, int sy, string tx){this.Size = new DR.Size(sx,sy);this.Text = tx;}
}
public class L : SWF.Label{
public L (int sx, int sy, int lx, int ly, string tx){this.Size = new DR.Size(sx,sy);this.Location = new DR.Point(lx,ly);this.Text = tx;}
}
public class TB : SWF.TextBox{
public TB (int sx, int sy, int lx, int ly, string tx){this.Size = new DR.Size(sx,sy);this.Location = new DR.Point(lx,ly);this.Text = tx;}
}
public class B : SWF.Button{
public B (int sx, int sy, int lx, int ly, string tx){this.Size = new DR.Size(sx,sy);this.Location = new DR.Point(lx,ly);this.Text = tx;}
}
public class SP{
public static DR.Point PO (int sx, int sy){return (new DR.Point(sx, sy));}
public static DR.Size SI (int sx, int sy){return (new DR.Size(sx, sy));}
}
}
'@)
$Hide = [Emoji.Wind]::GetConsoleWindow()
[Void][Emoji.Wind]::ShowWindow($Hide,0)
[Emoji.Wind]::Visual()
Function Reparse($Ind){
$ButtArr | %{$Count=1}{
$PH = ($Count+($Ind*310))
$_.Text = ''
If($PH -le 1114111 -AND ($PH -lt 55296 -OR $PH -gt 57343)){
$_.Text = [Char]::ConvertFromUtf32(('0x'+[Convert]::ToString($PH,16)))
}
$Count++
}
}
$Window = [Emoji.F]::New(353, 1060, 'Emojis')
$Window.MaximizeBox = $False
#$Window.FormBorderStyle = 'FixedDialog'
$Back = [Emoji.B]::New(25, 25, 15, 10, '-')
$Back.Add_Click({$PageNo.Text = ([Int]($PageNo.Text) - 1);Reparse([Int]($PageNo.Text))})
$Back.Parent = $Window
$PageNo = [Emoji.TB]::New(225, 25, 50, 11, '413')
$PageNo.Add_KeyDown({If($_.KeyCode -eq 'Return'){Reparse([Int]($This.Text))}})
$PageNo.Add_TextChanged({$This.Text = ($This.Text -replace '\D')})
$PageNo.Parent = $Window
$Forward = [Emoji.B]::New(25, 25, 285, 10, '+')
$Forward.Add_Click({$PageNo.Text = ([Int]($PageNo.Text) + 1);Reparse([Int]($PageNo.Text))})
$Forward.Parent = $Window
$Countx = 0
$County = 0
$ToolTip = New-Object System.Windows.Forms.ToolTip
$Script:ButtArr = (1..310 | %{
$Temp = [Char]::ConvertFromUtf32(('0x'+[Convert]::ToString(($_+(413*310)),16)))
(New-Object Emoji.B -ArgumentList (0, 0, 0, 0, '')) | %{
$_.Text = $Temp
$_.Font = New-Object System.Drawing.Font('Segoe UI Emoji',12,[System.Drawing.FontStyle]::Regular)
$_.Size = [Emoji.SP]::SI(25, 25)
$_.Location = [Emoji.SP]::PO(((($Countx % 10) * 30) + 10 + 5),((($County % 31) * 30) + 10 + 35))
$_.Add_Click({[System.Windows.Forms.Clipboard]::SetText($This.Text); $Text.Text+=$This.Text})
$_.Add_MouseHover({$ToolTip.Show(([Char]::ConvertToUtf32($This.Text, 0)), $This)})
$_.Add_MouseEnter({$This.Size = [Emoji.SP]::SI(50, 50); $This.Font = New-Object System.Drawing.Font('Segoe UI Emoji',30,[System.Drawing.FontStyle]::Regular)})
$_.Add_MouseLeave({$This.Size = [Emoji.SP]::SI(25, 25); $This.Font = New-Object System.Drawing.Font('Segoe UI Emoji',12,[System.Drawing.FontStyle]::Regular)})
$_.Parent = $Window
$_
}
$Countx++
If($Countx % 10 -eq 0){
$County++
}
})
$Text = [Emoji.TB]::New(237, 25, 42, 990, '')
$Text.Font = New-Object System.Drawing.Font('Segoe UI Emoji',12,[System.Drawing.FontStyle]::Regular)
$Text.Add_MouseDown({If($_.Button -eq 'right'){$This.Text = ''}Else{If($This.Text.Length -ge 1){[System.Windows.Forms.Clipboard]::SetText($This.Text)}Else{[System.Windows.Forms.Clipboard]::SetText(' ')}}})
$Text.Parent = $Window
$Window.ShowDialog()
}
If($(Try{[Void][PSObject]::New();$False}Catch{$True})){
$MainBlock = ($MainBlock.toString().Split([System.Environment]::NewLine) | ?{$_ -ne ''} | %{
If($_ -match ']::New\('){
(($_.Split('[')[0]+'(New-Object '+$_.Split('[')[-1]+')') -replace ']::New',' -ArgumentList ').Replace(' -ArgumentList ()','')
}Else{
$_
}
}) -join [System.Environment]::NewLine
}
$MainBlock = [ScriptBlock]::Create($MainBlock)
$MainBlock.Invoke()