网站首页  词典首页

请输入您要查询的函数:

 

术语 allowsetforegroundwindow
释义 AllowSetForegroundWindow
语法:
BOOL AllowSetForegroundWindow( DWORD dwProcessId
);
AllowSetForegroundWindow功能
该AllowSetForegroundWindow功能,可以指定进程设置前台窗口使用SetForegroundWindow函数。调用进程必须已经可以设置前台窗口。有关更多信息,请参见备注本主题后面的。
参数
dwProcessId
[in]指定将要启用设置前台窗口的进程标识符。如果此参数ASFW_ANY,所有进程将能够设置前台窗口。
返回值
如果函数成功,返回值为非零。
如果函数失败,返回值是零。该函数将失败,如果调用进程不能设置前台窗口。为了获得更多错误信息,调用GetLastError。
备注
与Microsoft Windows 98和Windows 2000开始,这一制度限制了哪些进程可以设置前台窗口。一个进程可以设置前台窗口下列条件只有一个是正确的:
该进程是前台进程。
这一进程开始了前台进程。
在程序中收到的最后一个输入事件。
没有前台进程。
前台进程正在调试。
前台没有锁定(见LockSetForegroundWindow)。
前台锁定超时已过期(见SystemParametersInfo SPI_GETFOREGROUNDLOCKTIMEOUT)。
视窗2000/XP的:没有菜单活跃。
一个进程,可以设置前台窗口可以使其他进程通过调用AllowSetForegroundWindow前台窗口。由指定的进程dwProcessId无力设置前台窗口下一次用户生成的输入,除非输入是针对这一进程,或下一次进程调用AllowSetForegroundWindow,除非该进程是指定的。
在Windows 95/98/Me:此功能无法实现。因此,进程必须进行合作来管理前台窗口。例如,一个应用程序可能希望支持只有一个实例。当第二个实例启动时,它会检测对前一个实例窗口前一个实例并调用SetForegroundWindow。它不应该发布消息的前一个实例窗口,要求它本身SetForegroundWindow呼吁,因为以前的实例不一定权限调用SetForegroundWindow。
功能信息
最低DLL版本 user32.dll
在Winuser.h中HeaderDeclared,头文件:winuser.h
import libraryUser32.lib
最低经营systemsWindows ME,视窗2000
参见
视窗概述,LockSetForegroundWindow,SetForegroundWindow
==英文原文==AllowSetForegroundWindow Function
The AllowSetForegroundWindow function enables the specified process to set the foreground window using the SetForegroundWindow function. The calling process must already be able to set the foreground window. For more information, see Remarks later in this topic.
Syntax
BOOL AllowSetForegroundWindow( DWORD dwProcessId
);
Parameters
dwProcessId
[in] Specifies the identifier of the process that will be enabled to set the foreground window. If this parameter is ASFW_ANY, all processes will be enabled to set the foreground window.
Return Value
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. The function will fail if the calling process cannot set the foreground window. To get extended error information, call GetLastError .
Remarks
Starting with Microsoft Windows 98 and Windows 2000, the system restricts which processes can set the foreground window. A process can set the foreground window only if one of the following conditions is true:
The process is the foreground process.
The process was started by the foreground process.
The process received the last input event.
There is no foreground process.
The foreground process is being debugged.
The foreground is not locked (see LockSetForegroundWindow ).
The foreground lock time-out has expired (see SPI_GETFOREGROUNDLOCKTIMEOUT in SystemParametersInfo ).
Windows 2000/XP: No menus are active.
A process that can set the foreground window can enable another process to set the foreground window by calling AllowSetForegroundWindow. The process specified by dwProcessId loses the ability to set the foreground window the next time the user generates input, unless the input is directed at that process, or the next time a process calls AllowSetForegroundWindow, unless that process is specified.
Windows 95/98/Me: This function is not implemented. Therefore, processes must cooperate to manage the foreground window. For example, an application may wish to support only one instance. When the second instance starts up, it should detect the previous instance and call SetForegroundWindow on the window of the previous instance. It should not post a message to the window of the previous instance asking it to call SetForegroundWindow on itself, because the previous instance will not necessarily have permission to call SetForegroundWindow.
Function Information
Minimum DLL Versionuser32.dll
HeaderDeclared in Winuser.h, include Windows.h
Import libraryUser32.lib
Minimum operating systemsWindows Me, Windows 2000
See Also
Windows Overview , LockSetForegroundWindow , SetForegroundWindow
==原始网址==http://msdn.microsoft.com/en-us/library/ms632668(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 11:22:32