public uint SWP_SHOWWINDOW = 0x0040;
public uint SWP_NOMOVE = 0x0002;
public uint SWP_NOSIZE = 0x0001;
public int HWND_TOP = 0;
public int HWND_TOPMOST = -1;
[DllImport("User32.dll", EntryPoint = "SetWindowPos")]
public static extern bool SetWindowPos(IntPtr hdlControl, int hdlParent, int X, int Y, int width, int height, uint winStat);
private void button10_Click(object sender, EventArgs e)
{
foreach (Process process in Process.GetProcesses())
{
if (process.MainWindowTitle == "My Project")
{
SystemWindow winApi = new SystemWindow(process.MainWindowHandle);
foreach (SystemWindow childWin in winApi.AllDescendantWindows)
{
if (childWin.ClassName.Contains("Combo"))
{
bool state = UserControlMp3Player.SetWindowPos(childWin.HWnd, HWND_TOP, 1000, 500, 100, 50, SWP_SHOWWINDOW);
if (state==true)
{
MessageBox.Show(state.ToString());
}
}
}
}
}
}