zoukankan      html  css  js  c++  java
  • 全面控制任务栏以及桌面代码

    procedure TForm1.FormCreate(Sender: TObject);
    begin
    Wnd[0]:=FindWindow('Shell_TrayWnd',nil);
    Wnd[1]:=FindWindowEx(Wnd[0],HWND(0),'Button',nil);
    Wnd[2]:=FindWindow('Shell_TrayWnd',nil);
    Wnd[2]:=FindWindowEx(Wnd[2],HWND(0),'ReBarWindow32',nil);
    Wnd[3]:=FindWindow('Shell_TrayWnd',nil);
    Wnd[3]:=FindWindowEx(Wnd[3],HWND(0),'TrayNotifyWnd',nil);
    Wnd[4]:=FindWindow('Shell_TrayWnd',nil);
    Wnd[4]:=FindWindowEx(Wnd[4],HWND(0),'TrayNotifyWnd',nil);
    Wnd[4]:=FindWindowEx(wnd[4],HWND(0),'TrayCLockWClass',nil);
    end;

    procedure TForm1.btn1Click(Sender: TObject);
    begin
    EnableWindow(wnd[1],True );
    end;

    procedure TForm1.btn2Click(Sender: TObject);
    begin
    EnableWindow(wnd[1],False );
    end;

    procedure TForm1.btn3Click(Sender: TObject);
    begin
    ShowWindow(wnd[1],SW_NORMAL );
    end;

    procedure TForm1.btn4Click(Sender: TObject);
    begin
    ShowWindow(wnd[1],SW_HIDE );
    end;

    procedure TForm1.btn7Click(Sender: TObject);
    begin
    EnableWindow(wnd[2],True );
    end;

    procedure TForm1.btn8Click(Sender: TObject);
    begin
    EnableWindow(wnd[2],False  );
    end;

    procedure TForm1.btn5Click(Sender: TObject);
    begin
    ShowWindow(wnd[2],SW_NORMAL );
    end;

    procedure TForm1.btn6Click(Sender: TObject);
    begin
    ShowWindow(wnd[2],SW_HIDE  );
    end;

    procedure TForm1.btn9Click(Sender: TObject);
    begin
    EnableWindow(wnd[3],True );
    end;

    procedure TForm1.btn11Click(Sender: TObject);
    begin
    EnableWindow(wnd[3],False );
    end;

    procedure TForm1.btn10Click(Sender: TObject);
    begin
    ShowWindow(wnd[3],SW_NORMAL );
    end;

    procedure TForm1.btn12Click(Sender: TObject);
    begin
    ShowWindow(wnd[3],SW_HIDE  );
    end;

    procedure TForm1.btn13Click(Sender: TObject);
    begin
    EnableWindow(wnd[4],True );
    end;

    procedure TForm1.btn15Click(Sender: TObject);
    begin
    EnableWindow(wnd[4],False );
    end;

    procedure TForm1.btn14Click(Sender: TObject);
    begin
    ShowWindow(wnd[4],SW_SHOWNORMAL);
    end;

    procedure TForm1.btn16Click(Sender: TObject);
    begin
    ShowWindow(wnd[4], SW_HIDE );
    end;

     

    /**********************************************

    ***********************************************/

    procedure TForm1.btn1Click(Sender: TObject);
    var
      h: HWND;
    begin
      h := FindWindow('Progman', nil);   {Progman 是桌面窗口的类名}
      ShowWindow(h, SW_HIDE)
    end;
    procedure TForm1.btn2Click(Sender: TObject);
    var
      h: HWND;
    begin
      h := FindWindow('Progman', nil);   {Progman 是桌面窗口的类名}
      ShowWindow(h, SW_RESTORE );
    end;

  • 相关阅读:
    UVA 221
    A Typical Homework(学生信息管理系统)
    追踪电子表格中的单元格
    浮点数!!!(摘)
    poj 3158kickdown
    循环小数 UVa202
    Unix is 命令
    W
    V
    完美世界 字符串倒置输出
  • 原文地址:https://www.cnblogs.com/feng801/p/1279446.html
Copyright © 2011-2022 走看看