2016-04-04 13 views
0

VSust ve Toolstrip ile VS 2010'da basit bir Winform C# uygulaması (.exe) oluşturdum.Winform C# uygulamasında Embe Exe: Fare tıklaması menustrip ve toolstrip üzerinde çalışmıyor

Bu uygulamayı aşağıdaki kodu kullanarak başka bir Winform uygulamasına yerleştirdim.

Sorun şu ki, yerleşik uygulamadaki MenuItem veya Toolstrip düğmelerini tıklayamıyorum. Alt + F veya klavye kısayolları çalışıyor ancak menü veya araç şeridi öğeleri üzerinde fare tıklaması çalışmıyor. Cevabın için teşekkürler.

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.Diagnostics; 
using System.Runtime.InteropServices; 
using System.Threading; 

namespace WindowsFormsApplication2 
{ 
public partial class Form1 : Form 
{ 
    public Form1() 
    { 
     InitializeComponent(); 
    } 

    private void button1_Click(object sender, EventArgs e) 
    { 
     Process p = Process.Start("C:\\NewFolder\\myapplication.exe"); 
     Thread.Sleep(500); // Allow the process to open it's window 
     SetParent(p.MainWindowHandle, panel1.Handle); 
    } 

    [DllImport("user32.dll")] 
    static extern IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParent); 
} 
} 

cevap

İlgili konular