源码如下:<br><br>#include <vcl.h><br>#pragma hdrstop<br>#include "Unit1.h"<br>#pragma package(smart_init)<br>#pragma resource "*.dfm"<br>TForm1 *Form1;<br>RECT rect1, rect2;<br><br>__fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner)<br>{<br> /*获取系统信息*/<br> GetWindowRect(GetDesktopWindow(), &rect1);<br> SystemParametersInfo(SPI_GETWORKAREA, 0, &rect2, SPIF_SENDCHANGE);<br>}<br><br>void __fastcall TForm1::Button1Click(TObject *Sender)<br>{<br> /*设置自定义信息*/<br> SystemParametersInfo(SPI_SETWORKAREA, 0, &rect1, SPIF_SENDCHANGE);<br> SetWindowPos(Form1->Handle, HWND_TOPMOST,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE);<br>}<br><br>void __fastcall TForm1::Button2Click(TObject *Sender)<br>{<br> /*恢复系统原始设定*/<br> SystemParametersInfo(SPI_SETWORKAREA, 0, &rect2, SPIF_SENDCHANGE);<br> SetWindowPos(Form1->Handle, HWND_NOTOPMOST,0,0,rect2.right,rect2.bottom,SWP_NOZORDER);<br>}