Solved

Focus-problem

Posted on 1998-05-16
2
166 Views
Last Modified: 2010-04-06
My program uses Word via OLE. And I have made a toolbar-window that is always on top. I control Word from this toolbar.
The thing is when I activate my toolbar my main window pop's up in front of Word, this is very annoying. Does anyone have a solution?
Making the toolbar as a standalone is however not a solution.
0
Comment
Question by:dr_gonzo
[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
2 Comments
 
LVL 1

Accepted Solution

by:
ssite earned 240 total points
ID: 1345999
You need to attach an event to application.onactivate. In that handler, check screen.activeform for the toolbar form. If this is true, execute ShowWindow(Application.MainForm.Handle, SW_HIDE)  else execute the same but with SW_SHOW);

procedure AppActivate(Sender: TObject);
begin
  if(Screen.ActiveForm = frmtoolbar) then
    ShowWindow(Application.MainForm.Handle, SW_HIDE)
  else
    ShowWindow(Application.MainForm.Handle, SW_SHOW);
end;

This will make the window go away. You can bring it back with SW_SHOW at the time of your convenience.
Hope this helps.
0
 

Author Comment

by:dr_gonzo
ID: 1346000
YES!

You're the best!
It works great.

May The Source Be With You,
Dr. Gonzo

0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

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…
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…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

728 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