I don't know VB but thats VERY easy to do in C++...search for SendKeys I believe it is with VB. That'll show you how to find a window and then it's a simple matter of running it if you don't find the window.
I am trying to control apps running on the system via keypad.
"/" starts the MP3/Video Player.
"*" starts the GPS Mapping.
"-" starts the Engine Management (spark and fuel) software.
What I need to do is:
1) if its not running, to start the app
2) if running and minimised, to maximise the app.
I can see 2 ways of accomplishing my goal.
1) Run external apps within a VB form container (like the webbrowser control)
2) Attach to the apps running in the tool bar.
Clear as mud? Got any ideas?
1981 VW Scirocco, 2L 16v turbo. EEEPC 1000 running Mega Squirt and music.
Http://www.menloparkrandd.com/scirocco
I don't know VB but thats VERY easy to do in C++...search for SendKeys I believe it is with VB. That'll show you how to find a window and then it's a simple matter of running it if you don't find the window.
Google for "vb sendmessage tutorial".
Couple of promising hits:
http://cu.imt.net/~joe/matt/program/vb/Tutorials/
http://www.geocities.com/SiliconVall.../apitutor.html
Play with it for a bit - it's not too difficult to do.
Its actually easier than all that, here is the code. Just make sure that the focus returns to Text1 with every function, or run this in a timer.
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
'The KeyCode (111) = "/"
If KeyCode = (111) Then
'Place Your Code Here
End If
'The KeyCode (106) = "*"
If KeyCode = (106) Then
'Place Your Code Here
End If
'The KeyCode (109) = "-"
If KeyCode = (109) Then
'Place Your Code Here
End If
Text1.Setfocus
End Sub
Mobile Impact
Highly innovative car computer multimedia/entertainment system software.
http://mobileimpact.biz.tm
But that only works if the app has focus
True, and now that I think about it, the form would have to stay on top, but then the focus would leave it when the other program is used so he would have to click back on the form. Oh well, it was late when I posted, heh heh. Maybe he can use the code somehow.
Mobile Impact
Highly innovative car computer multimedia/entertainment system software.
http://mobileimpact.biz.tm
GetASyncKeyState will give you the state of any key on the keyboard regardless of focus. Make a really fast timer and constantly check all the relavent keys and your good to go
Google for more, I just woke up and have to get to work and don't have time to make a function for ya.
Oh and if you need something that finds a process by name and gives it focus to send it keypresses, I got some code to pm ya if you need it.
Check out http://www.thescarms.com/vbasic/DefaultNav.asp
Current projects: iGmod reloaded (Latest release) (put on hiatus indefinatly)
Unlimited Internet and gps tracking for $6 a month with boost mobile!
Carputer 2: www.lmaocar.com
I used the Asynckeystate API.
Now the MDI form (MP3/Video & Fuel/Spark management) can easily switch between each other using the /,*,- keys on the mini keypad.
The 2,4,6,8 keys move with in the form displayed.
Using the keys 1,3,5,7,9 I can start or switch between outside programs running on the system.
Now I can switch Apps with out having to look at the screen while driving.
Thanks a lot guys!
1981 VW Scirocco, 2L 16v turbo. EEEPC 1000 running Mega Squirt and music.
Http://www.menloparkrandd.com/scirocco
Bookmarks