473,396 Members | 1,671 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

help file closing when app closes in Vista

hi,

i have a app which has a help file, *.hlp, which the user can launch within
the program. i want the help file if it is open to close when the program
exists.

the way i did it till now is by running the following code when the program
closes

Dim proc, procs() As Process
procs = Process.GetProcessesByName("winhlp32")
For Each proc In procs
proc.Kill()
Next

i wasn't too haapy with this because it would close ALL open help files even
those not opened by my app. but i was in a rush when i developed this, i
didn't get any complaints, so i just let sleeping dogs lie.

my client just installed the app on a vista machine, and he gets errors from
this code when he closes the app. i tried removing the "proc.Kill()" line,
and he still gets the error. when i removed this whole bit of code the app
closes without complaining.(but the help file remains open) so apparently
vista doesn't like when u look at processes.

i don't have a vista machine.

how can i get the apps help file to close when the app exits on a vista
machine?

thanks for any help

ray
May 30 '07 #1
3 2011
"ray well" <no****@nospam.comschrieb:
i have a app which has a help file, *.hlp, which the user can launch
within the program. i want the help file if it is open to close when the
program exists.
How are you showing the help file? Are you using the Win32 WinHelp API?
IIRC there was a flag that could be specified when opening the help file
which indicated that it should be closed automatically when the application
terminates.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

May 30 '07 #2
>How are you showing the help file? Are you using the Win32 WinHelp API?
>IIRC there was a flag that could be specified when opening the help file
which indicated that it should be closed automatically when the application
terminates.
herfried,

thanks for your answer.

i used the Help class as in
Help.ShowHelp(Me, Application.StartupPath & "\MyApp.hlp")

i also sometimes just shelled out the help file.

how would i access the Win32 WinHelp API to launch it that way? would u have
a code snipet for this (which would also include that flag)? or know where i
can find an example?

i would appreciate that,. thanks,

ray
May 31 '07 #3
On May 31, 9:03 am, "ray well" <nos...@nospam.comwrote:
How are you showing the help file? Are you using the Win32 WinHelp API?
IIRC there was a flag that could be specified when opening the help file
which indicated that it should be closed automatically when the application
terminates.

herfried,

thanks for your answer.

i used the Help class as in
Help.ShowHelp(Me, Application.StartupPath & "\MyApp.hlp")

i also sometimes just shelled out the help file.

how would i access the Win32 WinHelp API to launch it that way? would u have
a code snipet for this (which would also include that flag)? or know where i
can find an example?

i would appreciate that,. thanks,

ray
how would i access the Win32 WinHelp API to launch it that way? would u have
a code snipet for this (which would also include that flag)? or know where i
can find an example?
Here's the pinvoke.net page for WinHelp - though it's only in C#. Your
import statement for VB.Net should be:

<DllImport("user32.dll")_
Public Shared Function WinHelp(ByVal hWndMain As IntPtr, ByVal
lpszHelp As String, ByVal uCommand As UInt32) As Boolean
End Function

http://pinvoke.net/default.aspx/user32/WinHelp.html

Thanks,

Seth Rowe

May 31 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Bob Darlington | last post by:
I have a repair and backup database routine which runs when a user closes down my application. It works fine in my development machine, but breaks on a client's at the following line: If...
1
by: Chris Bruce | last post by:
In my application I need a way to distiguish between the following events: 1. When a user closes an MDI child window. 2. When the user closes the MDI parent window which subsequently closes the...
6
by: Ana | last post by:
Hi! I have problems with the following scenario: My application is developed using C# under .NET. It must run on all Windows versions starting from Windows 98. The user must open different...
1
by: MuZZy | last post by:
HI, I have a user control, say with one textBox. I need the following: when the user closes form (either calling Form.Close, or pressing "X" or anyhow), UserControl copies a file from a...
7
by: PJ | last post by:
I have an open FileStream and I open a BinaryWriter on it. After writing to this file, I want to read it to another stream. FileStream fs = new FileStream(Path.GetTempFileName()); BinaryWriter...
2
by: Dave | last post by:
I'm having trouble understanding dispose. I set up a class that, among other things, displays the time in a status bar panel. It does this by starting a thread. I create an instance of this...
10
by: Charles Law | last post by:
For some reason, when I click the X to close my MDI parent form, the action appears to be re-directed to one of the MDI child forms, and the parent remains open. I am then unable to close the...
0
by: GrandpaB | last post by:
I have an error that I have not been able to find. Any insight you can offer would be most appreciated. I believe that the problem is associated with the SoapFormatter. The application allows...
12
by: adamurbas | last post by:
ya so im pretty much a newb to this whole python thing... its pretty cool but i just started today and im already having trouble. i started to use a tutorial that i found somewhere and i followed...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.