win98系统中屏蔽开始菜单中的项(100分)

  • 主题发起人 主题发起人 sunroll
  • 开始时间 开始时间
S

sunroll

Unregistered / Unconfirmed
GUEST, unregistred user!
请问在win98系统中屏蔽开始菜单中除“关闭系统”外的所有项?
急。。。。。。
 
路径:[HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Policies/Explorer]

键值1:"NoRecentDocsMenu"=hex:01,00,00,00
作用: 隐藏文档(Documents)菜单

键值2:"ClearRecentDocsOnExit"=hex:01,00,00,00
作用: 在每次退出系统时,自动清除文档菜单中的历史记录

键值3:″NoRecentDocsHistory″=hex:01,00,00,00
作用: 禁止将最近操作过的文档放入文档菜单历史记录中

键值4:″NoFind″=hex:01,00,00,00  作用:隐藏查找(Find)菜单

键值5:″NoRun″=hex:01,00,00,00   作用:隐藏运行(Run)菜单

键值6:″NoLogOff″=hex:01,00,00,00 作用:隐藏注销到…(LogOff)菜单

键值7:″NoClose″=hex:01,00,00,00  作用:隐匿关闭系统(ShutDown)菜单
 
键值8:″NoSetFolders″=Hex:01,00,00,00
作用: 隐匿设置(Setting)菜单中的控制面板&打印机

键值9:″NoFavoritesMenu″=hex:01,00,00,00 作用:隐匿收藏夹(Favorite)菜单

键值10:″NoStartBanner″=hex:01,00,00,00
作用: 禁止任务栏上"单击这里开始"的提示

键值11:"NoSetTaskbar"=hex:01,00,00,00
作用: 禁止设置(Setting)菜单中的任务栏合开始菜单

路径:[HKEY_CLASSES_ROOT/Directory/shell/find/ddeexec]

默认="[FindFolder("路径", 路径)]"
作用: 改变"查找"对话框中的默认搜索路径


在你的程序中对此注册表键值进行修改就是了
不知以上提供够了?
 
来晚了啊,也可以以同样的办法在开始菜单中加入新的项
 
[:D]
你的问题你可以试试两种方法:
1、利用现成的软件改注册表的方法,如<windows优化大师>这个小工具,在它的“系统安全优化->开始菜单”中,可以选择在开始菜单中显示那些项目,不要的就去掉。很好用,不过改后系统要重启。
2、你自己写程序实现截获开始菜单被按下的消息,在把开始菜单换成自己的。因为任务栏本身也是窗口,开始菜单只不过是一个按键,他的窗口句柄和窗口消息都很容易得到。
下面是部分代码,一看就懂的。
{************************************************************
开始按钮替换控件
周栋梁 设计 snzdl@sina.com

感谢您使用这个控件,她是我在设计网管系统时所想象到的,本
着为中国软件作点贡献,我公布了这个控件的原代码,您可以任意的
使用和发布她,但我仍然希望您能保证她的完整性,这也是您得到她
的源码的唯一要求,如果您有网站且觉得她还是能拿的出手的话,我
肯请您将她放在您的网站上,让更多的人使用她、了解她。
由于我的水平确实不行,也行有许多需要改进的地方,如果您能
提供更改建议的话,我将十分的高兴并表示以最诚挚的谢意!
**************************************************************}


//定义StarBtn

unit StartBtn;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls,
Forms, Dialogs,stdctrls,Buttons,ExtCtrls, CommCtrl,menus;

type
TToolBar = (tlHide,tlEnable,tlNone);
TTrayBar = (tyHide,tyNone);

TmyBtn = class(TCustomControl)
private
FGlyph:TBitmap;
procedure SetGlyph(value:TBitmap);
protected
procedure MouseEnter(var msg:tmessage);message CM_MOUSEENTER;
procedure MouseDown(Button: TMouseButton; Shift: TShiftState;
X, Y: Integer); override;
procedure MouseUp(Button: TMouseButton; Shift: TShiftState;
X, Y: Integer); override;
procedure Paint;override;
procedure Down;
{ Protected declarations }
public
constructor create(Aowner:Tcomponent);override;
destructor destroy;override;
property Glyph:TBitmap read FGlyph write SetGlyph;
property Color;
property Caption;
property Hint;
property ShowHint;
end;


TStartBtn = class(TComponent)
private
{ Private declarations }
FToolBar:TToolBar;
FTrayBar:TTrayBar;
StBtn:TMyBtn;
FCaption:String;
FActive:Boolean;
FShowHint:Boolean;
FHint:String;
FFont:TFont;
FGlyph:TBitmap;
FColor:TColor;
BtnClick: TNotifyEvent;

