Delphi and Kylix

Moderators: pritaeas
Number of threads: 7264
Number of posts: 19073

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Windows Keys and the Start Menu Posted by martbase on 30 Apr 2004 at 10:21 AM
Hi fellow programmers and developers.

I would like to disable the Start Menu from within my delphi code. Is there anyone out there who knows how I can prevent the Start Menu from displaying when either the Left/Right Windows Keys are pressed.

Thank you.
Report
Re: Windows Keys and the Start Menu Posted by zibadian on 30 Apr 2004 at 11:29 AM
: Hi fellow programmers and developers.
:
: I would like to disable the Start Menu from within my delphi code. Is there anyone out there who knows how I can prevent the Start Menu from displaying when either the Left/Right Windows Keys are pressed.
:
: Thank you.
:
In Win95/98/ME see the follwoing message: http://www.programmersheaven.com/c/MsgBoard/read.asp?Board=4&MsgID=165179

I don't know how to perform it in WinNT/2000/XP, but you'll probably need to set up a keyboard hook to catch the system key presses.
Report
Re: Windows Keys and the Start Menu Posted by mohfa on 7 May 2004 at 12:20 AM
: : Hi fellow programmers and developers.
: :
: : I would like to disable the Start Menu from within my delphi code. Is there anyone out there who knows how I can prevent the Start Menu from displaying when either the Left/Right Windows Keys are pressed.
: :
: : Thank you.
: :
: In Win95/98/ME see the follwoing message: http://www.programmersheaven.com/c/MsgBoard/read.asp?Board=4&MsgID=165179
:
: I don't know how to perform it in WinNT/2000/XP, but you'll probably need to set up a keyboard hook to catch the system key presses.
:

ok hello i think it's better to hide it and disable it so use this :

procedure ShowStartButton(bvisible: Boolean);
var
h: hwnd;
TaskWindow: hwnd;
begin
if bvisible then
begin
h := FindWindowEx(GetDesktopWindow, 0, 'Button', nil);
TaskWindow := FindWindow('Shell_TrayWnd', nil);
ShowWindow(h, 1);
Windows.SetParent(h, TaskWindow);
end
else
begin
h := FindWindowEx(FindWindow('Shell_TrayWnd', nil), 0, 'Button', nil);
ShowWindow(h, 0);
Windows.SetParent(h, 0);
end;
end;

{Example to hide/show the Startbutton


procedure TForm1.Button1Click(Sender: TObject);
begin
ShowStartButton(False); // or true to show it again
end;

{Furthermore, you could create your own Startbutton and
replace the original one with your own.}

var
b: TButton; // or another Type of button
h, Window: hwnd;
begin
Window := FindWindow('Shell_TrayWnd', nil);
b := TButton.Create(nil);
b.ParentWindow := Window;
b.Caption := 'Start';
b.Width := 60;
b.Font.Style := [fsbold];
end;





 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.