とりあえず動いた。
三連休はこれ作ろう。
namespace VOICEROIDtoYMM
{
public partial class Form1 : Form
{
[System.Runtime.InteropServices.DllImport("user32.dll")]
private static extern bool SetForegroundWindow(IntPtr hWnd);
private int no = 0;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
System.Diagnostics.Process[] process = System.Diagnostics.Process.GetProcessesByName("VOICEROID");
System.Diagnostics.Process[] process_ = System.Diagnostics.Process.GetProcessesByName("YukkuriMovieMaker_v3");
for (int i = 0; i < process.Length; i++)
{
if(process[i].MainWindowTitle.IndexOf("VOICEROID+ 琴葉茜") != -1)
{
SetForegroundWindow(process[0].MainWindowHandle);
SendKeys.Send("^{TAB}");
System.Threading.Thread.Sleep(1000);
SendKeys.Send("{RIGHT}");
System.Threading.Thread.Sleep(1000);
SendKeys.Send("{RIGHT}");
System.Threading.Thread.Sleep(1000);
SendKeys.Send("{ENTER}");
System.Threading.Thread.Sleep(1000);
SendKeys.Send("C:\\新しいフォルダー\\akane" + no.ToString("D4"));
System.Threading.Thread.Sleep(1000);
SendKeys.Send("{ENTER}");
System.Threading.Thread.Sleep(1000);
SetForegroundWindow(process_[0].MainWindowHandle);
SendKeys.Send("^{TAB}");
System.Threading.Thread.Sleep(1000);
SendKeys.Send("{ENTER}");
System.Threading.Thread.Sleep(1000);
SendKeys.Send("C:\\新しいフォルダー\\akane" + no.ToString("D4") + ".wav");
System.Threading.Thread.Sleep(1000);
SendKeys.Send("{ENTER}");
System.Threading.Thread.Sleep(1000);
SendKeys.Send(" ");
System.Threading.Thread.Sleep(1000);
no++;
}
}
}
}
}