Solved

How to open winhelp as inactive

Posted on 1997-07-15
5
267 Views
Last Modified: 2010-04-06
I want my program to work so that every time dialog is displayed -> help appears next to it (they will be side by side). Only problem is that the focus is transfered to the winhelp-window, so that key shortcuts in my dialog dosent work.

Any ideas how to open winhelp and keep to focus in a main program.
0
Comment
Question by:olmy
  • 3
5 Comments
 
LVL 1

Expert Comment

by:ygolan
ID: 1338914
Why don't you post a message to yourself right after you call WinExec, and call Application.MainForm.BringToFront when you get the message ?
0
 
LVL 1

Author Comment

by:olmy
ID: 1338915
Have you tried it? I couldn't make it work!
0
 
LVL 8

Accepted Solution

by:
ZifNab earned 100 total points
ID: 1338916
Look at this :

Call your help-file with :

BOOL WinHelp(

    HWND  hwnd,      // handle of window requesting Help
    LPCTSTR  lpszHelp,      // address of directory-path string
    UINT  uCommand,      // type of Help
    DWORD  dwData       // additional data
   );

Winhelp(hwnd, lpszHelp, HELP_SETWINPOS, HelpWinInfo)

HelpWinInfo is of structure :

typedef struct {    // hwi

    int   wStructSize;
    int   x;
    int   y;
    int   dx;
    int   dy;
    int   wMax;
    TCHAR rgchMember[2];
} HELPWININFO;

Variable wMax specifies how the window is shown :

so give wMax SW_SHOWNA.

I haven't tried it out, but I guess this works. Hope it for you!
If it works, let us know!

Have fun
c.u.
ZifNab.
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1338917
I think you better reject my answer, don't think it works. But maybe I've helped you a little bit. I'll have a closer look when I have the time.

I think you even don't have to call WinHelp, you can also use HelpCommand(Help_SetWinPos, HelpWinInfo)
The problem at the moment is that I don't know how to fill in HelpWinInfo. Maybe you've to give it with the helpfile source.

Other sollution??? Use the Windows API : SetWindowPos() and use the handle of the help-form.

Hope I've helped you already a little bit. If you've found to beat the HelpWinInfo problem, please give me a sign.

Have fun,
c.u. ZifNab!
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1338918
Hi Olmy,

Sorry, haven't found a solution.

A asked somebody and he says that when a program, online help starts, the help-window automaticaly becomes activated. You can't do anything about it.
What you can do is after activating help online, to activate your  own window.

Like this :

Application.HelpContext({something});
SetActiveWindow(Form1.Handle);

Hopes this helps you,
Have fun,
c.u. ZifNab;


0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now