How can I Disable and enable start button ?

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
peruzziAsked:
Who is Participating?
 
calinutzConnect With a Mentor Commented:
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
 
arodionovCommented:
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
 
calinutzCommented:
//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
 
calinutzCommented:
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
 
peruzziAuthor Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.