Solved

How can I Disable and enable start button ?

Posted on 2004-03-25
5
345 Views
Last Modified: 2010-04-05
How can I Disable and enable start button with its list ?
The solution must success under win9x – winme – winxp
 
I am waiting your answers
Thanks
0
Comment
Question by:peruzzi
  • 3
5 Comments
 

Expert Comment

by:arodionov
ID: 10675489
Hello.

Try to look at www.torry.ru
I saw there components which solves your problem.
Type 'Start button' in the quick search.

Alex.
0
 
LVL 11

Expert Comment

by:calinutz
ID: 10675503
//To disable the start button
  EnableWindow(FindWindowEx(FindWindow('Shell_TrayWnd', nil),0, 'Button', nil),false);

 //To enable the start button
  EnableWindow(FindWindowEx(FindWindow('Shell_TrayWnd', nil),0,'Button',nil),true);

But the problem is that it disables only for mouse click. If you pres the windows button the list appears.
0
 
LVL 11

Expert Comment

by:calinutz
ID: 10675521
Or you could try this to hide the Start button:

procedure ShowStartButton(bValue: Boolean);
var
  Tray, Child: hWnd;
  C: array[0..127] of Char;
  S: String;
begin
  Tray  := FindWindow('Shell_TrayWnd', nil);
  Child := GetWindow(Tray, GW_CHILD);
  while Child <> 0 do
  begin
  if GetClassName(Child, C, SizeOf(C)) > 0 then
  begin
    S := StrPAS(C);
    if UpperCase(S) = 'BUTTON' then
    begin
      if bValue = True then ShowWindow(Child, 1)
      else
        ShowWindow(Child, 0);
    end;
 end;
 Child := GetWindow(Child, GW_HWNDNEXT);
 end;
end;
0
 
LVL 11

Accepted Solution

by:
calinutz earned 40 total points
ID: 10675576
To disable windows buttons you have to use a system wide hook like explained (with code) here:
http://www.swissdelphicenter.ch/en/showcode.php?id=1212
0
 

Author Comment

by:peruzzi
ID: 10677399
Thanks calinutz
and also thanks for arodionov

code work well with  winxp but did not work with winme
what I need is to work under winxp
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now