如题:桌面显示文字.纯代码.BAT
----------------------扔代码----------------------
- @Echo off
- Set t=变量:T是显示的内容,C是字体颜色,D是字体大小,X是宽,Y是高
- Set c=red
- Set d=36
- Set x=50
- Set y=50
- Powershell -NoProfile -C "Add-Type -AssemblyName System.Windows.Forms;Add-Type -AssemblyName System.Drawing;Add-Type -MemberDefinition '[DllImport(\"user32.dll\")] public static extern IntPtr SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam); [DllImport(\"user32.dll\")] public static extern bool ReleaseCapture();' -Name User32 -Namespace WinAPI -PassThru | Out-Null;$form=New-Object System.Windows.Forms.Form;$form.FormBorderStyle='None';$form.ControlBox=$false;$form.ShowInTaskbar=$false;$form.TopMost=$true;$form.BackColor='White';$form.TransparencyKey='White';$form.StartPosition='Manual';$label=New-Object System.Windows.Forms.Label;$label.Text='%t%';$label.Font=New-Object System.Drawing.Font('SimSun',%d%,[System.Drawing.FontStyle]::Regular);$label.AutoSize=$true;$label.BackColor='White';$label.ForeColor='%c%';$label.Cursor=[System.Windows.Forms.Cursors]::SizeAll;$form.Controls.Add($label);$form.ClientSize=$label.Size;$form.Location=New-Object System.Drawing.Point(%x%,%y%);$label.Add_MouseDown({param($s,$e)if($e.Button -eq 'Left'){[WinAPI.User32]::ReleaseCapture();[WinAPI.User32]::SendMessage($form.Handle,0xA1,2,0);}});$form.Add_Shown({$form.Activate()});$form.Add_FormClosing({$form.Dispose()});[System.Windows.Forms.Application]::Run($form)"
复制代码
---------代码存 ANSI 编码, XXXX.BAT ------------------
桌面显示文字.纯 Powershell 代码,非第三方工具,
配合 VBS 隐藏启动运行脚本,可以实现开机桌面提示.也可以封装成 EXE 进程,
|