Advertisement
Sweetening

clippy windows 10

Jul 16th, 2024
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.95 KB | None | 0 0
  1. # Made By Taylor Christian Newsome
  2. Add-Type -AssemblyName System.Windows.Forms
  3. Add-Type -AssemblyName System.Drawing
  4. Add-Type -AssemblyName System.Net.Http
  5.  
  6. # Function to download the image
  7. function Download-Image {
  8. param (
  9. [string]$url,
  10. [string]$path
  11. )
  12. $client = New-Object System.Net.WebClient
  13. $client.DownloadFile($url, $path)
  14. }
  15.  
  16. # Create a temporary file path for the image
  17. $imagePath = [System.IO.Path]::GetTempFileName() + ".gif"
  18. Download-Image "https://media.tenor.com/NkrdlIBG3psAAAAi/would-you-like-help-clippy.gif" $imagePath
  19.  
  20. $form = New-Object System.Windows.Forms.Form
  21. $form.Text = 'PowerShell Clippy'
  22. $form.Size = New-Object System.Drawing.Size(500, 400) # Adjusted size to accommodate the image
  23. $form.StartPosition = 'CenterScreen'
  24. $form.FormBorderStyle = 'None'
  25. $form.BackColor = 'White'
  26. $form.TransparencyKey = 'White'
  27. $form.Opacity = 0.95 # Adjust for desired transparency level
  28.  
  29. # Close Button ("X")
  30. $closeButton = New-Object System.Windows.Forms.Button
  31. $closeButton.Text = 'X'
  32. $closeButton.Location = New-Object System.Drawing.Point($form.Width - 40, 10) # Adjust as necessary
  33. $closeButton.Size = New-Object System.Drawing.Size(30, 30)
  34. $closeButton.BackColor = 'Red'
  35. $closeButton.ForeColor = 'White'
  36. $closeButton.FlatStyle = 'Flat'
  37. $closeButton.add_Click({
  38. $form.Close()
  39. })
  40.  
  41. # PictureBox to display the GIF
  42. $pictureBox = New-Object System.Windows.Forms.PictureBox
  43. $pictureBox.Size = New-Object System.Drawing.Size(480, 320) # Adjust size as needed
  44. $pictureBox.Location = New-Object System.Drawing.Point(10, 50) # Adjust location as needed
  45. $pictureBox.SizeMode = 'StretchImage'
  46. $pictureBox.Image = [System.Drawing.Image]::Fromfile($imagePath)
  47. $pictureBox.BackColor = [System.Drawing.Color]::Transparent
  48.  
  49. $form.Controls.Add($pictureBox)
  50. $form.Controls.Add($closeButton)
  51.  
  52. $form.Add_Shown({$form.Activate()})
  53. $form.ShowDialog()
  54.  
  55. # Cleanup
  56. Remove-Item $imagePath -ErrorAction SilentlyContinue
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement