1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
| Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
RegisterHotKey(Me.Handle, 1, KEY_CONTROL, Keys.V)
End Sub
Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
If m.Msg = WM_HOTKEY Then
Dim id As IntPtr = m.WParam
Select Case (id.ToString)
Case "1"
Clipboard.Clear()
Clipboard.SetText(TextBox1.Text)
SendKeys.Send("^V")
End Select
End If
MyBase.WndProc(m)
End Sub
Private Sub Form1_FormClosing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing
UnregisterHotKey(Me.Handle, 1)
End Sub
|
沒有留言:
張貼留言