看似简单的问题:如何让我的Form不被最小化(用户点击'显示桌面'按钮也不最小化)用户点击'显示桌面'按钮也不被最小化
用户按win+m或win+D也不被最小化怎么办?拦截消息TWMSysCommand或ApplicatinEven 都是过了,都只是能在用户点击Form上最小化按钮时拦截,但当用户点击'显示桌面'按钮或按win+m或win+D时还是被最小化了到底能实现吗???????????????????/
搜过以前的贴子,无解.... 高手指教
用户按win+m或win+D也不被最小化怎么办?拦截消息TWMSysCommand或ApplicatinEven 都是过了,都只是能在用户点击Form上最小化按钮时拦截,但当用户点击'显示桌面'按钮或按win+m或win+D时还是被最小化了到底能实现吗???????????????????/
搜过以前的贴子,无解.... 高手指教
解决方案 »
- word 插件问题,谁能解决,我立即给他150分,帖子上先开50分!
- 视频显示
- 服务器端用TServerSocket怎么将一个用户的消息转发给另外一个用户?
- 有关socket,服务器端发送二进制文件,我怎么接收?
- 管理员注意啦,管理员注意了,今天系统不时的发送“空的或者假象的消息”
- aloking(黑鲸)大侠:我想问个问题;我想合并多个jpg图片,我用imageenview1中的layer
- 请问delphi中有二~十进制的转换函数吗.....
- 请教发送与接收消息的一个问题
- 还是关于Checklistbox的问题!来者有分 !
- 关于mts组件回调客户端的问题
- fastreport报表中自动填充行后的问题?
- 好难啊
procedure WMSysCommand(var Message:Tmessage)message WM_SYSCOMMAND;
...
procedure WMSysCommand(var Message:Tmessage);
begin
if Message.WParam=SC_MINIMIZE then Exit
else inherited;
end;
可是击'显示桌面'按钮也还是被最小化了~~~~~~~~~~~~~~~~~
高手,江湖救急哦!
procedure a(Sender:TObject;Var Done:Boolean);procedure Tform1.a(Sender:TObject;Var Done:Boolean);
begin
application.restore;
done:=false;
end;procedure TForm1.FormCreate(Sender: TObject);
begin
Application.OnIdle:=a;
end;Procedure TForm1.FormClose(Sender:TObject;Var Action:TCloseAction);
begin
Application.OnIdle:=Nil;
end;
不让用户点Show Desktop
和激活Win+M & win+D
干脆,最简单的办法 showmessage('请不要点击“显示桌面”!');
//FormStyle:=fsStayOnTop;
procedure TForm2.CreateParams(var Params:TCreateParams);
begin
inherited;
with Params do
begin
Style:=Params.Style xor WS_DLGFRAME;
WndParent:=0; end;
end; procedure TForm2.FormCreate(Sender: TObject);
begin
Width:=36;
Height:=36;
SetWindowLong(Handle,GWL_EXSTYLE,WS_EX_TOOLWINDOW);
end;
因为我不许要FORM最前端显示,那样有碍视听
如何让任务栏上的“显示桌面”按钮都不能最小化我的程序窗口?
另外也不能让右键点击任务栏上该程序的图标而弹出的菜单中
“最小化”这一项来最小化我的程序窗口,如何让我的程序不在
任务栏上显示,请详细一点。200分吐血相送!
来自 :cytown 时间 :1999-10-29 08:50:00
检查WM_SYSCOMMAND
procedure WMSysCommand(var Message: TMessage); message WM_SYSCOMMAND; procedure TForm1.WMSysCommand(var Message:TMessage);
begin
if Message.WParam <> SC_MINIMIZE then
inherited;
end;
来自 :bethouvnlue 时间 :1999-10-29 09:09:00
@@ 来自 :面条 时间 :1999-10-29 09:40:00
cytown:
不行的,我试过。 来自 :cAkk 时间 :1999-10-29 10:29:00
g 来自 :menxin 时间 :1999-10-29 12:05:00
you can process the application 's onmessage event! if msg.message=45057 then
... i found that application can process this message when that button clicked. 来自 :amo 时间 :1999-10-29 13:08:00
》另外也不能让右键点击任务栏上该程序的图标而弹出的菜单中
》“最小化”这一项来最小化我的程序窗口
下面可以解决:
按下按钮1后就可以了,按下按钮2后解除。 function tform1.systest(Var Message : TMessage):boolean;
begin
if (Message.WParam = SC_MINIMIZE) then
begin
message.WParam:=0;
end;
result:= false;
end; procedure TForm1.Button1Click(Sender: TObject);
begin
application.HookMainWindow( systest);
end; procedure TForm1.Button2Click(Sender: TObject);
begin
application.UnhookMainWindow(systest);
end;
来自 :cytown 时间 :1999-10-29 13:25:00
再加上这个就可以了:-)
procedure TForm1.AppMessage(var Msg: TMsg; var Handled: Boolean);
begin
if Msg.wParam = SC_MINIMIZE then
begin
Handled := True;
end;
end;
oncreate里加上:
application.onmessage:=appmessage;
来自 :cytown 时间 :1999-10-29 13:51:00
如果你只要
>“显示桌面”按钮都不能最小化我的程序窗口?
>另外也不能让右键点击任务栏上该程序的图标而弹出的菜单中
>“最小化”这一项来最小化我的程序窗口,
那么, 只加onmessage语句就可以了:-)
来自 :Another_eYes 时间 :1999-10-29 13:58:00
>“显示桌面”按钮都不能最小化我的程序窗口?
这个用message能办到? 谁试得通? 佩服呀佩服
最简单的办法是将任务条hide了. 所有要求都能满足 :) 来自 :menxin 时间 :1999-10-29 16:14:00
it is not easy .Give you an idea to solve the problem ,but it works is not well. you can add these codes into application.onidle event. application.restore;
done:=false; :)sorry for my poor English. 来自 :面条 时间 :1999-10-29 16:36:00
为什么?
from cytown:
procedure WMSysCommand(var Message: TMessage); message WM_SYSCOMMAND; procedure TForm1.WMSysCommand(var Message:TMessage);
begin
if Message.WParam <> SC_MINIMIZE then
inherited;
end;
不行 procedure WMSysCommand(var Message: TMessage); message WM_SYSCOMMAND; procedure TForm1.WMSysCommand(var Message:TMessage);
begin
if Message.WParam <> SC_MINIMIZE then
inherited;
end;
就行了??? 点击任务栏图标,触发的是什么消息? 来自 :CJ 时间 :1999-10-30 00:05:00
你程序一起来,把那个快捷方式替换了吧,呵呵,具体位置建我的问题 来自 :sunstone 时间 :1999-10-31 12:39:00
to cytown :
你的方法对"“显示桌面”图表不好用.
to everyone:
1) 如果你只想让“最小化”菜单和按钮失效的话. 程序如下: unit Unit1; interface uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs; type
TForm1 = class(TForm)
private
{ Private declarations }
procedure WMSysCommand(var Msg: Twmsyscommand); message WM_SYSCOMMAND; public
{ Public declarations }
end; var
Form1: TForm1; implementation {$R *.DFM}
procedure TForm1.WMSysCommand(var Msg:Twmsyscommand);
begin
if Msg.CmdType <> SC_MINIMIZE then inherited;
end; end.
2)如果你想让“显示桌面”按钮对你的程序失效的话.
正在研究.... 3)eys说得有道理.
隐藏task bar就全有了.方法如下:
放入两个按钮 {$R *.DFM}
var
wndHandle : THandle;
wndClass : array[0..50] of Char;
procedure TForm1.HideTaskBarClick(Sender: TObject);
begin
StrPCopy(@wndClass[0], 'Shell_TrayWnd');
wndHandle := FindWindow(@wndClass[0], nil);
ShowWindow(wndHandle, SW_HIDE);
end; procedure TForm1.RestoreTaskBarClick(Sender: TObject);
begin
StrPCopy(@wndClass[0], 'Shell_TrayWnd');
wndHandle := FindWindow(@wndClass[0], nil);
ShowWindow(wndHandle,SW_RESTORE);
end; 4)问题: 点击任务栏“显示桌面”图标,触发的是什么消息?
来自 :cAkk 时间 :2000-03-27 14:36:00
g 来自 :Kang 时间 :2000-03-27 18:44:00
》如何让我的程序不在任务栏上显示
在Form的OnCreate里用
SetWinDowLong(Application.Handle,GWL_EXSTYLE,WS_EX_TOOLWINDOW) 来自 :cAkk 时间 :2000-07-21 11:45:00
时间太久,强制结束。 wjiachun 来自 :cAkk 时间 :2000-07-21 11:46:00
时间太久,强制结束。 wjiachun 来自 :cAkk 时间 :2000-07-21 11:47:00
请继续讨论此题。 wjiachun
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
SetWindowPos(Handle, HWND_TOPMOST, 0, 0,
0, 0, SWP_NOMOVE|SWP_NOSIZE);
}
//---------------------------------------------------------------------------void __fastcall TForm1::WndProc(TMessage& Msg)
{ if (Msg.Msg==WM_SHOWWINDOW && !(Msg.WParam
&& Msg.LParam==SW_PARENTCLOSING)) {
Msg.Result = 0; return;
}
if (Msg.Msg==WM_ACTIVATEAPP && !Msg.WParam)
SetWindowPos(Handle, HWND_TOP, 0, 0,
0, 0, SWP_NOMOVE|SWP_NOSIZE);
TForm::WndProc(Msg);}
var
WndPosFlag: Integer;
begin
if Message.Msg = WM_SHOWWINDOW then
begin
if Message.WParam = 0 then
begin
Exit;
end;
end;
inherited;
end;