Slideshare Poster

  • Автор темы Автор темы Stroks
  • Дата начала Дата начала
Hi, thanks very much, I got the code working .. the last version. I will try the multi thread version letter.

Код:
Развернуть Свернуть Копировать
In zenno designer: caption = Select file(s) to upload by static.slidesharecdn.com

Код:
Развернуть Свернуть Копировать
lock (SyncObjects.InputSyncer)
{	
	// click hello button
	//Emulator.ActiveWindow(instance.FormTitle);
	//Emulator.MouseClick(instance.ActiveTab.Handle, MouseButton.Left, MouseButtonEvent.Click, 150, 323);
	string dialogCaption = project.Variables["caption"].Value;
	string fileToUpload = project.Variables["fileToUpload"].Value;
	System.Threading.Thread.Sleep(5000);
	// activate dialog
	Emulator.ActiveWindow(dialogCaption, true);
	System.Threading.Thread.Sleep(1000);
	System.Windows.Forms.SendKeys.SendWait(fileToUpload+"{ENTER}");
}
 
  • Оценить
Реакции: Hungry Bulldozer
The only problem with multithreading is that these file-dialog boxes can overlay, so zenno sometimes uploads a wrong file.

This code (should) check and open dialog box only if there is no dialog box present.
Код:
Развернуть Свернуть Копировать
string dialogCaption = project.Variables["caption"].Value;
// set active window
string result = Emulator.ActiveWindow(dialogCaption); 
// check result
if (result == "ok" && !Emulator.ErrorDetected)
{
return "dont";
}
else return "yes";

This should detect if there is an opened window. Am I right?
Код:
Развернуть Свернуть Копировать
string result = Emulator.ActiveWindow(dialogCaption);
if (result == "ok" && !Emulator.ErrorDetected)
 

Кто просматривает тему: (Всего: 0, Пользователи: 0, Гости: 0)