1 2 //This example hides and shows the start button 3 4 #include <vcl.h> 5 #pragma hdrstop 6 7 #include "Unit1.h" 8 //--------------------------------------------------------------------------- 9 #pragma package(smart_init) 10 #pragma resource "*.dfm" 11 TForm1 *Form1; 12 //--------------------------------------------------------------------------- 13 __fastcall TForm1::TForm1(TComponent* Owner) 14 : TForm(Owner) 15 { 16 } 17 //--------------------------------------------------------------------------- 18 19 void TForm1::HideShowStart(bool bDisplay) 20 { 21 HWND hWndManager; 22 HWND Child; 23 hWndManager = FindWindow("Shell_TrayWnd",NULL); 24 Child = GetWindow(hWndManager, GW_CHILD); 25 if (bDisplay==true){ 26 ShowWindow(Child, 1);//shows start button 27 } 28 else{ 29 ShowWindow(Child, 0) ;//hides start button 30 } 31 } 32 //--------------------------------------------------------------------------- 33 void __fastcall TForm1::Button1Click(TObject *Sender) 34 { 35 HideShowStart(true); 36 } 37 //--------------------------------------------------------------------------- 38 39 void __fastcall TForm1::Button2Click(TObject *Sender) 40 { 41 HideShowStart(false); 42 } 43 //---------------------------------------------------------------------------