怎样激活其他程序窗口?(100分)

  • 主题发起人 主题发起人 唐佐平
  • 开始时间 开始时间

唐佐平

Unregistered / Unconfirmed
GUEST, unregistred user!
已知条件:其他程序的句柄,
问题:比如有A,B,C,D等等多个程序在运行,我有一个程序维护这些程序,
我要在一定条件下程序A在最前显示,在一定条件下又将程序B最前显示,
请问怎么做?
 
我記得以前有這個問題,還沒解決嗎??還是另一個啊
 
BringWindowToTop() 函数 将指定窗口提到屏幕最前
 
通过系统里的API函数就行了。
 
SetActiveWindow
 
SetForegroundWindow
 
SendKeys routine for 32-bit Delphi.

Written by Ken Henderson

Copyright (c) 1995 Ken Henderson email:khen@compuserve.com

This unit includes two routines that simulate popular Visual Basic
routines: Sendkeys and AppActivate. SendKeys takes a PChar
as its first parameter and a boolean as its second, like so:

SendKeys('KeyString', Wait);

where KeyString is a string of key names and modifiers that you want
to send to the current input focus and Wait is a boolean variable or value
that indicates whether SendKeys should wait for each key message to be
processed before proceeding. See the table below for more information.

AppActivate also takes a PChar as its only parameter, like so:

AppActivate('WindowName');

where WindowName is the name of the window that you want to make the
current input focus.

SendKeys supports the Visual Basic SendKeys syntax, as documented below.
 
后退
顶部