Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to activate apps,..
Message
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00720239
Message ID:
00720363
Views:
9
You use the Process class. The Process class is used for starting, stopping, controlling, and monitoring applications. Using the Process component, you can obtain a list of the processes that are running or start a new process. To get the keypress, you trap the KeyDown event and check if Ctrl+F1 was pressed. One thing you need to remember to do is set the form's KeyPreview to True to trap all keys before your controls receive the keys pressed.
Imports System.Diagnostics

' Set this in your property window for your form or in code
Me.KeyPreview = True

Private Sub Form1_KeyDown(ByVal sender As Object, _
    ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
    If e.KeyCode = Keys.F1 And e.Control() Then
        proc = New Process()
        proc.StartInfo.FileName = "c:\MyAccessProgram.exe"
        proc.StartInfo.Arguments = "MyNetProgramName"
        proc.Start()
    End If
End Sub
>Hi all
>
>I want a small program that i made myself become active, when I press ctrl+f1 anywere in windows,. But i can't find anything about it anywhere.
>
>Allso, I want the my small program to know what other program(e.g. Acces2k) has focus when ctrl+f1 is pressed.
>
>Any help at all is appreciated.
>
>Thanks :)
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform