Sver
Full Member
Posts: 145
|
Post by Sver on Apr 24, 2018 12:24:18 GMT -5
When I search for Computername in kernel32.dll , I'll find GetComputerNameA
In LB example, they use COMPUTERNAME How can i find the right one for other things?
Thanks
|
|
|
Post by Alyce Watson on Apr 24, 2018 13:07:04 GMT -5
Where is the LB example? If the API function is GetComputerNameA, that is what we'd use. Can you point to the example so we can see the details?
|
|
Sver
Full Member
Posts: 145
|
Post by Sver on Apr 25, 2018 0:23:06 GMT -5
name$="COMPUTERNAME" print GetEnvVar$(name$) wait
function GetEnvVar$(name$) lbuf$ = space$(255) + chr$(0) name$ = name$ + chr$(0) calldll #kernel32, "GetEnvironmentVariableA",_ name$ as ptr, _ lbuf$ as ptr, _ 256 as long, _ result as long if result = 0 then GetEnvVar$ = "Environment Variable Not Found" else GetEnvVar$ = left$(lbuf$,result) end if
end function
It works, but as a beginner i aspect to use GetComputerNameA. I did found this code, but how to get it with GetComputerNameA ? GetEnvironmentVariableA contains more info, but where can i find it?
|
|
|
Post by Alyce Watson on Apr 25, 2018 6:15:28 GMT -5
LBPE API pageABCs of APIs Lesson OneYou appear to be new to making API calls. Start with the ABCs of APIs series above. You first need to understand the mechanics of using calldll in Liberty BASIC. It's the most complex subject for programming in LB and you'll need to put some time into understanding it. API functions are not part of Liberty BASIC. LB makes it possible to USE these functions, but they are part of Windows itself, or part of third party libraries, so the documentation can be found with the third party library or on the Microsoft Developers Network, "MSDN." MSDN
|
|