Please take a look at the following article http://www.codeproject.com/csharp/globalhook.asp. It is written in C# but can be easily used in VB .Net. Solution provided by this library will create system level shortcuts - no matter which application is active.
If you don’t need global/system level shortcuts then most of the graphical components (Form, TextBox etc.) do support the event “KeyPressed”. You can assign your own handler to that Event and check which keys were pressed.
Well the main idea is that agent can be on any application (CRM, email, internet, etc) and change it status without going to CTI Application itself.
It seems i’ll have to learn C# now, no VB.Net library of this? Seems .NET is still very young then.
Thanks
Public Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Keys) As Long
Private Function KeyDownStatus(ByVal vKey As Keys) As Boolean
KeyDownStatus = GetAsyncKeyState(vKey) And &H8000
End Function
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If KeyDownStatus(Keys.ControlKey) And KeyDownStatus(Keys.F10) Then
Debug.Print("ok")
End If
End Sub</blockquote>
Not sure why now but it works like a charm Marvelous Google Code Search
In .NET You can use C# libraries under VB.NET and vice versa - that how .NET works - for example Genesys .NET libraries are written in C# but can be easily used under VB
Uh..how? I have found an excellent idea (deskbank) and would like to implement that on my application but all code is on C#.
Is there a Tool or something to import directly from C# to Vb.Net?
Thanks a lot
It works like this - You must create C# project of type “Class library” or “Windows Control library” with code You need. Compile it. You will receive dll. Then You just need to add this dll to references of Your VB application and You can access class or controls stored in this dll. If You need help with creating this file feel free to send this C# code to convert into library.
It’s very cool.
I have tried to make it VB.Net compatible but without any success.
Can anybody please try to do a very simple thing on Vb.Net with it?
Thanks in advance for any help ;D
In attached file You will find modified project from CodeProject with sample VB.Net application - I hope it helps. Important thing is to set minimum and maximum size to values other then 0,0.