Так
Код | int Height, Width; int Transparency = 60; long ExtStyle; TPoint cPt; bool flMouseEnter = false; bool flMouseLeave = true; bool flSmall = true;
//---------------------------------------------------------------------------
void __fastcall TForm1::Timer1Timer(TObject *Sender) { GetCursorPos(&cPt); if(flSmall) { if(int(cPt.y)<(Form1->Top+60)&&int(cPt.y)>Form1->Top&&int(cPt.x)>Form1->Left&&int(cPt.x)<(Form1->Left+120)&&flMouseEnter == false) { ExtStyle = GetWindowLong(Handle, GWL_EXSTYLE); SetWindowLong(Handle, GWL_EXSTYLE, ExtStyle | WS_EX_LAYERED); SetLayeredWindowAttributes(Handle,0,(255*100)/100,LWA_ALPHA); Form1->ClientHeight = 60; flMouseEnter = true; flMouseLeave = false; } if(int(cPt.y)<Form1->Top||int(cPt.y)>(Form1->Top+60)||int(cPt.x)>(Form1->Left+120)||int(cPt.x)<Form1->Left&&flMouseLeave == false) { ExtStyle = GetWindowLong(Handle, GWL_EXSTYLE); SetWindowLong(Handle, GWL_EXSTYLE, ExtStyle | WS_EX_LAYERED); SetLayeredWindowAttributes(Handle,0,(255*Transparency)/100,LWA_ALPHA); Form1->ClientHeight = 18; flMouseEnter = false; flMouseLeave = true; } } } //---------------------------------------------------------------------------
|
результат
|