Solved

Focus-problem

Posted on 1998-05-16
2
158 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
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

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…
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…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

760 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

22 Experts available now in Live!

Get 1:1 Help Now