Posts: 726
Threads: 99
Joined: Mar 2018
04-25-2018, 04:34 AM
(This post was last modified: 04-25-2018, 05:22 AM by win .)
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!
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
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)
Quiz.zip (Size: 440.46 KB / Downloads: 422)
Posts: 12,061
Threads: 140
Joined: Dec 2002
Create new thread, wait for password accessible object, set its value.
Example with QM forum login.
Macro
Macro3054
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" )
Posts: 726
Threads: 99
Joined: Mar 2018
thank you for your reply,
My control is flash, use Acc can not capture the input box control
Posts: 12,061
Threads: 140
Joined: Dec 2002
The I would try 'wait for image and click'. Look in floating toolbar, dialog "Find image, wait".
Posts: 726
Threads: 99
Joined: Mar 2018
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
Macro
Macro1
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
Posts: 12,061
Threads: 140
Joined: Dec 2002
05-01-2018, 06:37 AM
(This post was last modified: 05-01-2018, 06:44 AM by Gintaras .)
Can be used "wait for image" or "wait for caret".
Macro
Macro3031
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
Posts: 726
Threads: 99
Joined: Mar 2018
05-01-2018, 07:12 AM
(This post was last modified: 05-01-2018, 07:41 AM by win .)
Great recognition method, thank you
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?
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
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
Posts: 12,061
Threads: 140
Joined: Dec 2002
05-01-2018, 08:03 AM
(This post was last modified: 05-01-2018, 08:07 AM by Gintaras .)
No cursor in this page. Need to wait for image.
Macro
Macro3030
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"
Posts: 726
Threads: 99
Joined: Mar 2018
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
Macro
Macro3
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
Posts: 726
Threads: 99
Joined: Mar 2018
In actual use, the input focus is sometimes lost. Is there any way to get input focus? Thanks for any suggestions
Posts: 12,061
Threads: 140
Joined: Dec 2002
I would try "wait for image of the password field and click it".
Posts: 726
Threads: 99
Joined: Mar 2018
Waiting for an image , sometimes be inaccurate , because the image will not be found after the window is maximized