Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Autologin for different Sites
#1
I put some snippets together and tried to change some code.
Maybe i did something right, but it seems that i also did something wrong. :lol:
Can anybody help me to correct this and make it complete?

Function Dialog67
Code:
Copy      Help
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages

str controls = "5 6"
str e5 e6
if(!ShowDialog("Dialog67" &Dialog67 &controls)) ret

;BEGIN DIALOG
;0 "" 0x90C80A44 0x100 0 0 204 190 "Dialogin"
;3 Static 0x54000000 0x0 4 6 48 12 "user"
;4 Static 0x54000000 0x0 4 22 48 12 "password"
;5 Edit 0x54030080 0x200 54 6 96 14 ""
;6 Edit 0x54030080 0x200 54 22 96 14 ""
;7 Button 0x54032000 0x0 4 44 48 14 "Add"
;8 Button 0x54032000 0x0 4 62 48 14 "Remove"
;9 ListBox 0x54230103 0x200 54 44 96 141 ""
;10 Button 0x54032000 0x0 152 170 48 14 "Login"
;END DIALOG
;DIALOG EDITOR: "" 0x2030208 "" "" ""


ret
;messages
lpstr xfolder="$personal$\Dialogin" ;;change this
lpstr xfile="$personal$\Dialogin\YTlogin.xml" ;;and this

sel message
,case WM_INITDIALOG
,;when opening the dialog, make sure that the folder and the file exist
,if(!dir(xfile))
,,mkdir xfolder
,,_s="<x />"
,,_s.setfile(xfile)
,else
,,;if already exists, populate listbox
,,update_listbox_from_xml2 hDlg xfile
,,
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case LBN_DBLCLK<<16|9
,_i=LB_SelectedItem(lParam)
,out _i
,
,case 7 ;;Add
,;get text from edit boxes
,str u p
,u.getwintext(id(5 hDlg))
,p.getwintext(id(6 hDlg))
,if(empty(u) or empty(p)) ret
,;save to file
,IXml x=CreateXml; x.FromFile(xfile)
,IXmlNode n=x.RootElement.Add("i")
,n.Add("u" u)
,n.Add("p" p)
,x.ToFile(xfile)
,;update listbox
,update_listbox_from_xml2 hDlg xfile
,
,case 8 ;;Remove
,int i=LB_SelectedItem(id(9 hDlg)); if(i<0) ret
,i=SendMessage(id(9 hDlg) LB_GETITEMDATA i 0)
,;remove from file
,x=CreateXml; x.FromFile(xfile)
,n=x.RootElement.Child("i" i+i)
,x.Delete(n)
,x.ToFile(xfile)
,update_listbox_from_xml2 hDlg xfile
,
,case IDOK
,case IDCANCEL
,case 10
,,run "firefox.exe"
,,wait 0
,,;; I tried to understand this and to read the Information from "_i=LB_SelectedItem(lParam)"
,,;; It would be much cooler if doubleclick starts the action.
,,;; The goal was to get a working auto login for different Sites...  epic fail xD
,,str v1=n.ChildValue("*") ;;get value of a child.. any child? I need the right one xD
,,n=x.Path("rootelem/_i") ;;find a node by path / SelectedItem?
,,str v2=n.Value ;;get its value
,,AutoPassword v1 v2 2 0 10
,,key TVY
ret 1

The Login Button is'nt necessary i think. It would be better if the login starts with doubleclick.
My biggest problem is to read the correct nodes in the xml when the user doulbeclicks a entry from the list.

How can i tell QM to not close a dialog if the user starts an action ?
Because i want to use the login more than once.


Whoever helps me..
Thankyou buddy! :mrgreen:


Messages In This Thread

Forum Jump:


Users browsing this thread: 4 Guest(s)