当前位置: 首页 > 图文教程 > 开发语言 > Delphi > Delphi使用三则

Delphi
利用Delphi编写Socket通信程序
用Delphi设计“抢三十”游戏
对《QQ列表精灵》源代码分析和仿制
Delphi接口编程的两大陷阱
基于Delphi的组件设计之简单实例
基于Delphi的组件设计之概念
浅述Delphi下的OpenGL图形开发
深入理解Delphi的消息机制
Delphi处理SQL Server多媒体数据
Delphi中为RichEdit加入链接
用Delphi7设计FTP上传软件
利用Delphi编程控制摄像头
用Delphi实现快闪窗体信息提示
Delphi制作图形化的ComboBox
用Delphi设计能携带附件的EMail
Delphi中利用网页打造程序界面
Delphi控件的“拿来主义”
Delphi设计PhotoShop型弹出菜单
用Delphi获取Windows及系统路径
Delphi控制Excel自动生成报表

Delphi使用三则


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-10-30   浏览: 53 ::
收藏到网摘: n/a

 

  隐藏和显示Windows的任务条
  如果隐藏和显示Windows的任务条,仅仅调用以下的函数就可以:
  procedure hideTaskbar; //隐藏
  var
  wndHandle : THandle;
  wndClass : array[0..50] of Char;
  begin
  StrPCopy(@wndClass[0], ′Shell—TrayWnd′);
  wndHandle:=FindWindow(@wndClass[0],nil);
  ShowWindow(wndHandle, SW—HIDE);
  End;
  procedure showTaskbar;
  var
  wndHandle : THandle;
  wndClass : array[0..50] of Char;
  begin
  StrPCopy(@wndClass[0], ′Shell—TrayWnd′);
  wndHandle:=FindWindow(@wndClass[0], nil);
  ShowWindow(wndHandle, SW—RESTORE);
  end;

  控制窗体
  如何在Delphi中把Form控制成不能放大/缩小/移动/关闭的窗体,可进行如下步骤:
  1.把Form的BorderIcons下的几个子属性值全改为False;
  2.修改Form的BorderStyle的值为bsSingle;
  3.为了让窗口不能移动,可以自已拦下WM—NCHITTEST消息,对该消息的处理为:一概回应鼠标点在窗口的Client区域, 相信这个视窗就不会动了。
  下面是一个例子, 请参考:
  unit Unit1;
  interface
  uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls,Forms, Dialogs, StdCtrls;
  type
  TForm1 = class(TForm)
  Button1: TButton;
  procedure Button1Click(Sender: TObject);
  private
  { Private declarations }
  procedure WMNCHitTest(var Msg: TMessage); message WM—NCHITTEST;
  public
  { Public declarations }
  end;
  var Form1: TForm1;
  implementation {$R *.DFM}
  procedure TForm1.Button1Click(Sender: TObject);
  begin
  Close; // 不可少, 因为已经没有其他方法能关闭此捶ň褪恰捌燮