GetActiveWindow与GetForegroundWindow两者有何区别? - VC/MFC / 资源
来源:百度文库 编辑:神马文学网 时间:2024/04/27 23:10:41
发表于:2007-08-17 11:34:27 来自MSDN:
The active window is either the window that has the current input focus or the window explicitly made active by the SetActiveWindow member function
The foreground window applies only to top-level windows(frame windows or dialog boxes).
网上有人说:
GetActiveWindow() 是你的程序的当前激活的窗口。
GetForegroundWindow() 是整个Windows系统的当前激活的窗口。
我自己仍然有点不明白,当期窗口不就是当前激活的窗口吗?大家来讨论下。
The SetForegroundWindow window function, on the other hand, activates a window and forces it into the foreground. An application should only call SetForegroundWindow if it needs to display critical errors or information that needs the user 's immediate attention.
看了这个有点明白了,SetActiveWindow函数只有激活最前面的那个窗口(foreground —— the top of z-order)才能使该窗口为当前窗口。而SetForegroundWindow强迫设置窗口为最前面的窗口并激活它使它成为当前窗口。 SetForegroundWindow包含有SetActiveWindow的激活功能。我这样分析对否?
Retrieves the window handle to the active window attached to the calling thread's message queue.
Syntax
Copy
HWND WINAPI GetActiveWindow(void);
Parameters
This function has no parameters.
Return Value
HWND
The return value is the handle to the active window attached to the calling thread's message queue. Otherwise, the return value is NULL.
Remarks
To get the handle to the foreground window, you can use GetForegroundWindow.
To get the window handle to the active window in the message queue for another thread, use GetGUIThreadInfo.
The active window is either the window that has the current input focus or the window explicitly made active by the SetActiveWindow member function
The foreground window applies only to top-level windows(frame windows or dialog boxes).
网上有人说:
GetActiveWindow() 是你的程序的当前激活的窗口。
GetForegroundWindow() 是整个Windows系统的当前激活的窗口。
我自己仍然有点不明白,当期窗口不就是当前激活的窗口吗?大家来讨论下。
- 对我有用[0]
- 丢个板砖[1]
- 引用
- 举报
- 管理
- TOP
- benkaoya
- 等 级:
The SetForegroundWindow window function, on the other hand, activates a window and forces it into the foreground. An application should only call SetForegroundWindow if it needs to display critical errors or information that needs the user 's immediate attention.
看了这个有点明白了,SetActiveWindow函数只有激活最前面的那个窗口(foreground —— the top of z-order)才能使该窗口为当前窗口。而SetForegroundWindow强迫设置窗口为最前面的窗口并激活它使它成为当前窗口。 SetForegroundWindow包含有SetActiveWindow的激活功能。我这样分析对否?
- 对我有用[0]
- 丢个板砖[0]
- 引用
- 举报
- 管理
- TOP
- TalentLi
- (总有一天不再菜)
- 等 级:
- 对我有用[1]
- 丢个板砖[0]
- 引用
- 举报
- 管理
- TOP
- lhy2199
- (清茶几许)
- 等 级:
- 对我有用[0]
- 丢个板砖[0]
- 引用
- 举报
- 管理
- TOP
- mynote
- (户中文)
- 等 级:
- 对我有用[0]
- 丢个板砖[0]
- 引用
- 举报
- 管理
- TOP
- jiereliyi
- (别老气我~!)
- 等 级:
- 对我有用[0]
- 丢个板砖[0]
- 引用
- 举报
- 管理
- TOP
- cst_zf
- 等 级:
Retrieves the window handle to the active window attached to the calling thread's message queue.
Syntax
Copy
HWND WINAPI GetActiveWindow(void);
Parameters
This function has no parameters.
Return Value
HWND
The return value is the handle to the active window attached to the calling thread's message queue. Otherwise, the return value is NULL.
Remarks
To get the handle to the foreground window, you can use GetForegroundWindow.
To get the window handle to the active window in the message queue for another thread, use GetGUIThreadInfo.
- 对我有用[0]
- 丢个板砖[0]
- 引用
- 举报
- 管理
- TOP
- cst_zf
- 等 级:
GetActiveWindow与GetForegroundWindow两者有何区别? - VC/MFC / 资源
编译成release版本与debug版本的程序有何执行上的区别? VC/MFC / 基础类...
什么是投标保证金?什么是履约保证金?两者有何区别?
iso9660文件格式 VC/MFC / Visual C 资源
C++、VC++、MFC的区别和联系
MBA、PMP与WBSA有何区别
精油与一般药品有何区别?
精油与一般化妆品有何区别?
纯绦纱与涤纶纱有何区别
ATM传输和以太网传输两者有什么区别
什么是VC?什么是PE?它们之间有什么区别?(3)-VC PE实务-金融资源-天下金融网
什么是VC?什么是PE?它们之间有什么区别?(5)-VC PE实务-金融资源-天下金融网
会计准则与会计制度有何区别小企业会计准则有哪些
VC /MFC 源码下载
党史专家:毛泽东与“四人帮”有何根本区别
百家姓知识之二:姓与氏有何区别
中医的“肾”与西医的“肾”有何区别
买壳上市与借壳上市有何区别
催眠、催眠状态与正常睡眠有何区别?
SWISS MADE与SWISS MOVT有何区别?
[转载]汇款代放生与亲自放生有何区别?
什么是外协?与外包有何区别?
什么是抽象类什么是接口两者有什么区别?如何使用它
什么是抽象类什么是接口两者有什么区别?如何使用它艾丝凡