Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
dialog input box,saving inserted infoto txt
#8
Hi vig and Gint!

Im back on another account to restart this topic haha Its quite funny actually as i forgot my logins on the old veritas account and im back asking for help with the password mac. :lol:

Anyway I have not been using Quick Mac for awhile now and i need some help with Vigs code.

TheVig Wrote:Here is an example of a dialog that uses .ini files.

I know you said txt, but this should do the trick for you, I think?!?
You can update information in the dialog. If you have more than one account, you can create MySpace1, MySpace2,etc...

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

;BEGIN DIALOG
;0 "" 0x90C80A44 0x100 0 0 223 57 "Passwords"
;1 Button 0x54030001 0x4 0 36 48 14 "OK"
;2 Button 0x54030000 0x4 50 36 48 14 "Cancel"
;3 Edit 0x54030080 0x200 100 6 120 12 ""
;4 Edit 0x54030080 0x200 100 22 120 13 ""
;5 Edit 0x54030080 0x200 100 38 120 12 ""
;7 Button 0x54032000 0x0 0 20 98 14 "Save"
;6 ComboBox 0x54230243 0x0 0 6 96 213 ""
;END DIALOG
;DIALOG EDITOR: "" 0x2030001 "" "" ""

str controls = "3 4 5 6"
str e3 e4 e5 cb6

if(dir("$desktop$\passwords\*"))
,goto Load
else
,mkdir "$Desktop$\passwords"

;Load
Dir d
foreach(d "$desktop$\passwords\*" FE_Dir)
,cb6.addline(d.FileName)
,cb6.getfilename(cb6)

str Data Name Web User Pass Hive


if(!ShowDialog("Password2" &Password2 &controls)) ret

ret
;messages
sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case CBN_DROPDOWN<<16|6
,_i=CB_SelectedItem(lParam)
,RefreshCombo(id(6 hDlg))
,case 7
,Name.getwintext(id(3 win("Passwords" "#32770")))
,Hive.format("$desktop$\passwords\%s.ini" Name)
,rset Name "Name" Name Hive
,User.getwintext(id(4 win("Passwords" "#32770")))
,rset User "User" Name Hive    
,Pass.getwintext(id(5 win("Passwords" "#32770")))
,rset Pass "Pass" Name Hive
,
,case CBN_SELENDOK<<16|6
,_i=CB_SelectedItem(lParam)
,Name.getwintext(id(6 win("Passwords" "#32770")))
,Web="Web"
,User="User"
,Pass="Pass"
,Hive.format("$desktop$\passwords\%s.ini" Name)
,rget Name "Name" Name Hive
,Name.setwintext(id(3 win("Passwords" "#32770")))
,rget User "User" Name Hive
,User.setwintext(id(4 win("Passwords" "#32770")))
,rget Pass "Pass" Name Hive
,Pass.setwintext(id(5 win("Passwords" "#32770")))
,
,case IDOK
,,Name.getwintext(id(6 win("Passwords" "#32770")))
,Web="Web"
,User="User"
,Pass="Pass"
,Hive.format("$desktop$\passwords\%s.ini" Name)
,rget Name "Name" Name Hive
,Name.setwintext(id(3 win("Passwords" "#32770")))
,rget User "User" Name Hive
,User.setwintext(id(4 win("Passwords" "#32770")))
,rget Pass "Pass" Name Hive
,Pass.setwintext(id(5 win("Passwords" "#32770")))
,case IDCANCEL
ret 1

Function RefreshCombo
Code:
Copy      Help
\
function lis

str tmp
SendMessage(lis CB_RESETCONTENT 0 0)

Dir d
foreach(d "$desktop$\passwords\*" FE_Dir)
,tmp.getfilename(d.FileName)
,SendMessage(lis CB_INSERTSTRING 0 tmp)


CB_SelectItem(lis 0)

Hopefully this is like what you want!

Im using this code again to create my ini files. But how can i make it so it only saves to a single INI file and not duplicate? Also once the INI is saved, which is the best way to make the mac email me the INI File for a backup (I use Gmail). I see alot of posts regarding send mail including the post i made, however this was over 3-4 years ago.


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)