03-21-2006, 05:44 PM
Create new function, name it MsgBoxUserPassword, and paste this code using menu Edit -> Other Formats -> Paste Escaped.
Function MsgBoxUserPassword
In macros, where you need input for user name and password, call this function like in the example.
Function MsgBoxUserPassword
;/
function# str&user str&password
;Shows a dialog where the user can input his user name and password.
;Returns 1 on OK, 0 on Cancel.
;On OK, stores user name and password in variables user and password.
;EXAMPLE
;str u p
;if(!MsgBoxUserPassword(u p)) ret
;out u
;out p
str controls = "3 4"
str e3 e4
if(!ShowDialog("MsgBoxUserPassword" 0 &controls)) ret
user=e3
password=e4
ret 1
;BEGIN DIALOG
;0 "" 0x90C80A46 0x100 0 0 205 73 "QM - user name and password"
;5 Static 0x54000000 0x0 4 10 48 12 "User name"
;3 Edit 0x54030080 0x200 56 10 142 14 ""
;6 Static 0x54000000 0x0 4 32 48 12 "Password"
;4 Edit 0x54030020 0x200 56 32 142 14 ""
;1 Button 0x54030001 0x4 56 58 48 14 "OK"
;2 Button 0x54030000 0x4 108 58 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2010801 "" ""
In macros, where you need input for user name and password, call this function like in the example.