internal static IntPtr sendString(this IntPtr hWnd, string[] classNames, string msg, bool verb = false)
{
Thread.Sleep(to[toFileStdDlg]);
var hCtrl = hWnd;
if (classNames != null && classNames.Count() > 0)
{
foreach (var c in classNames)
{
hCtrl = user32.FindWindowEx(hCtrl, IntPtr.Zero, c, null);
if (hCtrl.Equals(IntPtr.Zero))
{
$"\tERROR :: sendString not found class {c}".log();
return hWnd;
}
}
#if DEBUG
Thread.Sleep(to[toFileStdDlg]);
#endif
}
for (int i = 0; i < msg.Length; i++)
user32.PostMessage(hCtrl, WM_CHAR, msg[i], 0);
user32.PostMessage(hCtrl, WM_KEYDOWN, user32.VkKeyScan('\r'), 0);
user32.PostMessage(hCtrl, WM_KEYUP, user32.VkKeyScan('\r'), 0);
return hWnd;
}