break on ; GUI password prompt ; By Bryce with lots-o-help from the gang at kixtart.org! ; ; This script will only work on NT4.0 and Windows 2000. You also ; must have IE4.0 or greater installed. Best way to execute is as ; a call from a main kix script, it will return with the variable ; $password, if cancle was clicked $password will = "" ;---------------------------------------------------------------- If @inwin = 2 ? "This script will not Run on a win9x system." exit endif DIM $top DIM $left DIM $height DIM Width DIM $False DIM $true DIM $title DIM $status DIM $Password1 DIM $password2 DIM $doc DIM $nul DIM $html GLOBAL $password $password = "" $title = "Password Prompt" $top = "100" $left = "200" $height = "165" $width = "275" $false = 0 $true = -1 Gosub HTML Gosub IE ; Get the valueof the status control ... $Status = olegetproperty (val("&" + olecallfunc($doc,"GetElementById","s","status")), "value" ) ; Main Command Loop while @error = 0 and $status <> "" ; ? $status select case $status = "1" ; Submit was clicked $password1 = olegetproperty(val("&" + olecallfunc($doc, "GetElementById","s","password1")), "value") $password2 = olegetproperty(val("&" + olecallfunc($doc, "GetElementById","s","password2")), "value") Select case $password1 <> $password2 $nul = Messagebox("Passwords do not match", "ERROR",4144) $nul = oleputproperty(val("&" + olecallfunc($doc,"GetElementById","s","password1")),"value","s","") $nul = oleputproperty(val("&" + olecallfunc($doc,"GetElementById","s","password2")),"value","s","") case $password1 = "" or $password2 = "" $nul = Messagebox("Blank passwords are not allowed", "ERROR",4144) $nul = oleputproperty(val("&" + olecallfunc($doc,"GetElementById","s","password1")),"value","s","") $nul = oleputproperty(val("&" + olecallfunc($doc,"GetElementById","s","password2")),"value","s","") case $password1 = $password2 $password = $password1 gosub finish exit endselect ; Reset the status value to zero ... $nul = oleputproperty(val("&" + olecallfunc($doc,"GetElementById","s","status")),"value","s","0") case $status = "2" ;Cancle was clicked. gosub Finish exit endselect ; Get the valueof the status control ... $Status = olegetproperty (val("&" + olecallfunc($doc,"GetElementById","s","status")), "value" ) loop gosub Finish Exit ;--------------------------------------------------------------------------------------------------- :IE $ie = olecreateobject("internetexplorer.application") if $ie = 0 exit endif ; Set properties and display form ... $nul = oleputproperty($ie, "addressbar","s","$false") $nul = oleputproperty($ie, "menubar", "s", "$false") $nul = oleputproperty($ie, "toolbar", "s", "$false") $nul = oleputproperty($ie, "statusbar", "s", "$false") $nul = oleputproperty($ie, "resizable", "s", "$false") $nul = oleputproperty($ie, "top", "s", "$top") $nul = oleputproperty($ie, "left", "s", "$left") $nul = oleputproperty($ie, "height", "s", "$height") $nul = oleputproperty($ie, "width", "s", "$width") $nul = oleputproperty($ie, "visible", "s", "$true") $nul = olecallfunc($ie, "navigate", "s", "about:blank") while olegetproperty($ie, "busy") <> "0" and @error = 0 loop ; Get a handle to the open document ... $doc = val("&" + olegetproperty($ie, "document")) $nul = olecallfunc($doc, "write", "s", "$html") while setfocus("$title") <> 0 loop return ;--------------------------------------------------------------------------------------------------- :HTML $html = '