高分请教:点击'显示桌面'按钮也不被最小化

coolfire729 2003-05-31 03:01:08
点击'显示桌面'按钮也不被最小化
我拦截了系统消息,大致如下:
procedure WMSysCommand(var Message:Tmessage)message WM_SYSCOMMAND;
...
procedure WMSysCommand(var Message:Tmessage);
begin
if Message.WParam=SC_MINIMIZE then Exit
else inherited;
end;


可是击'显示桌面'按钮也还是被最小化了~~~~~~~~~~~~~~~~~
...全文
62 31 打赏 收藏 转发到动态 举报
写回复
用AI写文章
31 条回复
切换为时间正序
请发表友善的回复…
发表回复
tigerhohoo 2003-09-24
  • 打赏
  • 举报
回复
Very Good
thingking 2003-09-19
  • 打赏
  • 举报
回复
MARK
yjy1001 2003-09-19
  • 打赏
  • 举报
回复
...
调试中
coolfire729 2003-06-17
  • 打赏
  • 举报
回复
确实不能最小华了
但是这个功能早就能简单的实现,关键问题是:让我得Form不在最顶端,有碍视听~
能行吗???
coolfire729 2003-06-15
  • 打赏
  • 举报
回复
调试中。。。。。。。。。。
PhilexPei 2003-06-12
  • 打赏
  • 举报
回复
unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;

type
TForm1 = class(TForm)
private
{ Private declarations }

public
{ Public declarations }
constructor Create(AOwner: TComponent);OVERRIDE;
procedure WndProc(var Msg: TMessage);OVERRIDE;
end;

var
Form1: TForm1;

implementation

{$R *.dfm}
constructor TForm1.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
SetWindowPos(Handle, HWND_TOPMOST, 0, 0,0, 0, SWP_NOMOVE + SWP_NOSIZE);
end;


procedure TForm1.WndProc(var Msg: TMessage);
begin
if(
(Msg.Msg=WM_SHOWWINDOW)
and not
((Msg.WParam <> 0) and (Msg.LParam = SW_PARENTCLOSING))
)then
begin
Msg.Result := 0;
exit;
end;
if ((Msg.Msg=WM_ACTIVATEAPP) and (Msg.WParam = 0)) then
SetWindowPos(Handle, HWND_TOP, 0, 0,0, 0, SWP_NOMOVE+SWP_NOSIZE);
inherited WndProc(Msg);
end;

end.

的确可以啊。我把{}看成delphi的注释了,犯了的低级错误。唉
还是C++的语法看的舒坦啊。
nobill 2003-06-10
  • 打赏
  • 举报
回复
to chifengwatch(chifengwatch) :
高!实在是高!
楼主应该给他满分!
coolfire729 2003-06-07
  • 打赏
  • 举报
回复

通不过啊!

coolfire729 2003-06-03
  • 打赏
  • 举报
回复
试试
谢谢先~~~
coolfire729 2003-06-02
  • 打赏
  • 举报
回复
我在BCB6上怎么出错了???\这段代码是不是有问题....\
郁闷中...
yingyys 2003-06-02
  • 打赏
  • 举报
回复
好!
PhilexPei 2003-06-02
  • 打赏
  • 举报
回复
关注
PhilexPei 2003-06-02
  • 打赏
  • 举报
回复
To : coolfire729(夕阳武士729) ( )
constructor TForm1.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
SetWindowPos(Handle, HWND_TOPMOST, 0, 0,0, 0, SWP_NOMOVE + SWP_NOSIZE);
end;


procedure TForm1.WndProc(var Msg: TMessage);
begin
if ((Msg.Msg=WM_SHOWWINDOW) and not(Msg.WParam and Msg.LParam=SW_PARENTCLOSING)) then
begin
if ((Msg.Msg=WM_ACTIVATEAPP) and (Msg.WParam=0)) then
SetWindowPos(Handle, HWND_TOP, 0, 0,0, 0, SWP_NOMOVE+SWP_NOSIZE);
end;
inherited WndProc(Msg);

end;
PhilexPei 2003-06-02
  • 打赏
  • 举报
回复
喂,怎么搞的,人家是要求按了'显示桌面'程序退出啊
那段代码只能保证显示在最前段啊!
zbc 2003-06-02
  • 打赏
  • 举报
回复
那段代码好像是bcb_fans写的,是正确的
coolfire729 2003-06-02
  • 打赏
  • 举报
回复
不行啊
coolfire729 2003-06-01
  • 打赏
  • 举报
回复
用DELPHI该怎么写》》???????????
coolfire729 2003-06-01
  • 打赏
  • 举报
回复
测试。。。。
高~
RomanticProgrammer 2003-06-01
  • 打赏
  • 举报
回复
还是要感谢你的代码,收藏。。呵呵。
chifengwatch 2003-06-01
  • 打赏
  • 举报
回复
to RomanticProgrammer() 兰企鹅||南极俺最帅 ()
没关系的。

那代码不是我写的,我以前用过一次。现在手上没BCB,只好粘来粘去的了。
加载更多回复(11)

1,221

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder Windows SDK/API
社区管理员
  • Windows SDK/API社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