473,378 Members | 1,426 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,378 software developers and data experts.

Help file always in the foreground

Hi,

How do I get my compiled help file to go to the background when I click
on my application window? If I click on another application it's fine,
but with my app it just stays in front.

Declaration for help as below.

Thanks,

Tim.
Public Declare Function HtmlHelp Lib "HHCtrl.ocx" Alias "HtmlHelpA" _
(ByVal hWndCaller As Long, _
ByVal pszFile As String, _
ByVal uCommand As Long, _
dwData As Any) As Long

Public Const HH_DISPLAY_TOPIC As Long = 0
Public Const HH_HELP_CONTEXT As Long = &HF

Private Sub apphelp_Click()
HtmlHelp hwnd, "apphelp.chm", HH_HELP_CONTEXT, ByVal 100&
End Sub
Jul 27 '05 #1
5 4623
"Tim Freeman" <my****@ipimus.com.au> wrote in message
news:DF******************@news-server.bigpond.net.au...
Hi,

How do I get my compiled help file to go to the background when I click on
my application window? If I click on another application it's fine, but
with my app it just stays in front.

Declaration for help as below.

Thanks,

Tim.
Public Declare Function HtmlHelp Lib "HHCtrl.ocx" Alias "HtmlHelpA" _
(ByVal hWndCaller As Long, _
ByVal pszFile As String, _
ByVal uCommand As Long, _
dwData As Any) As Long

Public Const HH_DISPLAY_TOPIC As Long = 0
Public Const HH_HELP_CONTEXT As Long = &HF

Private Sub apphelp_Click()
HtmlHelp hwnd, "apphelp.chm", HH_HELP_CONTEXT, ByVal 100&
End Sub


Don't pass hWnd to the function, just use a null pointer (0&). The help
window can't stay in front of a window it doesn't know about.

Keith R. Weimer
Way Too Happy Software
Jul 27 '05 #2

"Tim Freeman" <my****@ipimus.com.au> skrev i en meddelelse
news:DF******************@news-server.bigpond.net.au...
Hi,

How do I get my compiled help file to go to the background when I click on
my application window? If I click on another application it's fine, but
with my app it just stays in front.

Declaration for help as below.

Thanks,

Tim.
Public Declare Function HtmlHelp Lib "HHCtrl.ocx" Alias "HtmlHelpA" _
(ByVal hWndCaller As Long, _
ByVal pszFile As String, _
ByVal uCommand As Long, _
dwData As Any) As Long

Public Const HH_DISPLAY_TOPIC As Long = 0
Public Const HH_HELP_CONTEXT As Long = &HF

Private Sub apphelp_Click()
HtmlHelp hwnd, "apphelp.chm", HH_HELP_CONTEXT, ByVal 100&
End Sub


I cann't comment on your code, but my default helpwindows in vba behaves
this rather annoying way (as far as I can tell), so maybe it isn't your code
that's wrong.

Carsten
Jul 27 '05 #3
Don't pass hWnd to the function, just use a null pointer (0&). The help
window can't stay in front of a window it doesn't know about.

Keith R. Weimer
Way Too Happy Software

Hi Keith,

I'd just been looking at the HTML help api to find that "The help window
is owned by the window you specify. As an owned window, a help window
automatically stays on top of its owner and closes when the owner is
closed."
Didn't think about disowning it like that!

Many thanks,

Tim.
Jul 27 '05 #4
In the HtmlHelp declaration, the hwndCaller member is defined as a handle to
an application window or Null. When a handle, the corresponding window owns
the html help window and receives any messages sent by htmlhelp back to the
owner. By setting this to null (0& in VB parlance), you are effectively
telling it that the desktop is the owner, thus allowing the window to fall
behind your app.

Grab the HtmlHelp class from http://www.mvps.org/htmlhelpcenter/ - it really
makes working with htmlhelp pretty easy.

--

Randy Birch
MS MVP Visual Basic
http://vbnet.mvps.org/
----------------------------------------------------------------------------
Read. Decide. Sign the petition to Microsoft.
http://classicvb.org/petition/
----------------------------------------------------------------------------

"Tim Freeman" <my****@ipimus.com.au> wrote in message
news:9D******************@news-server.bigpond.net.au...
:
: > Don't pass hWnd to the function, just use a null pointer (0&). The help
: > window can't stay in front of a window it doesn't know about.
: >
: > Keith R. Weimer
: > Way Too Happy Software
: >
: >
: Hi Keith,
:
: I'd just been looking at the HTML help api to find that "The help window
: is owned by the window you specify. As an owned window, a help window
: automatically stays on top of its owner and closes when the owner is
: closed."
: Didn't think about disowning it like that!
:
: Many thanks,
:
: Tim.

Jul 28 '05 #5
Randy Birch wrote:
In the HtmlHelp declaration, the hwndCaller member is defined as a handle to
an application window or Null. When a handle, the corresponding window owns
the html help window and receives any messages sent by htmlhelp back to the
owner. By setting this to null (0& in VB parlance), you are effectively
telling it that the desktop is the owner, thus allowing the window to fall
behind your app.

Grab the HtmlHelp class from http://www.mvps.org/htmlhelpcenter/ - it really
makes working with htmlhelp pretty easy.

Hi Randy,

That makes it pretty clear now. Handy link as well!

Thanks,

Tim
Jul 28 '05 #6

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

Similar topics

3
by: Herman | last post by:
Hi everyone, I have a multiple file project for a class assignment. It consists of a class Point, then a class Polygon which uses the Point object, then a class Picture that uses the Polygon...
2
by: SStory | last post by:
Here is the situation. I want to display Icons, Type of file etc from a file extension. Upon initial program load I may only need icons for certain files. But other operations will require...
0
by: Tom | last post by:
Here is a very strange problem that I am stumped by. I have a rather large application written in VB.NET (of course) using Framework 1.1. As you know, with an MDI application you can have multiple...
19
by: Noozer | last post by:
I need to keep my application settings in a file that users can copy/backup/etc. Before I start using the old INI file standard, is there any easy way to use XML files to hold application...
1
by: Terry Olsen | last post by:
In my chat application, I create a new window for each private chat. I use the FlashWindowEx API to flash the window if it's not the Foreground window. I determine the Foreground window using the...
8
by: david.lindsay.green | last post by:
Hello all, I am quite new a web scripting and making web pages in general and I have stumbled across a problem I have as yet been unable to solve. I am trying to take the contents of a textarea box...
1
by: Andi | last post by:
Using a DHTML dropdown menu, blocks of menu items should be displayed on top of the page to let the user choose a menu item. So, on top of my page (no matter how it is constructed), there should...
53
by: Hexman | last post by:
Hello All, I'd like your comments on the code below. The sub does exactly what I want it to do but I don't feel that it is solid as all. It seems like I'm using some VB6 code, .Net2003 code,...
1
by: kia | last post by:
Is there any way with JavaScript(I mean programmatically) that we can open the window as a new foreground tab, every time a new tabbed window is opened? For example, like IE7, when user clicks a...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
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...

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.