Board index » delphi » Detecting Missing App Help File

Detecting Missing App Help File

The code below is susposed to minimize my app if the .hlp file is not
found, however, the else statement doesn't seem to be firing - I think
it is because when the windows dialog box displays saying no help file
can be found the focus has already switched away from my app - there
must be some std way to allow an app to detect that the hlp file is
missing and let it minimize itself so the user can see the dialog box
informing them of this fact???

Ralph

     if Application.HelpContext(10200) then
        begin
             // mail.hlp file found
             Application.Restore;
        end
     else
        begin
             // mail.hlp file not found
             Application.Minimize;
        end;

 

Re:Detecting Missing App Help File


Quote
"Ralph Freshour" <ra...@primemail.com> wrote in message

news:3963d9a0.3445663@news.concentric.net...

Quote
> The code below is susposed to minimize my app if the .hlp file is not
> found, however, the else statement doesn't seem to be firing - I think
> it is because when the windows dialog box displays saying no help file
> can be found the focus has already switched away from my app - there
> must be some std way to allow an app to detect that the hlp file is
> missing and let it minimize itself so the user can see the dialog box
> informing them of this fact???

According to my reading of the D3 help file HelpContext will only return
true when Application.HelpFile is an empty string, i.e. hasn't been assigned
a value. Based on this I suspect that HelpContext is always returning true
in your test and thus the else wouldn't be executed.

Re:Detecting Missing App Help File


Yes, apparently that is what is happening - I am a bit surprised that
D3 doesn't permit you to determine that the help file was not found -
windows certainly knows about it since it displays this fact in a
dialog box.

Hmmm...what now???

Ralph

On Wed, 5 Jul 2000 23:26:29 -0400, "Bruce Roberts"

Quote
<no.junk.please....@attcanada.net> wrote:

>"Ralph Freshour" <ra...@primemail.com> wrote in message
>news:3963d9a0.3445663@news.concentric.net...
>> The code below is susposed to minimize my app if the .hlp file is not
>> found, however, the else statement doesn't seem to be firing - I think
>> it is because when the windows dialog box displays saying no help file
>> can be found the focus has already switched away from my app - there
>> must be some std way to allow an app to detect that the hlp file is
>> missing and let it minimize itself so the user can see the dialog box
>> informing them of this fact???

>According to my reading of the D3 help file HelpContext will only return
>true when Application.HelpFile is an empty string, i.e. hasn't been assigned
>a value. Based on this I suspect that HelpContext is always returning true
>in your test and thus the else wouldn't be executed.

Re:Detecting Missing App Help File


Have considered using FileExists function? First your app should check that
help file (not) exists and minimize if it doesn't exists and then call help
file normally.

- -
-Jari Huusko

Quote
> Hmmm...what now???

> Ralph

> On Wed, 5 Jul 2000 23:26:29 -0400, "Bruce Roberts"
> <no.junk.please....@attcanada.net> wrote:

> >"Ralph Freshour" <ra...@primemail.com> wrote in message
> >news:3963d9a0.3445663@news.concentric.net...
> >> The code below is susposed to minimize my app if the .hlp file is not
> >> found, however, the else statement doesn't seem to be firing - I think
> >> it is because when the windows dialog box displays saying no help file
> >> can be found the focus has already switched away from my app - there
> >> must be some std way to allow an app to detect that the hlp file is
> >> missing and let it minimize itself so the user can see the dialog box
> >> informing them of this fact???

> >According to my reading of the D3 help file HelpContext will only return
> >true when Application.HelpFile is an empty string, i.e. hasn't been
assigned
> >a value. Based on this I suspect that HelpContext is always returning
true
> >in your test and thus the else wouldn't be executed.

Other Threads