S
Son Ha
Here my code:
[System.Runtime.InteropServices.DllImport("user32.dll")]
public static extern int SetWindowPos(IntPtr hwnd, IntPtr
hWndInsertAfter,int x,int y,int cx,int cy,int wFlags);
[System.Runtime.InteropServices.DllImport("user32.dll")]
public static extern int BringWindowToTop(IntPtr hwnd);
public IntPtr HWND_TOPMOST =(IntPtr)(-1);
public IntPtr HWND_NOTOPMOST =(IntPtr)(-2);
public int SWP_NOSIZE = 0x1;
private void miToolsCalc_Click(object sender, System.EventArgs e)
{
System.Diagnostics.Process process = new System.Diagnostics.Process();
process.StartInfo.FileName = "calc.exe";
process.Start();
process.WaitForInputIdle();
BringWindowToTop(process.Handle);
SetWindowPos(process.Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE);
}
Calculator displayed but not "topmost" Could you help me?
Thanks,
Son
[System.Runtime.InteropServices.DllImport("user32.dll")]
public static extern int SetWindowPos(IntPtr hwnd, IntPtr
hWndInsertAfter,int x,int y,int cx,int cy,int wFlags);
[System.Runtime.InteropServices.DllImport("user32.dll")]
public static extern int BringWindowToTop(IntPtr hwnd);
public IntPtr HWND_TOPMOST =(IntPtr)(-1);
public IntPtr HWND_NOTOPMOST =(IntPtr)(-2);
public int SWP_NOSIZE = 0x1;
private void miToolsCalc_Click(object sender, System.EventArgs e)
{
System.Diagnostics.Process process = new System.Diagnostics.Process();
process.StartInfo.FileName = "calc.exe";
process.Start();
process.WaitForInputIdle();
BringWindowToTop(process.Handle);
SetWindowPos(process.Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE);
}
Calculator displayed but not "topmost" Could you help me?
Thanks,
Son