Slideshare Poster

Stroks

Client
Регистрация
09.02.2012
Сообщения
219
Благодарностей
14
Баллы
18

Hungry Bulldozer

Moderator
Регистрация
12.01.2011
Сообщения
3 441
Благодарностей
831
Баллы
113
Gimme account I'll give you a template:-)
 
  • Спасибо
Реакции: Stroks

Hungry Bulldozer

Moderator
Регистрация
12.01.2011
Сообщения
3 441
Благодарностей
831
Баллы
113
This code should work fine
 
  • Спасибо
Реакции: Stroks

Stroks

Client
Регистрация
09.02.2012
Сообщения
219
Благодарностей
14
Баллы
18
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

Stroks

Client
Регистрация
09.02.2012
Сообщения
219
Благодарностей
14
Баллы
18
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)
 

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