> I am using HTML Help Workshop to make a help file for one of my
> apps. I am wandering is there any way to make it so that the
help
> window is not always on top (above) my app's window?
You should be able to override this behaviour by passing "null" rather
than the handle of the calling window as the first parameter of your
HTML Help API calls. Here is an example of a modified call:
HtmlHelp(0, "c:\filename.chm", HH_HELP_CONTEXT, 1001)
However, this has the disadvantage that the help file is no longer
bound by the actions of the calling program. So if you close or
minimise the program, the help file isn't closed or minimised as
well.
--
Pete (Microsoft Help MVP)
> Hello, I am using HTML Help Workshop to make a help file for one of my
apps. I am wandering is there any way to make it so that the help window is
not always on top (above) my app's window? I've tried playing with styles a
little, but can't get it to work. Not even "tool window" works. Also I've
tried to see if there is any app that does this, and haven't found any on my
computer. So is it possible at all?
>
please check the "Windows Types" of your HTMLHelp Project
- Open HTMLHelp Workshop
- go to Add/Modify windows definition
- go to tab "Extended Styles"
- uncheck "Topmost"
The user can switch between the windows now.
If you don't mean this, you have to position the help window to the
right/left side of your app window inside your screen. See "Windows Types"
"Position" and "Navigation Pane"
HTH
Best regards
Ulrich Kulle
****************************
http://www.help-info.de
****************************
perhaps I did not understand the requirement correctly yet.
> Thanks for the feedback.
> Topmost was never checked. It is unchecked by default. I think that style
is just relative to other help windows you may have. I have only one help
window, and I need it so that the user can switch between the application
window and the help window, and the help window will not always stay on top
of the application window.
In addition, the "Topmost" check box in the HTMLHelp Workshop is unfavorably
with an assistance window. One can reach the application window badly
because the assistance window always is "on top".
> As for the position thing, that's what I've been doing. By default I place
my application on the left side of the screen, and help on the right side.
But still, I'd prefer if the user could nicely switch between the 2 windows.
>
If you download my example from the link below, you can call a CHM help
window example from the app menu . It lies over the application window, one
can however switch between the app window and the help window.
http://www.help-info.de/en/Visual_Basic_net/visual_basic_net.htm
Try the example and don't hesitate posting again.
Best regards
Ulrich Kulle
*****************************
http://www.help-info.de
*****************************
> I am not sure if I've exmplained it well so here's a couple of screen shots:
>
> http://www.notry.net/dump/my_files/ss_help2.jpg
> http://www.notry.net/dump/my_files/ss_help2.jpg
>
> Or to demonstrate:
>
> Launch your demo for example, and click Help | Contents. Now click on the
application dialog, and the Help window is still covering the application
window.
> Start notepad. Probably it's better if it's not maximized. Click Help | Help
Topics and the Help window is opened. Now click on the notepad window, and now
it becomes on top of the help window.
>
> This is what I am trying to accomplish.
>
> From searching the web, Ive read in a few places that it could be done using
HtmlHelp(...) function and passing 0 for the first parameter (the window
handle). Basically something like this is what ive seen a couple of websites
talk about:
>
> CODE:
>
> Declare Function HtmlHelp Lib "HHCtrl.ocx" Alias "HtmlHelpA" (ByVal hwndCaller
As Long, _
> ByVal pszFile As String, ByVal uCommand As Long, ByVal dwData As Long) As
Long
>
> and then somewhere else:
>
> HtmlHelp(0&, "helpfile.chm", &H0, 0&)
>
> but this doesnt do anything in my program.
> My application is in VB.NET.
>
VB.Net needs integer as first parameter.
You are right - only the API call works in the way you are looking for (my
example VB2003.net)
I use this module - but not all is clear at this moment with help calls. Seems
it's more difficult than VB6
Module modHelp
Public Const HH_DISPLAY_TOPIC As Short = &H0 ' select last opened tab,
[display a specified topic]
Public Const HH_DISPLAY_TOC As Short = &H1 ' select contents tab, [display
a specified topic]
Public Const HH_DISPLAY_INDEX As Short = &H2 ' select index tab and searches
for a keyword
Public Const HH_DISPLAY_SEARCH As Short = &H3 ' select search tab and perform
a search
Public Const HH_HELP_CONTEXT As Short = &HF ' display mapped numeric value in
dwData
' The first parameter of the call MUST be an Integer type
Public Declare Function HTMLHelp_BaseCall Lib "hhctrl.ocx" Alias "HtmlHelpA" _
(ByVal hWnd As Integer, _
ByVal lpHelpFile As String, _
ByVal wCommand As Long, _
ByVal dwData As Long) As Long
' The last parameter of the call MUST be string
Public Declare Function HTMLHelp_TopicCall Lib "hhctrl.ocx" Alias "HtmlHelpA"
_
(ByVal hWnd As Integer, _
ByVal lpHelpFile As String, _
ByVal wCommand As Long, _
ByVal dwData As String) As Long
Public Sub ShowContents(ByVal intHelpFile As Integer)
'--- Call to show Table of Contents ---
Dim RetVal As Long
RetVal = HTMLHelp_BaseCall(0, HFile(intHelpFile), HH_DISPLAY_TOC, 0)
End Sub
Public Sub ShowIndex(ByVal intHelpFile As Integer)
'--- Call to show Index ---
Dim RetVal As Long
RetVal = HTMLHelp_BaseCall(0, HFile(intHelpFile), HH_DISPLAY_INDEX, 0)
End Sub
Public Sub ShowTopic(ByVal intHelpFile As Integer, ByVal strTopic As String)
'--- Call to show topic ---
Dim RetVal As Long
RetVal = HTMLHelp_TopicCall(0, HFile(intHelpFile), HH_DISPLAY_TOPIC,
strTopic)
End Sub
Public Sub ShowTopicID(ByVal intHelpFile As Integer, ByVal IdTopic As Long)
'--- Call to show Index ---
Dim RetVal As Long
RetVal = HTMLHelp_BaseCall(0, HFile(intHelpFile), HH_HELP_CONTEXT, IdTopic)
End Sub
Public Function HFile(ByVal i_HFile As Integer) As String
Dim sHelpFile As String
Dim sStartupPath As String
'--- Initialize context-sensitive help ---
sStartupPath = Application.StartupPath.ToString
sHelpFile = Replace(sStartupPath, "\bin", "\hlp") & "\VBnetCHM.chm"
Select Case i_HFile
Case 1
Return sHelpFile
Case 2
' Place other Help file paths in successive case statements
End Select
End Function
End Module
Best regards
Ulrich Kulle
***************************************
http://www.help-info.de
***************************************