April 23, 2024, 05:45:27 AM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


GetComputerName implementation

Started by Haim, February 09, 2008, 02:15:32 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Haim

Hi,
Can anyone show me how to implement the GetComputerName Windows API in Aurora?

Thanks,

Haim

pistol350

Hi Haim!

I've found this Ebasic routine from the program "Artificial inteligence" by Piet Defoe

'********************  Find Computer name skanked from help 
Sub FindComputerName 
Def pSize:Pointer 
Def nSize:Int 
Declare "Kernel32",GetComputerNameA(buffer:String,size:Pointer),Int 
nSize = 255 
pSize = nSize 
GetComputerNameA(ComputerNameB,pSize) 
ComputerName = LCase$( ComputerNameB )   
return
endsub


Hope this can help.
Regards,

Peter B.

Haim