home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Language specific support
Deutsches MediaPortal Forum
MediaPortal 1
Allgemeines Supportforum
per Batch Programme in best. Reihenfolge starten
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="lembugu" data-source="post: 647498" data-attributes="member: 62730"><p><strong>AW: per Batch Programme in best. Reihenfolge starten</strong></p><p></p><p>Ich bin kein Coder aber lese hin und wieder mal über VBS was nach und hab mal als bsp.: diese Page als anregung.</p><p></p><p><a href="http://www.vb-fun.de/cgi-bin/loadframe.pl?ID=vb/tipps/tip0438.shtml" target="_blank">Autoload</a></p><p></p><p>Innerhalb von Formularen kann man mittels des KeyPress-Ereignisses und der KeyUp-/KeyDown-Ereignisse komfortabel auf Tastatureingaben des Benutzers reagieren. Wenn ein Fenster allerdings unsichtbar ist oder lediglich den Fokus verloren hat, werden diese Ereignisse nicht mehr ausgelöst. Um trotzdem auf Tastatureingaben reagieren zu können, zeigt dieser Tipp wie man mit einem Timer und der API-Funktion GetAsyncKeystate den Status einer Taste überprüfen kann. Durch die Übergabe des KeyCodes aus der KeyCodeConstants-Aufzählung lässt sich mit Hilfe dieser API-Funktion ermitteln, ob die Taste momentan gedrückt ist, seit der letzten Überprüfung gedrückt wurde oder nicht gedrückt wurde.</p><p> </p><p></p><p>Option Explicit</p><p></p><p>Private Declare Function GetAsyncKeyState Lib "user32" ( _</p><p> ByVal vKey As Long) As Integer</p><p></p><p>Private Declare Sub CopyMemory Lib "kernel32" Alias _</p><p> "RtlMoveMemory" (lpDest As Any, lpSource As Any, _</p><p> ByVal cBytes As Long)</p><p></p><p>Private Sub Form_Load()</p><p> Dim i As Long</p><p> For i = 0 To (chkFKey.Count - 1)</p><p> chkFKey(i).Caption = chkFKey(i).Caption & CStr(i + 1)</p><p> Next i</p><p>End Sub</p><p></p><p>Private Sub tmrCheckKeys_Timer()</p><p> Dim i As Long</p><p> Dim nRetVal As Long</p><p></p><p> For i = KeyCodeConstants.vbKeyF1 To KeyCodeConstants.vbKeyF12</p><p> nRetVal = GetAsyncKeyState(i)</p><p> If (HiWord(nRetVal) <> 0) Or (LoWord(nRetVal) <> 0) Then</p><p> chkFKey(i - 112).Value = 1</p><p> Else</p><p> chkFKey(i - 112).Value = 0</p><p> End If</p><p> Next i</p><p>End Sub</p><p></p><p>Private Function LoWord(ByVal dwValue As Long) As Integer</p><p> Call CopyMemory(LoWord, dwValue, 2&)</p><p>End Function</p><p></p><p>Private Function HiWord(ByVal dwValue As Long) As Integer</p><p> Call CopyMemory(HiWord, ByVal VarPtr(dwValue) + 2, 2&)</p><p>End Function</p></blockquote><p></p>
[QUOTE="lembugu, post: 647498, member: 62730"] [b]AW: per Batch Programme in best. Reihenfolge starten[/b] Ich bin kein Coder aber lese hin und wieder mal über VBS was nach und hab mal als bsp.: diese Page als anregung. [url=http://www.vb-fun.de/cgi-bin/loadframe.pl?ID=vb/tipps/tip0438.shtml]Autoload[/url] Innerhalb von Formularen kann man mittels des KeyPress-Ereignisses und der KeyUp-/KeyDown-Ereignisse komfortabel auf Tastatureingaben des Benutzers reagieren. Wenn ein Fenster allerdings unsichtbar ist oder lediglich den Fokus verloren hat, werden diese Ereignisse nicht mehr ausgelöst. Um trotzdem auf Tastatureingaben reagieren zu können, zeigt dieser Tipp wie man mit einem Timer und der API-Funktion GetAsyncKeystate den Status einer Taste überprüfen kann. Durch die Übergabe des KeyCodes aus der KeyCodeConstants-Aufzählung lässt sich mit Hilfe dieser API-Funktion ermitteln, ob die Taste momentan gedrückt ist, seit der letzten Überprüfung gedrückt wurde oder nicht gedrückt wurde. Option Explicit Private Declare Function GetAsyncKeyState Lib "user32" ( _ ByVal vKey As Long) As Integer Private Declare Sub CopyMemory Lib "kernel32" Alias _ "RtlMoveMemory" (lpDest As Any, lpSource As Any, _ ByVal cBytes As Long) Private Sub Form_Load() Dim i As Long For i = 0 To (chkFKey.Count - 1) chkFKey(i).Caption = chkFKey(i).Caption & CStr(i + 1) Next i End Sub Private Sub tmrCheckKeys_Timer() Dim i As Long Dim nRetVal As Long For i = KeyCodeConstants.vbKeyF1 To KeyCodeConstants.vbKeyF12 nRetVal = GetAsyncKeyState(i) If (HiWord(nRetVal) <> 0) Or (LoWord(nRetVal) <> 0) Then chkFKey(i - 112).Value = 1 Else chkFKey(i - 112).Value = 0 End If Next i End Sub Private Function LoWord(ByVal dwValue As Long) As Integer Call CopyMemory(LoWord, dwValue, 2&) End Function Private Function HiWord(ByVal dwValue As Long) As Integer Call CopyMemory(HiWord, ByVal VarPtr(dwValue) + 2, 2&) End Function [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Language specific support
Deutsches MediaPortal Forum
MediaPortal 1
Allgemeines Supportforum
per Batch Programme in best. Reihenfolge starten
Contact us
RSS
Top
Bottom