Solved

How to open winhelp as inactive

Posted on 1997-07-15
5
276 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

803 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