home *** CD-ROM | disk | FTP | other *** search
Wrap
' ' This script is used to automatically create and add new dialing directory ' entry for MCI-Mail. ' '--------------------------------------------------------=[ Constants ]=- const WS_BORDER = 0x00800000 const WS_VSCROLL = 0x00200000 const WS_TABSTOP = 0x00010000 const LB_RESETCONTENT = 0x0184 const LB_GETTEXT = 0x0189 const LB_SETTABSTOPS = 0x0192 const LBS_NOTIFY = 0x0001 const LBS_SORT = 0x0002 const LBS_USETABSTOPS = 0x0080 const LBS_STANDARD = LBS_NOTIFY+WS_BORDER+WS_VSCROLL+WS_TABSTOP const CB_GETLBTEXT = 0x0148 const CB_RESETCONTENT = 0x014B const CBS_DROPDOWNLIST = 0x0003 const CBS_SORT = 0x0100 const CBS_STANDARD = CBS_DROPDOWNLIST+WS_VSCROLL+WS_TABSTOP '---------------------------------------------------------------------------=[ Dialogs ]=- dialog Generator 5, 10, 205, 240 caption "MCI Mail Script Maker" groupbox "User Information", -1, 10, 10, 185, 55 rtext "Your User Name", -1, 15, 25, 50, 15 userid as edittext 101, 70, 25, 95, 15 rtext "Your Password", -1, 15, 45, 50, 15 password as edittext 102, 70, 45, 95, 15 groupbox "Connection Information",-1,10,70,185,55 ltext "Modem", -1, 15,85, 40, 15 modem as combobox 106, 60,85,130, 50, groupbox "Phone Information",-1, 10, 135, 185,75 pushbutton "Search Phone Database", 112, 100, 150, 90, 15 ltext "Phone Number", -1, 15,170, 70, 15 areacode as edittext 103,100,170, 25, 15 number as edittext 104,130,170, 60, 15 ltext "Country" , -1, 15,190, 40, 15 country as combobox 105, 60,190,130, 50,CBS_STANDARD+CBS_SORT defpushbutton "Make Script", 114, 15, 220, 50, 14 pushbutton "Cancel", IDCANCEL, 75, 220, 50, 14 pushbutton "About/Info", 113, 135, 220, 50, 14 end dialog dialog ServicesHelp 6, 15, 194, 144 caption "About Script Generator" defpushbutton "OK", IDOK, 72, 122, 50, 14 groupbox "", -1, 4, 4, 185, 111 ltext "MCI-Mail Script Generator is used to automatically create a script to call MCI-Mail.", -1, 10, 10, 170, 25 ltext "Macro Keys are also defined with common MCI-Mail Functions, Use the A,AC,AS,ASC button to toggle.", -1, 10, 35, 170, 25 ltext "Fill in User Name, Password, Country Code, and Modem.", -1, 10, 60, 170, 25 end dialog '--------------------------------------------------------=[ Declarations ]=--- declare Sub SendDlgItemMessageText lib "user32" alias "SendDlgItemMessageA" (hwnd as integer, id as integer, message as integer, wparam as integer, lparam as string) declare function SendDlgItemMessageInt lib "user32" alias "SendDlgItemMessageA" (hwnd as integer, id as integer, message as integer, wparam as integer, lparam as long) as long declare function GetDlgItem lib "user32" (hwindow as integer, id as integer) as integer declare function EnableWindow lib "user32" (hwindow as integer, on as integer) as integer '---------------------------------------------------------------------------=[ Variables ]=- dim n as string dim sl as Generator dim count as integer dim scriptname as string dim cinfo as countryinfo dim readstring as string '---------------------------------------------------------------------------=[ Functions ]=- function GetUniqueScriptName(prefix as string) as string dim scrname as string scrname = ConfigScriptPath + "\" + prefix + ".QSC" dim i as integer i = 0 do while exists(scrname) i = i + 1 scrname = ConfigScriptPath + "\" + prefix + str(i) + ".QSC" loop GetUniqueScriptName = scrname end function function Generator.id(113) as integer dim help as ServicesHelp dialogbox help end function function Generator.id(114) as integer if userid = "" then msgbox "You need to fill in your User Name." exit function end if if password = "" then msgbox "You need to fill in your password." exit function end if if (country < 0) then msgbox "You need to pick a country." exit function end if DialogResult = IDOK n = spc(255) SendDlgItemMessageText (hwindow,105,CB_GETLBTEXT,sl.country,n) end function '---------------------------------------------------------------------------=[ Subroutines ]=- sub Generator.init enablewindow (getdlgitem (hwindow,112),0) enablewindow (getdlgitem (hwindow,103),0) enablewindow (getdlgitem (hwindow,104),0) areacode = "800" number = "967-9600" userid = "" password = "" for count = 1 to getmodemcount addcomboboxitem (hwindow,106,getmodemname (count - 1)) next count modem = 0 if getfirstcountry (cinfo) then do readstring = pad (cinfo.name,150)+pad(str(cinfo.countryid),5)+pad(str(cinfo.countrycode),5) addcomboboxitem (hwindow,105,readstring) loop until not (getnextcountry (cinfo)) end if end sub sub CreateMCIScript print #1, "striphibit on" print #1, "waitfor ""your user name:""" print #1, "send lastconnectuserid" print #1, "waitfor ""Password:""" print #1, "send lastconnectpassword" end sub '---------------------------------------------------------------------------=[ Main ]=- MAIN: if dialogbox(sl) = IDOK then scriptname = GetUniqueScriptName("mci") open scriptname for output as #1 CreateMCIScript close #1 dim entry as phoneentry entry.name = "MCI Mail" entry.areacode = sl.areacode entry.number(1) = sl.number entry.userid = sl.userid entry.password = sl.password entry.scriptfile = scriptname entry.macrofile = "mcimail.mac" entry.emulation = ansi entry.protocol = zmodem entry.useareacountry = 1 entry.tapidevice = getmodemname (sl.modem) entry.countryid = val(mid(n,151,5)) entry.countrycode = val(mid(n,156,5)) entry.iconrespath = "bbsicons.dll" entry.iconresid = 4 if updatephoneentry (entry) then msgbox ("MCI-Mail Entry Modified With New Information") else addphoneentry (entry) msgbox ("Phone directory entry for MCI-Mail created.") end if end if catch err_fileopen msgbox "Could not create script: " + scriptname goto main