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;

  • 相关阅读:
    Storm 中drpc调用
    yarn下资源配置
    java 中 Stringbuff append源代码浅析
    总结的MR中连接操作
    hive中使用rcfile
    MapFile
    HDFS副本存放读取
    zoj 1967 Fiber Network/poj 2570
    zoj 2027 Travelling Fee
    poj 1742 Coins
  • 原文地址:https://www.cnblogs.com/zhangzhifeng/p/6197407.html
Copyright © 2011-2022 走看看