Solved

Focus-problem

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Using idhttp to login to instagram 2 90
Show Listview image from database (String field) 5 127
QRReport  TQrmemo vertical stretching 1 46
Find and Replace Stream with 0s 8 63
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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

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