procedure SetActive(value:Boolean);
procedure SetCaption(value:String);
procedure SetFont(value:TFont);
procedure SetGlyph(value:TBitmap);
procedure SetColor(value:TColor);
procedure SetToolBar(value:TToolBar);
procedure SetTrayBar(value:TTrayBar);
procedure SetShowHint(value:Boolean);
procedure SetHint(value:String);
procedure ActiveBegin;
procedure ActiveEnd;
protected
{ Protected declarations }
public
constructor create(Aowner:Tcomponent);override;
destructor destroy;override;
{ Public declarations }
published
{ Published declarations }
property ToolBar:TToolBar read FToolBar write SetToolbar;
property TrayBar:TTrayBar read FTrayBar write SetTrayBar;
property Active:Boolean read FActive write SetActive;
Property Caption:String read FCaption write SetCaption;
property Font:TFont read FFont write SetFont;
property Glyph:TBitmap read FGlyph write SetGlyph;
property Color:TColor read FColor Write SetColor;
property ShowHint:Boolean read FShowHint write SetShowHint;
property Hint:String read FHint write SetHint;

property OnBtnClick: TNotifyEvent read BtnClick write BtnClick;

procedure PopSysMenu;
procedure ExitWindows;
end;

procedure Register;

var
Activing:Boolean;
TmpForm:TForm;
SbHH,SlHH,TlBarHH,TyBarHH,BtnHH:Thandle;

procedure ExitWindowDialog(ParentHWND:HWND);Stdcall;external 'Shell32.dll' index 60;

implementation

procedure Register;
begin
RegisterComponents('Zdl', [TStartBtn]);
end;

{ TmyBtn }

constructor TmyBtn.create(Aowner: Tcomponent);
begin
inherited;
FGlyph:=TBitMap.Create;
end;

destructor TmyBtn.destroy;
begin
inherited;
FGlyph.Free;
end;

procedure TmyBtn.Down;
procedure Line(x1,y1,x2,y2:integer);
begin
Canvas.MoveTo(x1,y1);
Canvas.LineTo(x2,y2);
end;
begin
Canvas.Pen.Color:=clBlack;
Line(0,0,width,0);
Line(0,0,0,Height);
Canvas.Pen.Color:=clWhite;
Line(Width-1,0,width-1,Height-1);
Line(0,Height-1,Width,Height-1);
Canvas.Pen.Color:=clGray;
Line(Width-2,1,width-2,Height-2);
Line(1,Height-2,Width-1,Height-2);
end;

procedure TmyBtn.MouseDown(Button: TMouseButton; Shift: TShiftState; X,
Y: Integer);
begin
inherited;
if button=mbLeft then Down;
end;

procedure TmyBtn.MouseEnter(var msg: tmessage);
begin
//refresh;
end;


procedure TmyBtn.MouseUp(Button: TMouseButton; Shift: TShiftState; X,
Y: Integer);
begin
inherited;
Refresh;
end;

procedure TmyBtn.Paint;
var
n:integer;
procedure Line(x1,y1,x2,y2:integer);
begin
Canvas.MoveTo(x1,y1);
Canvas.LineTo(x2,y2);
end;
begin
inherited;
Canvas.Brush.Color:=Color;
Canvas.Brush.Style:=bsClear;
SetBkMode(Canvas.Handle,0);
Canvas.FillRect(Self.GetClientRect);
Glyph.Transparent:=True;
n:=(Height-Glyph.Height) div 2;
Canvas.Draw(4,n,Glyph);
n:=(Height-Canvas.TextHeight(Caption)) div 2;
Canvas.Font.Assign(Font);
Canvas.TextOut(6+glyph.Width,n,Caption);

Canvas.Pen.Color:=clWhite;
Line(0,0,width,0);
Line(0,0,0,Height);
Canvas.Pen.Color:=clBlack;
Line(Width-1,0,width-1,Height-1);
Line(0,Height-1,Width,Height-1);
Canvas.Pen.Color:=clGray;
Line(Width-2,1,width-2,Height-2);
Line(1,Height-2,Width-1,Height-2);
end;

procedure TmyBtn.SetGlyph(value: TBitmap);
begin
if assigned(value) then
begin
FGlyph.Assign(value);
Refresh;
end;
end;

{ TStartBtn }

procedure TStartBtn.ActiveBegin;
begin
if (csdesigning in componentstate) then exit;
if BtnHH=0 Then Exit;
if (Active=Activing) then Exit;
if Active then
begin
if (SbHH>0) then
begin
TmpForm.show;
Stbtn.Glyph.Assign(Glyph);
StBtn.Paint;
ShowWindow(BtnHH,1);
ShowWindow(SbHH,0);
Windows.SetParent(SbHH,SlHH);
ShowWindow(SbHH,1);
StBtn.OnClick:=OnBtnClick;
end else Exit;
end;
Activing:=True;
end;

procedure TStartBtn.ActiveEnd;
begin
if (csdesigning in componentstate) then exit;
if (Active=Activing) then Exit;
if not Active then
begin
if (SbHH>0) then
begin
ShowWindow(SbHH,0);
ShowWindow(BtnHH,1);
end else Exit;
Activing:=False;
end;
end;

