解决方案 »
- 怎么通过命令行来运行pascal程序
- delphi自定义的过程,函数作不作为窗体函数有什么区别?
- 今天认识个朋友开心(散分1)
- 大家帮帮忙啊 delphi简单进销存程序
- Edit透明在WIN XP下有问题!高手请进来看一下!分不够可再加!
- 如何获得TWebBrowser里打开网页的标题?
- 如何降低CPU占用率?
- 在线等待,包房收银时间有时出错?
- 我想做一个宽带网络计费的软件,希望大家提点意见。(目前给分的上限值只有100,分还可以再加……)(
- 请教如何将一个数据库文件存为*.txt或*.doc的文件,而且不会乱码,答对马上给分。
- delphi中comport控件接收问题
- 用GridEH的日期下拉框进行输入时,如何让它只输入日期而不输入时间
unit untBaseSkinForm;interfaceuses
Windows,SysUtils,Forms,Messages,Graphics;
type
TBaseSkinForm=Class(TForm)
private
protected
//绘制边框和标题栏
procedure WMNCPaint(var Message:TWMNCPaint);message WM_NCPAINT;
procedure WMNCActivate(var Message:TWMNCActivate);message WM_NCACTIVATE;
public End;implementation{ TBaseSkinForm }procedure TBaseSkinForm.WMNCActivate(var Msg: TWMNCActivate);
begin
//
end;procedure TBaseSkinForm.WMNCPaint(var Message: TWMNCPaint);
begin
//
end;end.
begin
inherited;
if (Msg.Result = HTCAPTION) and (Msg.Result <> HTSYSMENU) and (Msg.Result <> HTCLOSE) then
Msg.Result:=0;
end;用这个试试
jankercsdn帅哥,用了你的方法,可行,
目前是鼠标在系统按钮的地方按下去的时候,它还是会绘制出相应的按钮
我发现阻止了WM_NCLBUTTONDOWN就不会绘制了,但是相应的最小化,最大化,关闭功能就没有了.
var
hmMenu:HMENU;
ms:string;
begin
hmMenu:=GetSystemMenu(Handle,False);
SetLength(ms,11);
GetMenuString(hmMenu,1,PChar(ms),10,MF_BYPOSITION);
ms:=Trim(ms);
ModifyMenu(hmMenu,1,MF_BYPOSITION or MF_GRAYED,0,PChar(ms));end;这样呢
borderstles:= bsSingle;
procedure FormMoving(var msg: TWMMoving); message WM_MOVING; rect1: TRect;
procedure TForm1.FormMoving(var msg: TWMMoving);
begin
msg.DragRect^.Left:= rect1.Left;
msg.DragRect^.Top:= rect1.Top;
msg.DragRect^.Right:= rect1.Right;
msg.DragRect^.Bottom:= rect1.Bottom;
end;procedure TForm1.FormCreate(Sender: TObject);
begin
rect1.Left:= Left;
rect1.Top:= Top;
rect1.Right:= Left+ Width;
rect1.Bottom:= top+ Height;
end;
还不如设置窗口 bsnone
自己加个关闭按钮在上面就行了
1.删除多余的系统菜单;
2.固定窗口。//=====================================
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;const
WM_MYMEMO_ENTER = WM_USER + 900;
type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
procedure WMWindowsPos(var Msg:TWMWindowPosMsg);message WM_WINDOWPOSCHANGING;
public
{ Public declarations }
end;var
Form1: TForm1;
implementation
{$R *.dfm}//在窗体加载时将系统菜单中不需要的子菜单删除掉:
procedure TForm1.FormCreate(Sender: TObject);
var
SysMenu: hMenu;
begin
SysMenu := GetSystemMenu(Handle, False);
DeleteMenu(SysMenu, SC_MOVE, MF_BYCOMMAND); //删除系统菜单中的移动项
//还可以继续删:
DeleteMenu(SysMenu, SC_SIZE, MF_BYCOMMAND);
DeleteMenu(SysMenu, SC_MAXIMIZE, MF_BYCOMMAND);
DeleteMenu(SysMenu, SC_RESTORE, MF_BYCOMMAND);
DeleteMenu(SysMenu, SC_MINIMIZE, MF_BYCOMMAND);
end;//固定窗口:
procedure TForm1.WMWindowsPos(var Msg: TWMWindowPosMsg);
begin
with msg do
Begin
WindowPos.x := Left;
WindowPos.y := top;
WindowPos.cx := Width;
WindowPos.cy := Height;
end;
end;end.
//=====================================至于是否最大化,任由你设置。