Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Enter password automation on flash control
#1
I'm testing an interesting project. When I enter the quiz, I need to enter the password. It's not very convenient. I want to implement input password automation! Smile

After swf is loaded, enter the password, and then press Enter, but I don't know when the swf is loaded, so it can't always succeed. I hope someone can help me, thanks in advance

Password: 123 Y
_________________________________


int w2=wait(30 WA win("Dialog" "#32770"))
int w=act(w2)
int c=child("" "MacromediaFlashPlayerActiveX" w)
key 123 


Where are these codes added?
_________________________________

Macro swf pwd input
Code:
Select All      Help
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 686 376 "Dialog"
;3 ActiveX 0x54030000 0x0 0 0 686 376 "SHDocVw.WebBrowser {8856F961-340A-11D0-A96B-00C04FD705A2}"
;END DIALOG
;DIALOG EDITOR: "" 0x2040700 "*" "" "" ""

str controls = "3"
str ax3SHD="$desktop$\Quiz\Quiz.html"
if(!ShowDialog(dd &sub.DlgProc &controls)) ret


#sub DlgProc
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1


Attached Files Image(s)
   

.zip   Quiz.zip (Size: 440.46 KB / Downloads: 42)
#2
Create new thread, wait for password accessible object, set its value.
Example with QM forum login.

Macro Macro3054
Code:
Select All      Help
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 686 376 "Dialog"
;3 ActiveX 0x54030000 0x0 0 0 686 376 "SHDocVw.WebBrowser {8856F961-340A-11D0-A96B-00C04FD705A2}"
;END DIALOG
;DIALOG EDITOR: "" 0x2040700 "*" "" "" ""

str controls = "3"
str ax3SHD="http://www.quickmacros.com/forum/showthread.php?tid=6418"
if(!ShowDialog(dd &sub.DlgProc &controls)) ret


#sub DlgProc
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,mac "sub.PasswordThread" "" hDlg
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1


#sub PasswordThread
function w

Acc a.Find(w "LINK" "Login" "" 0x3001 30)
a.DoDefaultAction
a.Find(w "TEXT" "" "state=0x20000000 0x20000040" 0x3004 30)
a.SetValue("password")
#3
thank you for your reply,  Heart

My control is flash, use Acc can not capture the input box control   Huh
#4
The I would try 'wait for image and click'. Look in floating toolbar, dialog "Find image, wait".
#5
After two days of trying, I can finally press F1 to enter the password automatically, but the work is unstable and sometimes I can't enter it.

In addition, I want to achieve, when the swf file is loaded, the password is automatically entered, do not need to press f1

I hope that a friend can help me improve it, thanks in advance  Smile


Macro Macro1
Code:
Select All      Help
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 686 376 "Dialog"
;3 ActiveX 0x54030000 0x0 0 0 686 376 "SHDocVw.WebBrowser {8856F961-340A-11D0-A96B-00C04FD705A2}"
;END DIALOG
;DIALOG EDITOR: "" 0x2040700 "*" "" "" ""

str controls = "3"
str ax3SHD="$desktop$\Quiz\Quiz.html"
if(!ShowDialog(dd &sub.DlgProc &controls)) ret


#sub DlgProc
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,DT_SetAccelerators hDlg "402 F2"
,
,case WM_DESTROY
,case WM_COMMAND goto messages2
,case WM_CLOSE
,DT_Ok(hDlg)
ret
;messages2
sel wParam
,case IDOK
,ifk(Y)
,,key Y           ;; Enter
,,ret 0
,case IDCANCEL
,ret 0
,case 402 ;;mes "F2"
,int w1=win("Dialog" "#32770")
,int c1=child("" "MacromediaFlashPlayerActiveX" w1)
,lef
,if(scan("image:hC1C92FE5" c1 0 16))
,,;key Ca
,,paste 123 ;err
,,key Y
ret 1
#6
Can be used "wait for image" or "wait for caret".

Macro Macro3031
Code:
Select All      Help
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 686 376 "Dialog"
;3 ActiveX 0x54030000 0x0 0 0 686 376 "SHDocVw.WebBrowser {8856F961-340A-11D0-A96B-00C04FD705A2}"
;END DIALOG
;DIALOG EDITOR: "" 0x2040700 "*" "" "" ""

str controls = "3"
str ax3SHD
ax3SHD="Q:\Downloads\Quiz\quiz.html"
if(!ShowDialog(dd &sub.DlgProc &controls)) ret


