OpenLibrary(1,"shlwapi.dll")
*F1 = IsFunction(1, "IsOS") ???
...
CloseLibrary(1)

So, MS has written a function that only works on Win2k and above, that can tell you if the program is running on Win95,98,Me etc ! :roll:Minimum operating systems Windows 2000, Windows 2000 Server, Windows Server 2003, Windows XP

In the help file, OSVersion() ...bingo wrote:http://msdn.microsoft.com/library/defau ... s/isos.asp
OpenLibrary(1,"shlwapi.dll")
*F1 = IsFunction(1, "IsOS") ???![]()
...
CloseLibrary(1)

I don't know what version of PureBasic you are using but you don't needbingo wrote:is the same problem ...
http://msdn.microsoft.com/library/defau ... nicode.asp
LPWSTR WINAPI SHLWAPI_215 (
LPWSTR lpStrSrc,
LPVOID lpwStrDest,
int len)
...
how call this winapi "SHLWAPI_215" ?
Code: Select all
Procedure.s IsOS()
IsOS.s = ""
Select OSVersion()
Case #PB_OS_Windows_NT3_51
IsOS = "Windows NT 3.51"
Case #PB_OS_Windows_NT_4
IsOS = "Windows NT 4"
Case #PB_OS_Windows_2000
IsOS = "Windows 2000"
Case #PB_OS_Windows_XP
IsOS = "Windows XP"
Case #PB_OS_Windows_95
IsOS = "Windows 95"
Case #PB_OS_Windows_98
IsOS = "Windows 98"
Case #PB_OS_Windows_ME
IsOS = "Windows ME"
Default
IsOS = "0"
EndSelect
ProcedureReturn IsOS
EndProcedure
Debug IsOS()
End
Code: Select all
If OpenLibrary(0,"shlwapi.dll")
AnsiString.s="PB Kicks Ass"
BufferLen.l=2*Len(AnsiString)
UnicodeBuffer=AllocateMemory(0,BufferLen)
If UnicodeBuffer
result.l=CallFunction(0,"SHAnsiToUnicode",@AnsiString,@UnicodeBuffer,BufferLen)
Endif
Endif