Loading a file and capturing keys...

Ok i want to make an application that opens a certin program called "Program A" and whenever the user presses f1 it loads another help file instead of the Program's A help file..

My first problem is that i only want the file path to be given at the first time they open the program then the program will renember it...

I think we do that with a *.ini file right?
My second thing is that i want the f1 key to be intercept before Program A help file loads and basicly Program A hlp file will never appear.

Any tip help is welcomed :)

Starting at 50pts and will see if it's enought (should be..)
lutharAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

lutharAuthor Commented:
Edited text of question.
0
JuiletteCommented:
You can put it in any file you like ..your app opens it, writes to it, and then when needed it opens the file and reads it.
How to intercept the key events

Option Explicit

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
Case vbKeyF1: MsgBox "F1 pressed."
Case vbKeyF2: MsgBox "F2 pressed."
Case vbKeyEscape: MsgBox "ESC"
End Select
End Sub

Private Sub Form_Load()
Form1.KeyPreview = True
End Sub


0
lutharAuthor Commented:
Ok i can use a common dialog to get the path then transfer it to the file....what was the function to read a file again (can't access vb help on this comp :( )

Has for the keydown it's good when you have a form but i need to make this program invisible (form1.visible = false or have it put the code in a module).
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

lutharAuthor Commented:
Ok i can use a common dialog to get the path then transfer it to the file....what was the function to read a file again (can't access vb help on this comp :( )

Has for the keydown it's good when you have a form but i need to make this program invisible (form1.visible = false or have it put the code in a module).
0
JuiletteCommented:
'put this in a click event or a load
'reads a complete txt file and sends it
'to a multiline text box

CommonDialog1.Flags = cdlOFNNoChangeDir
CommonDialog1.InitDir = "C:\"
CommonDialog1.Filter = "Text Files(*.txt)|*.txt|All Files(*.*)|*.*"
CommonDialog1.ShowOpen
Open CommonDialog1.filename For Input As #1
Text1.Text = Input(LOF(1), 1)
Close #1
0
lutharAuthor Commented:
Good suggestion :)

I did write a code that checks a *.ini file and takes the path if no *.ini file found or nothing in it, it ask to get the path with a commonDialog, copies it in the ini file, loads the program...etc



THanks for your comments :)
0
JuiletteCommented:
Ok...answered in comments.
Wayne
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
lutharAuthor Commented:
Since I feel generous today, i'll give you the points. I ust have to renember to stop asking questions here before i look at the help in VB/VB books...

Thanx again :)
0
lutharAuthor Commented:
Oh darn forgot to give the points :)
There you go :)
0
JuiletteCommented:
May as well, once you post, the points are gone from your side of the woods.

Wayne

Ps..Since I'm in a generous mood as well!

you are very correct...most answers are easily found....best thing I ever did was to build myself a database with all the tips and clues and things I might need somewhere down the line. I access the database with "Like" so I can find the answers very quickly....I have learned more from this site by answering and following leads that I did in 2 years of night school.
 The address below is a good Q & A as well and no points...takes the shark attitude out of it...Serge and Aaron are very good at anything you need answered. Check it out.
http://www.vb-world.net/cgi-bin/forumdisplay.cgi?action=topics&forum=General+Visual+Basic+Questions&number=1&DaysPrune=


Good luck in your endevours.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.