zoukankan      html  css  js  c++  java
  • delphi 常用的将窗口置前的函数

    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;

  • 相关阅读:
    Sencha Touch 使用笔记
    区数据
    省市 数据
    js校验身份证
    js 邮政编码验证
    原生js添加class
    让IE6 IE7 IE8 IE9 IE10 IE11支持Bootstrap的解决方法
    js学习笔记 Function类型属性的理解
    js学习笔记 理解原型对象
    js学习笔记 chapter5 引用类型
  • 原文地址:https://www.cnblogs.com/zhangzhifeng/p/6197407.html
Copyright © 2011-2022 走看看