0
나는 WatIn과 함께 작업하고 saveAs 대화 상자를 사용하여 파일을 저장하지만이 프로세스가 중지되는 Windows/PC를 잠그면 Invoke를 SendMessage로 캐스팅해야 내 PC가 잠길 때이 프로세스가 계속 실행됩니다.SendMessage로 호출
이 방법이 있습니까? 컴퓨터가 잠겨있을 때 호출
private static void ClickSaveAs(AutomationElement mainWindow, AutomationElementCollection dialogElements, string filename)
{
foreach (AutomationElement element in dialogElements)
{
if (element.Current.Name.Equals("Save"))
{
AutomationElementCollection dialogSubElements = element.FindAll(TreeScope.Children, Automation.ContentViewCondition);
InvokePattern clickPatternForSaveDropdown = (InvokePattern)dialogSubElements[0].GetCurrentPattern(AutomationPattern.LookupById(10000));
//I need to change this to..
clickPatternForSaveDropdown.Invoke();
//This
//start
int intWhdr = FindWindow("IEFrame", "");
int currChild = FindWindowEx(intWhdr, 0, "", "Frame Notification Bar");
currChild = 104755016;
int intRes1 = SendMessage(currChild, WM_LBUTTONDOWN, 0, 0);
System.Threading.Thread.Sleep(100);
intRes1 = SendMessage(currChild, WM_LBUTTONUP, 0, 1);
System.Threading.Thread.Sleep(200);
//end
Thread.Sleep(1500);
AutomationElementCollection dialogElementsInMainWindow = mainWindow.FindAll(TreeScope.Children, Condition.TrueCondition);
foreach (AutomationElement currentMainWindowDialogElement in dialogElementsInMainWindow)
{
if (currentMainWindowDialogElement.Current.LocalizedControlType == "menu")
{
// first array element 'Save', second array element 'Save as', third second array element 'Save and open'
InvokePattern clickMenu = (InvokePattern)currentMainWindowDialogElement.FindAll(TreeScope.Children, Condition.TrueCondition)[1].GetCurrentPattern(AutomationPattern.LookupById(10000));
clickMenu.Invoke();
Thread.Sleep(1);
ControlSaveDialog(mainWindow, filename);
break;
//strt
//end
}
}
}
}
}