Tell me HOW :-( 
Author Message
 Tell me HOW :-(

Hi,

I'm using the code below to load a help file and it works good!!! But I
don't want any form
to be loaded. I just want to create an exe-file to load the help file and
nothing more.
Is it possible?
I could set Form1.Visible = False, but what happens if the user lunches
this App 100
times or more? 100's of invisible forms taking memory resources!
I could detect a previous instance of my app and end that previous instance
of course,
but I don't know how to!

--
Thanks in advance!
Ali Eghtebas

Private Sub Form_Load()

    If App.PrevInstance Then
        'Any ideas to end the App.PrevInstance
    End If

    CommonDialog1.HelpFile = App.Path & "\fast.hlp"
    CommonDialog1.HelpCommand = cdlHelpContents
    CommonDialog1.ShowHelp
    'Unload Me

End Sub



Fri, 07 Sep 2001 03:00:00 GMT  
 Tell me HOW :-(
You could make your program go into the System tray that way you will see
how many times it's been opened and then close so.
Quote:

>Hi,

>I'm using the code below to load a help file and it works good!!! But I
>don't want any form
>to be loaded. I just want to create an exe-file to load the help file and
>nothing more.
>Is it possible?
>I could set Form1.Visible = False, but what happens if the user lunches
>this App 100
>times or more? 100's of invisible forms taking memory resources!
>I could detect a previous instance of my app and end that previous instance
>of course,
>but I don't know how to!

>--
>Thanks in advance!
>Ali Eghtebas

>Private Sub Form_Load()

>    If App.PrevInstance Then
>        'Any ideas to end the App.PrevInstance
>    End If

>    CommonDialog1.HelpFile = App.Path & "\fast.hlp"
>    CommonDialog1.HelpCommand = cdlHelpContents
>    CommonDialog1.ShowHelp
>    'Unload Me

>End Sub



Fri, 07 Sep 2001 03:00:00 GMT  
 Tell me HOW :-(
You can open the common dialogs without any OCX (hence without any form)
using API calls.  Check out VBNet code source: http://www.mvps.org/vbnet/

JHK

Quote:

>Hi,

>I'm using the code below to load a help file and it works good!!! But I
>don't want any form
>to be loaded. I just want to create an exe-file to load the help file and
>nothing more.
>Is it possible?
>I could set Form1.Visible = False, but what happens if the user lunches
>this App 100
>times or more? 100's of invisible forms taking memory resources!
>I could detect a previous instance of my app and end that previous instance
>of course,
>but I don't know how to!

>--
>Thanks in advance!
>Ali Eghtebas

>Private Sub Form_Load()

>    If App.PrevInstance Then
>        'Any ideas to end the App.PrevInstance
>    End If

>    CommonDialog1.HelpFile = App.Path & "\fast.hlp"
>    CommonDialog1.HelpCommand = cdlHelpContents
>    CommonDialog1.ShowHelp
>    'Unload Me

>End Sub



Fri, 07 Sep 2001 03:00:00 GMT  
 Tell me HOW :-(
Look up sub main in the help

Quote:

>Hi,

>I'm using the code below to load a help file and it works good!!! But I
>don't want any form
>to be loaded. I just want to create an exe-file to load the help file and
>nothing more.
>Is it possible?

<snip>


Fri, 07 Sep 2001 03:00:00 GMT  
 Tell me HOW :-(
SORRY!!!

I was just looking at that code (I should have looked first)!  Even the API
requires you to pass a window handle, gleaned from a form.

There should be a way to create a window and get its handle through
code...but I'm not experienced enough to say how.

JHK

Quote:

>You can open the common dialogs without any OCX (hence without any form)
>using API calls.  Check out VBNet code source: http://www.mvps.org/vbnet/

>JHK




Quote:
>>Hi,

>>I'm using the code below to load a help file and it works good!!! But I
>>don't want any form
>>to be loaded. I just want to create an exe-file to load the help file and
>>nothing more.
>>Is it possible?
>>I could set Form1.Visible = False, but what happens if the user lunches
>>this App 100
>>times or more? 100's of invisible forms taking memory resources!
>>I could detect a previous instance of my app and end that previous
instance
>>of course,
>>but I don't know how to!

>>--
>>Thanks in advance!
>>Ali Eghtebas

>>Private Sub Form_Load()

>>    If App.PrevInstance Then
>>        'Any ideas to end the App.PrevInstance
>>    End If

>>    CommonDialog1.HelpFile = App.Path & "\fast.hlp"
>>    CommonDialog1.HelpCommand = cdlHelpContents
>>    CommonDialog1.ShowHelp
>>    'Unload Me

>>End Sub



Fri, 07 Sep 2001 03:00:00 GMT  
 Tell me HOW :-(
You can pass null for the hwnd, it is not required.

Michael


Quote:
> SORRY!!!

> I was just looking at that code (I should have looked

first)!  Even the API
Quote:
> requires you to pass a window handle, gleaned from a form.

> There should be a way to create a window and get its
handle through
> code...but I'm not experienced enough to say how.

> JHK




Quote:
> >You can open the common dialogs without any OCX (hence
without any form)
> >using API calls.  Check out VBNet code source:

http://www.mvps.org/vbnet/
Quote:

> >JHK



> >>Hi,

> >>I'm using the code below to load a help file and it
works good!!! But I
> >>don't want any form
> >>to be loaded. I just want to create an exe-file to load
the help file and
> >>nothing more.
> >>Is it possible?
> >>I could set Form1.Visible = False, but what happens if
the user lunches
> >>this App 100
> >>times or more? 100's of invisible forms taking memory
resources!
> >>I could detect a previous instance of my app and end
that previous
> instance
> >>of course,
> >>but I don't know how to!

> >>--
> >>Thanks in advance!
> >>Ali Eghtebas

> >>Private Sub Form_Load()

> >>    If App.PrevInstance Then
> >>        'Any ideas to end the App.PrevInstance
> >>    End If

> >>    CommonDialog1.HelpFile = App.Path & "\fast.hlp"
> >>    CommonDialog1.HelpCommand = cdlHelpContents
> >>    CommonDialog1.ShowHelp
> >>    'Unload Me

> >>End Sub



Fri, 07 Sep 2001 03:00:00 GMT  
 Tell me HOW :-(
To determine if there is another instance of your program open, refer to
App.Previnstance

--
Later,
Jody


http://www.visual-statement.com/vb

Quote:

>Hi,

>I'm using the code below to load a help file and it works good!!! But I
>don't want any form
>to be loaded. I just want to create an exe-file to load the help file and
>nothing more.
>Is it possible?
>I could set Form1.Visible = False, but what happens if the user lunches
>this App 100
>times or more? 100's of invisible forms taking memory resources!
>I could detect a previous instance of my app and end that previous instance
>of course,
>but I don't know how to!

>--
>Thanks in advance!
>Ali Eghtebas

>Private Sub Form_Load()

>    If App.PrevInstance Then
>        'Any ideas to end the App.PrevInstance
>    End If

>    CommonDialog1.HelpFile = App.Path & "\fast.hlp"
>    CommonDialog1.HelpCommand = cdlHelpContents
>    CommonDialog1.ShowHelp
>    'Unload Me

>End Sub



Fri, 07 Sep 2001 03:00:00 GMT  
 Tell me HOW :-(
Sorry, but i can't undestand what you're trying to do. You can double click
the file or create a shortcut. Why create a program to show contents? If try
to show other help page I can understand, but contents!

--
Eduardo Morcillo
Free ActiveX Controls: http://www.geocities.com/SiliconValley/Foothills/9940



Fri, 07 Sep 2001 03:00:00 GMT  
 Tell me HOW :-(
 Use the following code to detect and prevent instance from running

HTH,

Private Sub Form_Load()

 If App.PrevInstance Then
    ' this will avoid of loading a form itself
    exit sub
  End If

End Sub

Quote:

> Hi,

> I'm using the code below to load a help file and it works good!!! But I
> don't want any form
> to be loaded. I just want to create an exe-file to load the help file and
> nothing more.
> Is it possible?
> I could set Form1.Visible = False, but what happens if the user lunches
> this App 100
> times or more? 100's of invisible forms taking memory resources!
> I could detect a previous instance of my app and end that previous instance
> of course,
> but I don't know how to!

> --
> Thanks in advance!
> Ali Eghtebas

> Private Sub Form_Load()

>     If App.PrevInstance Then
>         'Any ideas to end the App.PrevInstance
>     End If

>     CommonDialog1.HelpFile = App.Path & "\fast.hlp"
>     CommonDialog1.HelpCommand = cdlHelpContents
>     CommonDialog1.ShowHelp
>     'Unload Me

> End Sub



Fri, 07 Sep 2001 03:00:00 GMT  
 Tell me HOW :-(


Quote:
> Use the following code to detect and prevent instance from running

> HTH,

> Private Sub Form_Load()

>  If App.PrevInstance Then
>     ' this will avoid of loading a form itself
>     exit sub
>   End If

> End Sub

Close, but not quite. By just exiting the subroutine the app still launches
another instance of itself. You need to terminate this instance. Try:

 Private Sub Form_Load()

  If App.PrevInstance Then
        Unload Me
     Exit Sub
  End If

Hope this helps.  ;-)



Fri, 07 Sep 2001 03:00:00 GMT  
 Tell me HOW :-(
I want to end the previous instance, not the current one!

/Ali



Quote:



> > Use the following code to detect and prevent instance from running

> > HTH,

> > Private Sub Form_Load()

> >  If App.PrevInstance Then
> >     ' this will avoid of loading a form itself
> >     exit sub
> >   End If

> > End Sub

> Close, but not quite. By just exiting the subroutine the app still
launches
> another instance of itself. You need to terminate this instance. Try:

>  Private Sub Form_Load()

>   If App.PrevInstance Then
>         Unload Me
>      Exit Sub
>   End If

> Hope this helps.  ;-)



Sat, 08 Sep 2001 03:00:00 GMT  
 Tell me HOW :-(
You'r right! But I have a problem using the code below the Sub Main() in a
Module.
It lunches the helpfile but onloads it as fast as execution reaches Exit
Sub!
Any ideas?

Option Explicit

#If Win16 Then
    Declare Function WinHelp Lib "User" (ByVal hwnd As Integer, ByVal
lpHelpFile As String, ByVal wCommand As Integer, ByVal dwData As Any) As
Integer
#Else
    Declare Function WinHelp Lib "user32" Alias "WinHelpA" (ByVal hwnd As
Long, ByVal lpHelpFile As String, ByVal wCommand As Long, ByVal dwData As
Any) As Long
#End If

Global Const HELP_INDEX = 3

Sub Main()
    Dim i%

    App.HelpFile = App.Path & "\fast.hlp"
    i = WinHelp(0, App.HelpFile, HELP_INDEX, 0&) 'Eller CLng(0) ist?ller
f?r 0&

End Sub



Sat, 08 Sep 2001 03:00:00 GMT  
 Tell me HOW :-(
Use the FindWindowEx function, to get the your Window Header.
If the Header is Zero, then your Window is not open.
To see, how to do this FindWindowEx function, look at your
MSDN CD in the Platform SDK books.
Regards,
    Freddy

BTW: In the VB.ENTERPRISE newsgroup is a article of the FindWindow function.
Look at that
__

Quote:

>Hi,

>I'm using the code below to load a help file and it works good!!! But I
>don't want any form
>to be loaded. I just want to create an exe-file to load the help file and
>nothing more.
>Is it possible?
>I could set Form1.Visible = False, but what happens if the user lunches
>this App 100
>times or more? 100's of invisible forms taking memory resources!
>I could detect a previous instance of my app and end that previous instance
>of course,
>but I don't know how to!

>--
>Thanks in advance!
>Ali Eghtebas

>Private Sub Form_Load()

>    If App.PrevInstance Then
>        'Any ideas to end the App.PrevInstance
>    End If

>    CommonDialog1.HelpFile = App.Path & "\fast.hlp"
>    CommonDialog1.HelpCommand = cdlHelpContents
>    CommonDialog1.ShowHelp
>    'Unload Me

>End Sub



Sat, 08 Sep 2001 03:00:00 GMT  
 Tell me HOW :-(
Quote:

>You'r right! But I have a problem using the code below the Sub Main() in a
>Module.
>It lunches the helpfile but onloads it as fast as execution reaches Exit
>Sub!
>Any ideas?

<cut>

You could just shell WINHELP.EXE directly...  why are you using VB just to
launch a help file?  If you want to add the help file as an option for the
user to start directly just edit SETUP.LST and put the name & path in the
arguments near the end of the line for your help file.  That will add an
icon that opens the help without starting the application.



Sat, 08 Sep 2001 03:00:00 GMT  
 
 [ 14 post ] 

 Relevant Pages 

1. Can someone tell me why my program doesn't like my array construction, or tell me how to fix it?!?!

2. How to tell if Maximized

3. How to tell if Maximized

4. How to tell if I have an Access.Application Open

5. How to tell where a form was called from

6. How to tell if Outlook is loaded from Access97 VBA

7. How to tell which directory the access database is running in

8. How do I tell if the Recordset closed?

9. How to tell is an object has been initialized

10. Please tell me what I am doing wrong - DAO parameter Append Query :(

11. How to tell which report called the function?

12. Tell a DLookup text box to update?

 

 
Powered by phpBB® Forum Software