我想禁止窗體被移動,又想保留窗體標題欄. 請高手指教!!!!!
解决方案 »
- ini文件读取
- SetWindowLong(Handle, GWL_STYLE, GetWindowLong(Handle,GWL_STYLE) and not WS_CAPTION);这条语句是什么意思?
- 各位大侠:为什么不能连续 导入导出数据啊?
- 熟悉XML的朋友请进
- 如何用DELPHI编写一个文本编辑器呢?
- 关于FastReport的打印MEMo换行问题
- 如何在dephi中使用dephi还未包含的windows api(dephi未封闭过的),举例说明
- Delphi COM组件中的运行时错误?????
- 如何连MSSERVER数据库
- 这个板块没人了吗?刚刚学DELPHI。
- 关于网际快车FlashGet 启动后右上方的显示状态的小窗口是如何实现的?~
- 关于网际快车FlashGet 启动后右上方的显示状态的小窗口是如何实现的?
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}
var
OldWindowProc : Pointer;function NewWindowProc(WindowHandle : THandle;
TheMessage : LongInt;
ParamW : LongInt;
ParamL : LongInt) : LongInt{$IFDEF WIN32} stdcall; {$ELSE} ; export; {$ENDIF}
begin
{ Process the message of your choice here }
if TheMessage = WM_NCLBUTTONDOWN then
begin
if paramW=HTCAPTION then exit; end;{ Exit here and return zero if you want }
{ to stop further processing of the message }{ Call the old Window procedure to }
{ allow processing of the message. }
NewWindowProc := CallWindowProc(OldWindowProc,
WindowHandle,
TheMessage,
ParamW,
ParamL);
end;procedure TForm1.FormCreate(Sender: TObject);
begin
OldWindowProc := Pointer(SetWindowLong(Handle,GWL_WNDPROC,LongInt(@NewWindowProc)));
end;procedure TForm1.FormDestroy(Sender: TObject);
begin
SetWindowLong(Handle,GWL_WNDPROC,LongInt(OldWindowProc));
end;end.
TForm1 = class(TForm)
private
procedure wmnchittest(var msg:twmnchittest);message wm_nchittest;
{ Private declarations }
...procedure TForm1.wmnchittest(var msg:twmnchittest);
begin
inherited;
if (htcaption = msg.result) then msg.result:=htclient;
end;
代碼類似於 lincanwen(Too Two To) 的代碼
再再將次感謝. 想給各位加分, 可不知道如何操作. 哈..........