#sub DlgProc
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,int-- t_flash
,t_flash=child("" "MacromediaFlashPlayerActiveX" hDlg)
,SetFocus t_flash
,SetTimer hDlg 1 50 0 ;;use timer to wait for text cursor (caret) in the flash control
,
,case WM_TIMER
,sel wParam
,,case 1
,,int wCaret=GetCaretXY(_i _i)
,,if wCaret=t_flash
,,,KillTimer hDlg wParam
,,,opt keysync 1
,,,key "123" Y
,
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,ifk(Y) ret 0
,case IDCANCEL
,ifk(Z) ret 0
ret 1
#7
Great recognition method, thank you  Heart

I replaced a web link, it still contains the swf file, but after the code is running, it cannot be input automatically. How do I wait for the status of the cursor and then automatically enter it? Idea

The purpose of automatic input :


I don't want to expose links for my web page demo files, but I want my friends to watch and give them QM generated exe files. When they open, they don't need to enter a password. This is very safe. If QM can achieve this function, Will be very interesting.


Macro auto input 
Code:
Select All      Help
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 686 376 "Dialog"
;3 ActiveX 0x54030000 0x0 0 0 686 376 "SHDocVw.WebBrowser {8856F961-340A-11D0-A96B-00C04FD705A2}"
;END DIALOG
;DIALOG EDITOR: "" 0x2040700 "*" "" "" ""

str controls = "3"
str ax3SHD
;ax3SHD="Q:\Downloads\Quiz\quiz.html"
;ax3SHD="$desktop$\Quiz\quiz.html"
ax3SHD="http://fs.focusky.com.cn/ekeec/yzlo/index.html"
if(!ShowDialog(dd &sub.DlgProc &controls)) ret


#sub DlgProc
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,int-- t_flash
,t_flash=child("" "MacromediaFlashPlayerActiveX" hDlg)
,SetFocus t_flash
,SetTimer hDlg 1 50 0 ;;use timer to wait for text cursor (caret) in the flash control
,
,case WM_TIMER
,sel wParam
,,case 1
,,int wCaret=GetCaretXY(_i _i)
,,if wCaret=t_flash
,,,KillTimer hDlg wParam
,,,opt keysync 1
,,,key "123" Y
,
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,ifk(Y) ret 0
,case IDCANCEL
,ifk(Z) ret 0
ret 1
#8
No cursor in this page. Need to wait for image.

Macro Macro3030
Code:
Select All      Help
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 686 376 "Dialog"
;3 ActiveX 0x54030000 0x0 0 0 686 376 "SHDocVw.WebBrowser {8856F961-340A-11D0-A96B-00C04FD705A2}"
;END DIALOG
;DIALOG EDITOR: "" 0x2040700 "*" "" "" ""

str controls = "3"
str ax3SHD
ax3SHD="http://fs.focusky.com.cn/ekeec/yzlo/index.html"
if(!ShowDialog(dd &sub.DlgProc &controls)) ret


#sub DlgProc
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,mac "sub.Thread" "" hDlg
,
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,ifk(Y) ret 0
,case IDCANCEL
,ifk(Z) ret 0
ret 1

#sub Thread
function w

out "add code to wait for image in window w"
#9
The following code, press F2, can automatically enter the password

I have tried key "123" but sometimes failed, so it changed to paste 123

In some cases, the input password is not stable and needs to be optimized and adjusted

In addition, I don't know how to enter the password automatically. Can it help me? Is there a more stable way to enter the password automatically? thanks  Smile


Macro Macro3
Code:
Select All      Help
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 686 376 "Dialog"
;3 ActiveX 0x54030000 0x0 0 0 686 376 "SHDocVw.WebBrowser {8856F961-340A-11D0-A96B-00C04FD705A2}"
;END DIALOG
;DIALOG EDITOR: "" 0x2040700 "*" "" "" ""

str controls = "3"
str ax3SHD
ax3SHD="http://fs.focusky.com.cn/ekeec/yzlo/index.html"
if(!ShowDialog(dd &sub.DlgProc &controls)) ret


#sub DlgProc
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,DT_SetAccelerators hDlg "402 F2"
,
,case WM_DESTROY
,case WM_COMMAND goto messages2
,case WM_CLOSE
,DT_Ok(hDlg)
ret
;messages2
sel wParam
,case IDOK
,ifk(Y)
,,key Y           ;; Enter
,,ret 0
,case IDCANCEL
,ret 0
,case 402 ;;mes "F2"
,int w=win("Dialog" "#32770")
,int c=child("" "MacromediaFlashPlayerActiveX" w)
,if(scan("color:0xC57101" c 0 16))
,,key Ca
,,paste 123 ;err
,,scan("color:0xC57101" c 0 1|16)
,,lef
ret 1
#10
In actual use, the input focus is sometimes lost. Is there any way to get input focus? Thanks for any suggestions
#11
I would try "wait for image of the password field and click it".
#12
Waiting for an image , sometimes be inaccurate , because the image will not be found after the window is maximized  Undecided


Forum Jump:


Users browsing this thread: 1 Guest(s)