線上訂房服務-台灣趴趴狗聯合訂房中心
發文 回覆 瀏覽次數:957
推到 Plurk!
推到 Facebook!

想要將keybd_event在PDA上使用

尚未結案
bio
一般會員


發表:42
回覆:36
積分:20
註冊:2003-03-05

發送簡訊給我
#1 引用回覆 回覆 發表時間:2004-10-26 13:46:30 IP:210.68.xxx.xxx 未訂閱
是這樣的,我在PC上使用VB.NET讓keybd_event可以在任一個有游標顯示的地方 設定每10秒自動填入一個a字元,在PC上是可以work的 VB.Net內容如下:  
 
Public Class Form1 Inherits System.Windows.Forms.Form Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long) ' Const KEYEVENTF_KEYUP = &H2 Const VK_LWIN = &H5B #Region " Windows Form 設計工具產生的程式碼 " Public Sub New() MyBase.New() '此為 Windows Form 設計工具所需的呼叫。 InitializeComponent() '在 InitializeComponent() 呼叫之後加入所有的初始設定 End Sub 'Form 覆寫 Dispose 以清除元件清單。 Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If disposing Then If Not (components Is Nothing) Then components.Dispose() End If End If MyBase.Dispose(disposing) End Sub '為 Windows Form 設計工具的必要項 Private components As System.ComponentModel.IContainer '注意: 以下為 Windows Form 設計工具所需的程序 '您可以使用 Windows Form 設計工具進行修改。 '請勿使用程式碼編輯器來修改這些程序。 Friend WithEvents Button1 As System.Windows.Forms.Button Friend WithEvents Timer1 As System.Windows.Forms.Timer Private Sub InitializeComponent() Me.components = New System.ComponentModel.Container Me.Button1 = New System.Windows.Forms.Button Me.Timer1 = New System.Windows.Forms.Timer(Me.components) Me.SuspendLayout() ' 'Button1 ' Me.Button1.Location = New System.Drawing.Point(104, 112) Me.Button1.Name = "Button1" Me.Button1.TabIndex = 0 Me.Button1.Text = "Button1" ' 'Timer1 ' Me.Timer1.Enabled = True Me.Timer1.Interval = 10000 ' 'Form1 ' Me.AutoScaleBaseSize = New System.Drawing.Size(5, 15) Me.ClientSize = New System.Drawing.Size(292, 273) Me.Controls.Add(Me.Button1) Me.Name = "Form1" Me.Text = "Form1" Me.ResumeLayout(False) End Sub #End Region Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Call keybd_event(VK_LWIN, 0, 0, 0) '視窗最小化 Call keybd_event(77, 0, 0, 0) Call keybd_event(VK_LWIN, 0, KEYEVENTF_KEYUP, 0) End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick Call keybd_event(65, 0, 0, 0) '每隔10秒自動填入a Call keybd_event(65, 0, 2, 0) End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub End Class 但是是因為在PC有宣告 Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)這行才能work,但是PDA不吃這個 我想請問是否有辦法也讓PDA可以做像keybd_event在PC上會自動填字元的功能呢
系統時間:2024-05-05 18:21:55
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!