The following are the two functions that I ended up working with. They don't just return one key.
Your mileage may vary! :D
Code:
function WriteINIStruct(SectionName$,KeyName$,inifile$)
' Returns true (1) if nothing wrong or false (0) if a problem
'code by Richard Russell
size = len(theStruct.struct)
calldll #kernel32, "WritePrivateProfileStructA", _
SectionName$ as ptr, _ ' Section name
KeyName$ as ptr, _ ' Key name
theStruct as struct, _ ' Structure
size as ulong, _ ' Size of structure
inifile$ as ptr, ret as long
WriteINItheStruct = ret
end function
function GetINIStruct(SectionName$,KeyName$,inifile$)
' Returns true (1) if nothing wrong or false (0) if a problem
'code by Richard Russell
size = len(theStruct.struct)
calldll #kernel32, "GetPrivateProfileStructA", _
SectionName$ as ptr, _ ' Section name
KeyName$ as ptr, _ ' Key name
theStruct as struct, _ ' Structure
size as ulong, _ ' Size of structure
inifile$ as ptr, ret as long
GetINIStruct = ret
end function