;** PDOX_INI *******************************************************************
;* Teclas de Atalho                                                            *
;*******************************************************************************
;Autor           : Vise Informatica (VISERP)
;Desenvolvido    : 04/02/2016 por Brunpo Carvalho                     
;Ultima Alteracao:   /  /     por                          
;Motivo Alteracao:            

;*******************************************************************************
;* ROTINA Servidor                                                             *
;*******************************************************************************
Proc IDServer()
Private ii, IDDRIVE

SYS_VERSAO_SO="Windows"

IDDRIVE=Upper(SubSTr(Directory(),1,2))
tmpserver="??"

For ii From 1 To 2

  Deleta_Arquivo(PrivDir()+"net.Txt")
  Switch
    Case ii=1:
         Executa_Programa("Subst >"+PrivDir()+"Net.Txt")
    Case ii=2 And SYS_VERSAO_SO="Windows":
         If IsFile("C:\\Windows\\Net.exe") Or  ;; Verificar se Micro esta em Rede, erro no camando net use ???
            IsFile("C:\\Windows\\System32\\Net.exe")
            Then Executa_Programa("net use >"+PrivDir()+"Net.Txt")
            Else QuitLoop
         EndIf
  EndSwitch

  For c From 1 to 4
    If Not IsFile(PrivDir()+"Net.txt")
       Then Sleep 1000
            Loop
       Else Editor Open PrivDir()+"Net.Txt"
            If ErrorCode()=27
               Then Sleep 1000
                    Loop
            EndIf

            {Edit} {Goto} {1}
            Editor Find IDDRIVE
            If RetVal
               Then Extrair_Linha()
                    Switch
                      Case ii=1:
                           posini2=search("=>",ELinha)
                           tmpserver=RTrim(SubStr(ELinha,posini2+3,80))
                           tmpserver=SubStr(tmpserver,1,Len(tmpserver)-1)
                      Case ii=2:
                           posini2=search("\\",ELinha)
                           Switch
                             Case search("Netware Services",ELinha)>0: tmpserver=RTrim(SubStr(ELinha,posini2,26))
                             Case search("Rede Microsoft",ELinha)>0  : tmpserver=RTrim(SubStr(ELinha,posini2,26))
                             Otherwise                               : tmpserver=RTrim(SubStr(ELinha,posini2,35))
                           EndSwitch
                    EndSwitch
                    CancelEdit
                    Return
            EndIf
            CancelEdit
            QuitLoop
    EndIf
  EndFor

EndFor

EndProc
;*******************************************************************************
;* Rotina Principal                                                            *
;*******************************************************************************
AutoLib="\\Sistemas\\Cadastro\\Bibliot,\\Sistemas\\Cadastro\\Bib_Show"
LimpAguarde()

;{ˇ} {Interface} {Yes}
;{ˇ} {Video} {K: Paradise EGA 480/VGA 1024} {A: Paradise EGA/VGA: 132x25}
;{ˇ} {Video} {K: Paradise EGA 480/VGA 1024} {B: Paradise EGA/VGA: 132x43}
;{ˇ} {Video} {M: STB PowerGraph VGA} {A: STB VGA: 132x25}
;{ˇ} {Interface} {Yes}

PassWord "t01avivcl"
PassWord "s01avclvi"

SetKey   6 Play "c:\\vise\\pdox45\\Teclas\\CTRLF"
SetKey   3 Play "c:\\vise\\pdox45\\Teclas\\CTRLC"
SetKey  22 Play "c:\\vise\\pdox45\\Teclas\\CTRLV"
SetKey  19 Play "c:\\vise\\pdox45\\Teclas\\CTRLS"
SetKey  20 Play "c:\\vise\\pdox45\\Teclas\\CTRLT"

SetKey -50 Play "c:\\vise\\pdox45\\Teclas\\ALTM"
SetKey -19 Play "c:\\vise\\pdox45\\Teclas\\ALTR"

SetKey -18 Play "c:\\vise\\pdox45\\Teclas\\ALTE"
SetKey -20 Play "c:\\vise\\pdox45\\Teclas\\ALTT"

SetKey -46 Play "c:\\vise\\pdox45\\Teclas\\ALTC"
SetKey -31 Play "c:\\vise\\pdox45\\Teclas\\ALTS"

SetKey   2 Play "c:\\vise\\pdox45\\Teclas\\CTRLB"
SetKey  10 Play "c:\\vise\\pdox45\\Teclas\\CTRLJ"
SetKey -23 Play "c:\\vise\\pdox45\\Teclas\\ALTI"
SetKey -21 Play "c:\\vise\\pdox45\\Teclas\\ALTY"
SetKey -17 Play "c:\\vise\\pdox45\\Teclas\\ALTW"
SetKey -103 Play "c:\\vise\\pdox45\\Teclas\\CTRLF10"

;SetKey -49 {ˇ} {Interface} {Yes} {ˇ} {Video} {C: EGA/VGA: 80x25} {ˇ} {Interface} {Yes}
;SetKey -50 {ˇ} {Interface} {Yes} {ˇ} {Video} {K: Paradise EGA 480/VGA 1024} {B: Paradise EGA/VGA: 132x43} {ˇ} {Interface} {Yes}
;SetKey -50 {ˇ} {Interface} {Yes} {ˇ} {Video} {M: STB PowerGraph VGA} {A: STB VGA: 132x25}  {ˇ} {Interface} {Yes}

DynArray ConfigArray[]
SysInfo Config To ConfigArray

{Tools} {Net} {AutoRefresh}
TmpRefresh=MenuChoice()
Esc Esc Esc

{Tools} {Net} {Changes}
TmpChanges=MenuChoice()
Esc Esc Esc

IdServer()

Sound 500 200

Window create @ 07,02 height 8 width 75 to winini

@ 02,01 ?? "Control: PN["+ConfigArray["NETDIR"]+"] SD["+Upper(SubSTr(Directory(),1,3))+"] TN["+Completa(NetType(),6," ")+"]"+
            "   Refresh: "+TmpRefresh+" Segundo(s)  ["+TmpChanges+"]"
@ 03,01 ?? " Server: "+Upper(TmpServer)
@ 04,01 ?? "PrivDir: "+Upper(PrivDir())


@ 00,00 ?? Format("W75,AC","Vise Inform tica") 
PaintCanvas Attribute 31 00,00,00,75 ; Vise Informatica

ClearAll
Release Procs All
Release Vars All
