แบบนี้ครับถ้าผมใช้ คำสั่ง Sendkeys.send("Z") มันก็จะกลายเป็นส่งตัว z ไปเฉยๆ ครับ
หรือ SendKeys.send(AscW("Z")) มันก็จะกลายเป็นส่งค่าเลขฐานออกไปเฉยๆ
ต้องทำอย่างไรหรือ มีแนวทางอย่างไรช่วยบอกหน่อยครับ
ขอบคุณมากครับ
Tag : .NET, Ms SQL Server 2005, VBScript, Win (Windows App), VS 2005 (.NET 2.x), Windows
Date :
2013-05-07 12:37:28
By :
punmontha
View :
879
Reply :
1
No. 1
Guest
#No 094744 #No 094812
minded
Step 1. Open Program NotePad
2. Save file Ass Jim.txt
Code (VB.NET)
Public Class FormSendJim
Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As IntPtr
Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd As IntPtr, ByVal hWndChildAfterA As IntPtr, ByVal lpszClass As String, ByVal lpszWindow As String) As IntPtr
Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As IntPtr, ByVal wMsg As Integer, ByVal wParam As IntPtr, ByVal lParam As String) As IntPtr
Const WM_SETTEXT As Integer = &HC
Private Sub btnSendJim_Click(sender As System.Object, e As System.EventArgs) Handles btnSendJim.Click
Dim destination As IntPtr = FindWindow(Nothing, "Jim - Notepad")
Dim destControl As IntPtr = FindWindowEx(destination, IntPtr.Zero, "Edit", Nothing)
SendMessage(destControl, WM_SETTEXT, IntPtr.Zero, "Jim" & vbTab & "Price" & vbCrLf)
End Sub
End Class