Controlling other opened windows.

How do I set focus on another opened window, e.g. notepad and start sending tabs and keystrokes ? I'm trying to get around the Delphi/400 client installation when keying the QSECOFR's password. I have a few hundred installations ...

Hi wengwah,
What about APi BringWindowToTop? You can use FindWindow to look for other windows by class name, or use EnumWindows or GetWindow to look through the list of current windows.
The BringWindowToTop

What about APi BringWindowToTop? You can use FindWindow to look for other windows by class name, or use EnumWindows or GetWindow to look through the list of current windows.

The BringWindowToTop function brings the specified window to the top of the Z order. If the window is a top-level window, it is activated. If the window is a child window, the top-level parent window associated with the child window is activated.

BOOL BringWindowToTop(

HWND hWnd // handle of window
);
Parameters

hWnd

Identifies the window to bring to the top of the Z order.

Return Value

If the function succeeds, the return value is TRUE.
If the function fails, the return value is FALSE. To get extended error information, call GetLastError.

Have a look in the Extras\SendKeys directory on the Delphi CD. SendKeys.pas has an AppActivate routine where you supply a window name.
Also, there is SendKeys which takes a string, and a boolean wait value.
Might be just what you're looking for.

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

I would prefer just sending WM_CHAR/WM_KEYDOWN/WM_KEYUP messages to the window without activating or focussing the it, because win98 sometimes makes problems with activating windows. Sometimes the program that you activated is in reality NOT activated, but only blinking in the taskbar.

API is something that we aren't suppose to like much, but we have to learn to live with it.
API is based on handles and messages, which are simple constant numbers. Every object has it's handle (index), and you can access it with this handle, using API functions. These functions are simple DLL extracts, that are commonally used by all windows programming tools.
The best thing to do is register (free) in the MSDN, or use the SDK, which is mostly just Win32.HLP. You can find almost all documentation in there, though on MS site it's more organized and updated. (http://premium.microsoft.com/msdn/library/).

A lot of questions regard threads in Delphi.
One of the more specific questions is how to show progress of the thread.
Updating a progressbar from inside a thread is a mistake.
A solution to this would be to send a synchronized message to the…

The uses clause is one of those things that just tends to grow and grow.
Most of the time this is in the main form, as it's from this form that all others are called.
If you have a big application (including many forms),
the uses clause in the in…

Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…