Scan Registry es muy doloroso! Linares Help US

Scan Registry es muy doloroso! Linares Help US

Postby EduardoAlicante » Sat Jan 07, 2006 3:17 pm

For solve some problem with hardware configuration, i go to study fivewin and it's registry istruction.
Fivewin haven't istruction for solve this problem.
Harbour idem
xHarbour idem.
Only for a sample of the problem:
I get a list of installed printer:
I go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Printers
i get the subkey present on this item.
for every subkey i get some value for obtain a list of printer installed.
This is only a sample, there are many case for to get registry key and subkey.

Like a scan a DBF invoice file, i searc a key of file head, in file rows, i read all item with key of invoice, for calculate the total for samples.

I see how to in visual basic this is possible. And i have a program of scan a registry. But i work with Fivewin, and do no love make a program in too language for to work.

Fivewin + xharbour is very good, but some part are not complete.
How to?
:)
Eduardo Alicante
EduardoAlicante
 
Posts: 3
Joined: Sun Nov 06, 2005 1:09 am
Location: Puerto Nuevo

Postby reinaldocrespo » Sat Jan 07, 2006 4:08 pm

Eduardo;

I'm not totally sure what you are looking for. For the list of installed printers problem, try this function. Do notice that the function returns an array:

Function GetPrinters()
Local aPrinters := {}, cText, cToken := Chr(15)

// Passing no second param or passing ZERO to GetProfString()
// grabs entire section in .ini file. Each printer is separated by a
// null char (Chr(0)) and a CRLF. We just strip them out

cText := StrTran( StrTran( StrTran( ;
GetProfString( "Devices", 0 ), Chr(0), cToken ), Chr(13) ), Chr(10) )

aPrinters := Array( Len( cText ) - Len( StrTran( cText, cToken ) ) )

AEval( aPrinters, {| cPrn, nEle | aPrinters[ nEle ] := StrToken( cText, nEle, cToken ) } )

Return aPrinters

*-------------------------------------------------------------------------------------------------------------------------



Reinaldo Crespo
User avatar
reinaldocrespo
 
Posts: 979
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 79 guests