源码下载地址:https://download.csdn.net/download/lzksword/87646065
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
//1.設置置頂奩口
SetWindowPos(Handle,HWND_TOPMOST,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button2Click(TObject *Sender)
{
//2.取消置頂窗口
SetWindowPos(Handle,HWND_NOTOPMOST,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button3Click(TObject *Sender)
{
//3.設置置底奩口
SetWindowPos(Handle,HWND_BOTTOM,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormMouseUp(TObject *Sender, TMouseButton Button, TShiftState Shift,
int X, int Y)
{
//4.設置置底奩口
SetWindowPos(Handle,HWND_BOTTOM,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE);
}
//---------------------------------------------------------------------------
//让其不受其它影响可以直接置底
void __fastcall TForm1::FormPaint(TObject *Sender)
{
//5.設置置底奩口
SetWindowPos(Handle,HWND_BOTTOM,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE);
}