Toolstrip buttons not working when Form launched from external application

A

Apnea

Hi all

I am working on a C# application that is launched as a child within a
3rd party application (not .net)

my problem is that when i use the any control on the form that
inherits from toolstrip the buttons that i add do not do anything.
they paint etc ok but no event gets fired.

I am relatively new to C# and am just finding my feet. I am grateful
for any suggestions

I am currently using the following code to tie my app into the 3rd
party app:

private void MainForm_Load(object sender, EventArgs e)
{
System.IntPtr i = Win32.FindWindow("clawin8388608class2",
"Gemini 6 - Eurotel Ltd");
System.IntPtr j = Win32.FindWindowEx(i, 0, "mdiclient",
null);
Win32.SetParent(this.Handle, j);
}


public class Win32
{

public const int WM_SYSCOMMAND = 0x0112;
public const int SC_CLOSE = 0xF060;

[DllImport("user32.dll")]
public static extern System.IntPtr FindWindow(
string lpClassName, // class name
string lpWindowName // window name
);
[DllImport("user32.dll")]
public static extern System.IntPtr FindWindowEx(
System.IntPtr hWnd, // handle to destination window
int Msg, // message
string wParam, // first message parameter
string lParam // second message parameter
);
[DllImport("user32.dll")]
public static extern int SetParent(
System.IntPtr chH, // class name
System.IntPtr pH // window name
);

}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top