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.Threading.Tasks;
- using System.Windows.Forms;
- using System.Diagnostics;
- using System.Threading;
- using System.Runtime.InteropServices;
- namespace MapleLegends_Overlay
- {
- public partial class Overlay : Form
- {
- [DllImport("user32.dll", SetLastError = true)]
- static extern int GetWindowLong(IntPtr hWnd, int nIndex);
- [DllImport("user32.dll")]
- static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong);
- [DllImport("user32.dll")]
- static extern IntPtr SetParent(IntPtr hwc, IntPtr hwp);
- public Overlay()
- {
- InitializeComponent();
- }
- private void Overlay_Load(object sender, EventArgs e)
- {
- this.TransparencyKey = Color.Wheat;
- this.TopMost = true;
- }
- private void button1_Click(object sender, EventArgs e)
- {
- int pidint = Convert.ToInt32(textBox1.Text);
- Process p = Process.GetProcessById(pidint);
- Thread.Sleep(1000);
- p.WaitForInputIdle();
- SetParent(p.MainWindowHandle, panel1.Handle);
- int initialStyle = GetWindowLong(this.Handle, -20);
- SetWindowLong(this.Handle, -20, initialStyle | 0x80000 | 0x20);
- //Form1 frm = new Form1();
- //Size s = frm.Size;
- //this.WindowState = FormWindowState.Maximized;
- /*this.Size = new Size(1366, 768);
- this.BackColor = Color.Green;
- panel1.Size = new Size(1366, 768);
- panel2.Size = new Size(1366, 768);
- panel2.Top += 200;*/
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement