此功能类似于在windows系统中设置“任务栏和开始菜单”中的属性“自动隐藏”。鼠标要应如何判断此状态栏在屏幕中的坐标位置?若用API函数ClientToScreen ,其需要一个窗口句柄,此窗口是什么?若隐藏了此窗口的句柄是否还存在?

解决方案 »

  1.   

    var hWnd: THandle;
    begin
      h := FindWindow('Shell_TrayWnd', nil);
      if h <> 0 then
        ShowWindow(h,SW_HIDE);  //隐藏
       {ShowWindow(h,SW_SHOW);  //显示}
    end;
      

  2.   

    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
      StdCtrls, ExtCtrls;type
      TForm1 = class(TForm)
        Timer1: TTimer;
        procedure Timer1Timer(Sender: TObject);
        procedure FormCreate(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.DFM}procedure TForm1.Timer1Timer(Sender: TObject);
    var
      hTaskBar : Thandle;
      Rct : TRect;
      Pt : TPoint;
    begin
      hTaskBar := FindWindow('Shell_Traywnd',nil);
      GetWindowRect(hTaskBar,Rct);
      GetCursorPos(pt);
      if PtInRect(Rct,pt) then
        ShowWindow(hTaskBar,sw_shownormal)
      else
        ShowWindow(hTaskBar,sw_Hide)end;procedure TForm1.FormCreate(Sender: TObject);
    begin
      Timer1.Interval := 300;
    end;end.
      

  3.   

    谢谢!怎么能够直接修改windows“任务栏和开始菜单”中的属性“自动隐藏”。  
     
      

  4.   

    Wnyu(过年了,向大家要红包回家) :你的指点非常正确!第二个问题知道吗?(第一个问题的分随后奉上),拜托。