如何刷新系统托盘图标

import winex;
import winex.mouse;
var mouseMoveWnd = function( hwnd ){
    if(!hwnd) return;
                     
    var x,y,cx,cy = win.getPos(hwnd)
    for(x=1;cx;2){
        for(y=1;cy;2){
            winex.mouse.move(hwnd,x,y);
        }
    }
}
refreshTrayIcon = function(){ 
    var hwnd = winex.findExists(,,"Shell_TrayWnd","TrayNotifyWnd");
    mouseMoveWnd( winex.findEx( winex.findEx(hwnd,,"SysPager") ,,"ToolbarWindow32") );
    var _,hwnd = winex.findExists(,,"NotifyIconOverflowWindow","ToolbarWindow32");
    mouseMoveWnd( hwnd );
}
//清理无效图标
refreshTrayIcon();


参考

hwnd= winex.findExists(,"通知区域","Shell\_TrayWnd","ToolbarWindow\d+")
        var re ,rcWindow=GetClientRect(hwnd,::RECT())
        for(x=1;rcWindow.right-1;1){
                for(y=1;rcWindow.bottom-1;1){
                        PostMessage(hwnd,0x200/*_WM_MOUSEMOVE*/, 0, y * 65536 + x)
                }
        }      


你可能感兴趣的:(Win,WINEX,winex.mouse)