将窗口的formstyle属性设置为fsAlwaysontop,无法将窗口置顶
用setwindowpaos api也不行有谁遇到过这种情况?
用setwindowpaos api也不行有谁遇到过这种情况?
解决方案 »
- bpl文件如何打开
- 在DBGIRD中加入一列序号
- EmbeddedWb ver 14.3 (07/06/2006) 第3932行有个小小的错误
- 如何将delphi中spin edit控件的increment设置为小数
- 两个问题!~
- 谁有reportbuilder 4 for delphi5的,我给他300分
- 关于label控件的问题?
- 如何得到scrollbar的横竖那个移动滑块的移动距离!!请求各位大侠告诉我答案!!
- 怎么在文本文件的某一行后添加一行字符??
- 帮我把下边的Fortran语句转换成MATLAB语句,跪求大神,
- 求助:更新sql
- TList中保存Pointer(String)是否安全
begin
inherited;
params.ExStyle:= params.ExStyle or WS_EX_TOPMOST;
end;
function BringWindowToTopEx(hWnd: HWND): Boolean;
begin
if IsIconic(hWnd) then //最小化
ShowWindow(hWnd, SW_RESTORE);
if GetForegroundWindow <> hWnd then
SetForegroundWindow(hWnd);//enabled
//BringWindowToTop(hWnd);//not enabled
//ForceForegroundWindow(hWnd);//enabled
{SetWindowPos(hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE or SWP_NOSIZE);
SetWindowPos(hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE or SWP_NOSIZE);//enabled}
//SwitchToThisWindow(hWnd, True);//enabled
Result := GetForegroundWindow = hWnd;
end;function BringWindowToTopMost(hWnd: HWND; bTopMost: Boolean): Boolean;
begin
if IsIconic(hWnd) then //最小化
ShowWindow(hWnd, SW_RESTORE);
if bTopMost then
SetWindowPos(hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE or SWP_NOSIZE)
else
SetWindowPos(hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE or SWP_NOSIZE);
end;function BringWindowToTopXY(hWnd: HWND; X, Y: Integer;
hWndInsertAfter: HWND): Boolean;
begin
Result := BringWindowToTopEx(hWnd);
Result := SetWindowPos(hWnd, hWndInsertAfter, X, Y, 0, 0, SWP_NOSIZE)
and Result;
end;