public void AddClient(Client c) { Logger.Info($"add {c.Title}"); ClientList.Add(c); Task.Run(() => { Icon item = Win32dll.GetAppIcon(c.Hwnd); IconList.Add(item); //Logger.Warn( $"all Client {ClientTitles.ToJson( ) }" ); }); }
// 隠しているとアイコンを自動開放するらしい タイル化ごとに再取得 public void ResetIcon() { foreach (var icon in IconList) { icon.Dispose( ); } IconList.Clear( ); foreach (var c in ClientList) { Icon item = Win32dll.GetAppIcon(c.Hwnd); IconList.Add(item); } }
private void T_Tick( object sender , EventArgs e ) { DebugLogger.Update( ); var wnd = Win32dll.WindowFromPoint( MousePosition.X , MousePosition.Y ); if(MousePosition.Y > UIHeight) { Opacity = 0.7f; } else { Opacity = 1.0f; } uint procID = 0; var now = DateTime.Now; //label2.Text = wnd.ToString( ); label2.Text = now.ToString(" yyyy/MM/dd (ddd)" ); label1.Text = now.ToString( "HH:mm" ); //label1.Text = SelectedClientList( ).Aggregate( "" , ( acc , c ) => acc + "\n" + c.Title ); #if USEWINAPI //IntPtr procPtr = IntPtr.Zero; //uint procID2 = User32Methods.GetWindowThreadProcessId( wnd , procPtr ); #endif Win32dll.GetWindowThreadProcessId( wnd , out procID ); //wnd = Win32dll.OpenProcess( Win32dll.ProcessAccessFlags.QueryInformation | Win32dll.ProcessAccessFlags.VMRead | Win32dll.ProcessAccessFlags.Terminate , false , procID ); //label3.Text = SelectedTag; //var size = User32Methods.GetWindowTextLength( wnd ); //if ( size > 0 ) //{ // var len = size + 1; // var sb = new StringBuilder( len ); // label1.Text = Win32dll.QueryFullProcessImageName( wnd , false ); //} UpdateClient( ); if ( WindowManager.IsDirty ) { #if MultiScreen foreach ( var screen in ScreenList ) { foreach ( var tagMan in screen.TagList ) #else foreach ( var tagMan in WindowManager.ScreenList[ 0 ].TagList ) #endif { UpdateTitle( tagMan ); } #if MultiScreen } #endif Invalidate( ); WindowManager.IsDirty = false; } CalcSlaveSizeFromMaster( ); UpdateSlaveSize( ); #if SCREENCHANGE var movedClientList = WindowManager.ScreenList.SelectMany(screen=> screen.MovedClients( WindowManager.SelectedTag )); UpdateClientScreen( movedClientList ); foreach ( var screen in WindowManager.ScreenList ) { screen.UpdateScreen( WindowManager.SelectedTag ); } #endif }