请输入您要查询的百科知识:

 

词条 AllowSetForegroundWindow
释义

The AllowSetForegroundWindowfunction 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.

Remark

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 dwProcessIdloses 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 SetForegroundWindowon the window of the previous instance. It should not post a message to the window of the previous instance asking it to call SetForegroundWindowon itself, because the previous instance will not necessarily have permission to call SetForegroundWindow.

Function Information

Minimum DLL Version user32.dll

Header Declared in Winuser.h, include Windows.h

Import library User32.lib

Minimum operating systems Windows Me, Windows 2000See Also

Windows Overview, LockSetForegroundWindow, SetForegroundWindow.

随便看

 

百科全书收录4421916条中文百科知识,基本涵盖了大多数领域的百科知识,是一部内容开放、自由的电子版百科全书。

 

Copyright © 2004-2023 Cnenc.net All Rights Reserved
更新时间:2025/2/26 6:58:15