"Unit1.cpp" Dosyası

#include <vcl\vcl.h>
#pragma hdrstop
#include "Unit1.h"
#include <winuser.h>
#pragma resource "*.dfm"
TForm1 *Form1;

HWND Tray, Child;
AnsiString a = "Shell_TrayWnd";

//-------------------------------------------------------------------------


//-------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner):TForm(Owner)
{
}
//-------------------------------------------------------------------------


//-------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{

Tray = ::FindWindow(a.c_str(), NULL);
Child = ::GetWindow(Tray, GW_CHILD);

//Başlat menüsünü kaldır...
::ShowWindow(Child, 0);

}
//-------------------------------------------------------------------------


//-------------------------------------------------------------------------
void __fastcall TForm1::Button2Click(TObject *Sender)
{

Tray = ::FindWindow(a.c_str(), NULL);
Child = ::GetWindow(Tray, GW_CHILD);

//Başlat menüsünü göster...
::ShowWindow(Child, 1);

}
//---------------------------------------------------------------------------

////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////

"Unit1.h" Dosyası

//---------------------------------------------------------------------------
#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
#include <vcl\Classes.hpp>
#include <vcl\Controls.hpp>
#include <vcl\StdCtrls.hpp>
#include <vcl\Forms.hpp>
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published: // IDE-managed Components
TButton *Button1;
TButton *Button2;
void __fastcall Button1Click(TObject *Sender);
void __fastcall Button2Click(TObject *Sender);

private: // User declarations
public: // User declarations
__fastcall TForm1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern TForm1 *Form1;
//---------------------------------------------------------------------------
#endif

////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////

PROGRAMIN EKRAN GÖRÜNTÜSÜ

<<< Geri Dön