zoukankan      html  css  js  c++  java
  • 刷新任务栏因进程关闭而停留下来的图标

    //刷新任务栏图标
    function RefreshTaskbarIcon: Integer;
    var
      hShellTrayWnd: HWND;   //任务栏窗口
      hTrayNotifyWnd: HWND;  //任务栏右边托盘图标+时间区
      hSysPager: HWND;     //不同系统可能有可能没有这层
      hToolbarWindow32: HWND;  //托盘图标窗口  
      r: TRECT;
      width, height: integer;
      x: Integer;
    begin
      hShellTrayWnd  := FindWindow('Shell_TrayWnd',nil);
      hTrayNotifyWnd := FindWindowEx(hShellTrayWnd,0,'TrayNotifyWnd',nil);
      hSysPager := FindWindowEx(hTrayNotifyWnd,0,'SysPager',nil); 
      if (hSysPager <> 0) then
            hToolbarWindow32 := FindWindowEx(hSysPager,0,'ToolbarWindow32',nil)
      else
        hToolbarWindow32 := FindWindowEx(hTrayNotifyWnd,0,'ToolbarWindow32',nil);
     
      if (hToolbarWindow32 <> 0) then
      begin
        GetWindowRect(hToolbarWindow32,r);
        width := r.right - r.left;
        height := r.bottom - r.top;
        //从任务栏中间从左到右 MOUSEMOVE一遍,所有图标状态会被更新  
        for x := 1 to width-1 do
          SendMessage(hToolbarWindow32,WM_MOUSEMOVE,0,MAKELPARAM(x,trunc(height/2)));
      end;
    end;
    
    ---------------------
    { 
    作者:lovewjp 
    来源:CSDN 
    原文:https://blog.csdn.net/lovewjp/article/details/44986437 
    版权声明:本文为博主原创文章,转载请附上博文链接!
    }
  • 相关阅读:
    Periodic Strings ( UVA
    Digit Counting ( UVA
    Molar mass ( UVA
    Score ( UVA
    Let the Balloon Rise (STL)
    Tree Recovery (STL)
    安卓simpleadapter问题
    安卓活跃手指问题
    python 问题记录
    设计模式笔记
  • 原文地址:https://www.cnblogs.com/westsoft/p/9952560.html
Copyright © 2011-2022 走看看