Delphi中怎么样隐藏或者显示系统托盘区

解决方案 »

  1.   

    Delphi 6 开发人员指南里有,机械工业出版社,118
    我还没看到那里来。
      

  2.   

    procedure HideSysTray(visible:boolean); 
      var 
      Tray, Child : hWnd; 
      C : array[0..127] of char; 
      S : string; 
      begin 
      Tray := FindWindow('Shell_TrayWnd', NIL); 
      Child := GetWindow(Tray, GW_CHILD); 
      While Child <> 0 do 
      begin 
      If GetClassName(Child, C, SizeOf(C)) > 0 Then 
      Begin 
      S := StrPAS(C); 
      If UpperCase(S) = 'TRAYNOTIFYWND' then 
      begin 
      If visible then ShowWindow(Child, 1) 
      else ShowWindow(Child, 0); 
      end; 
      end; 
      Child := GetWindow(Child, GW_HWNDNEXT); 
      end; 
      end; 
      当自定义过程 HideSysTray() 的参数为 False 时,托盘区隐藏,参数为 True 时,托盘区显示。