constructor TStartBtn.create(Aowner: Tcomponent);
var
TmpHH:THandle;
begin
inherited;
TmpForm:=TForm.Create(self);
TmpForm.Top:=Screen.Height * 2;
TmpForm.Left:=Screen.Width * 2;
TmpForm.show;
StBtn:=TMyBtn.Create(TmpForm);
StBtn.Parent:=TmpForm;
FToolBar:=tlNone;
FTrayBar:=tyNone;
Activing:=False;
Caption:='开始';
FHint:='单击这里开始';
FShowHint:=True;
TmpHH:=FindWindow('Shell_TrayWnd',nil);
SlHH:=TmpHH;
BtnHH:=FindWindowEx(TmpHH,0,'Button',nil);
TyBarHH:=FindWindowEx(TmpHH,0,'TrayNotifyWnd',nil);
TmpHH:=FindWindowEx(TmpHH,0,'ReBarWindow32',nil);
TlBarHH:=FindWindowEx(TmpHH,0,'ToolBarWindow32',nil);
FFont:=TFont.Create;
FFont.Name:='宋体';
FFont.Height:=-12;
FFont.Size:=9;
FGlyph:=TBitmap.Create;
SbHH:=StBtn.Handle;
Color:=clBtnFace;
Active:=False;
StBtn.Left:=0;
StBtn.Top:=0;
StBtn.Width:=50;
StBtn.Height:=22;
StBtn.Parent:=TmpForm;
StBtn.Font.Assign(Font);
StBtn.OnClick:=OnBtnClick;
end;

destructor TStartBtn.destroy;
begin
Active:=False;
ToolBar:=tlNone;
TrayBar:=tyNone;
StBtn.Free;
TmpForm.Close;
FFont.Free;
FGlyph.free;
inherited Destroy;
end;

procedure TStartBtn.ExitWindows; //调用WIN关闭WINDOWS对话框
begin
ExitWindowDialog(0);
end;

procedure TStartBtn.PopSysMenu; //弹出原WIN开始菜单
begin
SendMessage(application.Handle, WM_SYSCOMMAND, SC_TASKLIST, 0);
end;

procedure TStartBtn.SetActive(value: Boolean);
begin
if (csdesigning in componentstate) then exit;
FActive:=value;
if value then ActiveBegin else ActiveEnd;
end;

procedure TStartBtn.SetCaption(value: String);
begin
FCaption:=value;
StBtn.Caption:=Value;
end;

procedure TStartBtn.SetColor(value: TColor);
begin
FColor:=value;
StBtn.Color:=value;
end;

procedure TStartBtn.SetFont(value: TFont);
begin
FFont.Assign(value);
TmpForm.Font.Assign(value);
StBtn.Font.Assign(value);
StBtn.Paint;
end;

procedure TStartBtn.SetGlyph(value: TBitmap);
begin
FGlyph.Assign(value);
StBtn.Glyph.Assign(value);
StBtn.Paint;
end;

procedure TStartBtn.SetHint(value: String);
begin
FHint:=value;
StBtn.Hint:=value;
end;

procedure TStartBtn.SetShowHint(value: Boolean);
begin
FShowHint:=value;
StBtn.ShowHint:=value;
end;

procedure TStartBtn.SetToolBar(value: TToolBar);
begin
FToolBar:=Value;
if (CsDesigning in ComponentState) then Exit;
if TlBarHH=0 then Exit;
case Value of
tlHide:begin
showwindow(TlBarHH,0);
EnableWindow(TlBarHH,True);
end;
tlEnable:begin
showwindow(TlBarHH,1);
EnableWindow(TlBarHH,False);
end;
tlNone:begin
EnableWindow(TlBarHH,True);
Showwindow(TlBarHH,1);
end;
end;
end;

procedure TStartBtn.SetTrayBar(value: TTrayBar);
begin
FTrayBar:=Value;
if (CsDesigning in ComponentState) then Exit;
if TyBarHH=0 then Exit;
case Value of
tyHide:begin
showwindow(TyBarHH,0);
end;
tyNone:begin
Showwindow(TyBarHH,1);
end;
end;
end;
{ TBtnOp }

end.
//下面是调用主文件
var
Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);
begin
StartBtn.Active:=True;
end;

procedure TForm1.Button7Click(Sender: TObject);
begin
StartBtn.Active:=false;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
StartBtn.ToolBar:=tlHide;
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
StartBtn.ToolBar:=tlEnable;
end;

procedure TForm1.Button4Click(Sender: TObject);
begin
StartBtn.ToolBar:=tlNone;
end;

procedure TForm1.Button5Click(Sender: TObject);
begin
StartBtn.TrayBar:=tyHide;
end;

procedure TForm1.Button6Click(Sender: TObject);
begin
StartBtn.TrayBar:=tyNone;
end;

procedure TForm1.Button8Click(Sender: TObject);
begin
StartBtn.PopSysMenu;
end;

procedure TForm1.StartBtnBtnClick(Sender: TObject);
begin
StartMenu.Popup(0,Screen.Height-25);
end;

procedure TForm1.N3Click(Sender: TObject);
begin
Close;
end;

end.

 
to vine:
可是“文档”和“设置”无法屏幕
 
我用的是<windows优化大师>4.9版,XP系统,我刚才看了一下,都可以的啊!!!
 
键值1:"NoRecentDocsMenu"=hex:01,00,00,00
作用: 隐藏文档(Documents)菜单

我直接在注册表里改,马上能有效果
是不是你在某个地方搞错了
 
后退
顶部