Solved

How to open winhelp as inactive

Posted on 1997-07-15
5
281 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
URL for downloading Google Chrome for Win XP 2 269
DBGrid or StringGrid ? 6 131
MS Access from Delphi 31 96
Delphi Seattle StructureView color 1 30
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

734 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