Solved

Focus-problem

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
QRReport  TQrmemo vertical stretching 1 64
Delphi inherited method 6 86
CheckListBox usage 3 95
update joined tables 2 69
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 this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

738 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