yasmin Posted November 17, 2006 Report Share Posted November 17, 2006 Bom dia pessoal, este comando me retorna o caminho da impressora que esta na rede tipo "\\maq_3\epson\lpt1", pois como uso FW192 eu não tenho esta funcão, caso não funcione na versão do fivewin que uso, qual funcao poderia substitui-la. Marcelo FW 1.92,Clipper 5.2D,WS Quote Link to comment Share on other sites More sharing options...
yasmin Posted November 17, 2006 Author Report Share Posted November 17, 2006 Bom dia pessoal, este comando me retorna o caminho da impressora que esta na rede tipo "\\maq_3\epson\lpt1", pois como uso FW192 eu não tenho esta funcão, caso não funcione na versão do fivewin que uso, qual funcao poderia substitui-la. Marcelo FW 1.92,Clipper 5.2D,WS Quote Link to comment Share on other sites More sharing options...
aferra Posted November 17, 2006 Report Share Posted November 17, 2006 eu uso esta, veja se te serve. 1) declaro uma variavel para saber qual o sistema operacional utilizaando o SystemInfo. PUBLIC nSistema:=LEFT(oSystemInfo:WinVer(),12) 2) esta é a função que lê dentro do regedit que impressora está ou não instalada... FUNCTION aPrinters() LOCAL aPrinters:= {},oReg LOCAL oKey,cBuffer:="",nId:=0,cName IF LEFT(nSistema,10)=="Windows XP" .OR. LEFT(nSistema,12)=="Windows 2000" oReg:=TReg32():New(HKEY_CURRENT_USER,"Software\Microsoft\Windows NT\CurrentVersion\Windows") cName:=LEFT(oReg:Get("Device"),AT(",",oReg:Get("Device"))-1) oReg:Close() oReg:=TReg32():New(HKEY_LOCAL_MACHINE,"System\CurrentControlSet\Control\Print\Printers") while RegEnumKeys(oReg:nHandle,nId++,@cBuffer )==0 oKey:=TReg32():New(HKEY_LOCAL_MACHINE,"System\CurrentControlSet\Control\Print\Printers\"+cBuffer) aAdd(aPrinters,{oKey:Get("Name"),oKey:Get("Port"),cName==oKey:Get("Name")}) oKey:Close() END oReg:Close() FOR i:=1 TO LEN(aPrinters) IF aPrinters[i,3] cPorta:=aPrinters[i,2] cName:=aPrinters[i,1] ; EXIT END NEXT ELSE oReg:=TReg32():New(HKEY_LOCAL_MACHINE,"Config\0001\System\CurrentControlSet\Control\Print\Printers") cName:=ALLTRIM(oReg:Get("Default")) oReg:Close() oReg:=TReg32():New(HKEY_LOCAL_MACHINE,"System\CurrentControlSet\Control\Print\Printers") while RegEnumKeys(oReg:nHandle,nId++,@cBuffer )==0 oKey:=TReg32():New(HKEY_LOCAL_MACHINE,"System\CurrentControlSet\Control\Print\Printers\"+cBuffer) aAdd(aPrinters,{oKey:Get("Name"),oKey:Get("Port"),cName==oKey:Get("Name")}) oKey:Close() END oReg:Close() FOR i:=1 TO LEN(aPrinters) IF aPrinters[i,3] cPorta:=aPrinters[i,2] cName:=aPrinters[i,1] ; EXIT END NEXT END IF(EMPTY(cName),cName:="Sem Impressora",) RETURN(cName) espero que ajude... Um Grande Abraço Alessandro F. Silvaid=blue> E-mail :aferracini@terra.com.br FW2.0d + CL53b + Blinker 7.0 + @Say @Get + CDX MSN: ferracini_silva@hotmail.com Ribeirão Preto/SP Quote Link to comment Share on other sites More sharing options...
yasmin Posted November 17, 2006 Author Report Share Posted November 17, 2006 Ola Alessando obrigado por me ajudar, so que não esta dando certo porque eu não tenho o TREG32() e REGENVMKEY() Marcelo FW 1.92,Clipper 5.2D,WS Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.