Имя пользователя:
Пароль:  
Помощь | Регистрация | Забыли пароль?  

Показать сообщение отдельно

Пользователь


Сообщения: 67
Благодарности: 13

Профиль | Отправить PM | Цитировать


По вопросу записи действий пользователя могу подкинуть примерчик. Писал для личного пользования, упрощал создание автоустановщика программ.
Код: Выделить весь код
#include <Misc.au3>
FileDelete("file.au3")
$dll = DllOpen("user32.dll")
$file = FileOpen("file.au3", 1)
$ffi=""
wr("run('')")
while not _IsPressed("11", $dll)		;ждем нажатия контрола
	sleep(10)
WEnd
TrayTip("","ЗАПИСЫВАЕМ",1)
While 1
	if _IsPressed("01", $dll) Then							;lmb	ctrltext & classn  
		$wtt=WinGetTitle("")
		$wgt=WinGetText("")
		$wgt=repl($wgt)             
		$cgf=ControlGetFocus("")
		if $cgf<>"" then wr("cl('"&$wtt&"','"&$wgt&"','"&$cgf&"')")  ;ControlGetText("","",ControlGetFocus(""))&@lf&
		ToolTip($wtt&@lf&$cgf)
	EndIf
	if _IsPressed("13",$dll) Then
		TrayTip("","ПАУЗА",1)
		sleep(300)
		while 1
			if _IsPressed("13",$dll) Then ExitLoop
			sleep(10)
		WEnd
		TrayTip("","ЗАПИСЫВАЕМ",1)
		sleep(300)
	EndIf
	if _IsPressed("1b", $dll) Then ExitLoop												;esc
	sleep(10)
WEnd
;дополнение :)
wr("Func wa($tx1, $tx2)")
wr("	While WinExists($tx1, $tx2)=0")
wr("		Sleep(1) ")
wr("	WEnd ")
wr("EndFunc")
wr("Func cl($tx1, $tx2,$classn)")
wr("	wa($tx1, $tx2)")
wr("	ControlClick($tx1, $tx2,$classn)")
wr("EndFunc")
DllClose($dll)
FileClose($file)
Func wr($ff)
	if $ffi<>$ff then 
		FileWrite($file,$ff&@LF)
		$ffi=$ff
	EndIf
EndFunc

Func wa($tx1, $tx2)
	While WinExists($tx1, $tx2)=0
		Sleep(1) 
	WEnd 
EndFunc
Func cl($tx1, $tx2,$classn)
	wa($tx1, $tx2)
	ControlClick($tx1, $tx2,$classn)
EndFunc
func repl($ffff)
$tempstr=$ffff
$tempstr=StringReplace($tempstr,@crlf,@lf)
$tempstr=StringReplace($tempstr,@cr,@lf)
$ffff=""
$buff=""
$counter=0

while StringLen($ffff)<200; or StringLen($tempstr)<>0
	$symb=StringLeft($tempstr,1)
	$tempstr=StringTrimLeft($tempstr,1)
	$buff=$buff&$symb
	if $symb=@lf Then
		if $counter<10 then $buff=""
		if $counter>=30 then 
			$ffff=$ffff&$buff;&@lf
			$counter=0
			$symb=""
		EndIf
	EndIf
	if $symb<>@lf Then $counter+=1
	if StringLen($tempstr)=0 then ExitLoop
WEnd
$ffff=StringReplace($ffff,"'","")
	return $ffff
EndFunc
После его работы файл необходимо подредактировать и все готово
Хотя скрипт до ума так и не доведен, но пользоваться можно.

Отправлено: 23:11, 01-08-2008 | #764