Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class LoadChild : MonoBehaviour {
- // Update is called once per frame
- void Update () {
- if(Input.GetKeyDown(KeyCode.D))
- {
- int thisHandle = GetWindowHandle().ToInt32();
- System.Diagnostics.Process.Start("child.exe","-parentHWND "+thisHandle);
- }
- }
- [System.Runtime.InteropServices.DllImport("user32.dll")]
- private static extern System.IntPtr GetActiveWindow();
- public System.IntPtr GetWindowHandle()
- {
- return GetActiveWindow();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement