?
Solved

Focus-problem

Posted on 1998-05-16
2
Medium Priority
?
167 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 960 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

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
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…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses
Course of the Month13 days, 10 hours left to enroll

801 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