Page 1 of 1
Add API Functions
Posted: Sat Jul 13, 2013 2:15 am
by Blankname
I am in need of these API functions support in PB.
Code: Select all
http://msdn.microsoft.com/en-us/library/windows/desktop/ms684894(v=vs.85).aspx
Can they be added in 5.20? Thanks
Re: Add API Functions
Posted: Sat Jul 13, 2013 8:20 am
by PB
MSDN wrote:Minimum supported client: Windows XP [desktop apps only]
Since PureBasic supports all the way back to Win 95, these won't be added.
Fred has stated in the past that only APIs made for
all Windows get included.
That said, you CAN always call them manually yourself, assuming the relevant
DLLs (or needed files) are installed on the client machine. It's as easy as this:
Code: Select all
; Pseudo-code; not a working example!
If OpenLibrary(0,"psapi.dll") And GetFunction(0,"EmptyWorkingSet")
result=CallFunction(0,"EmptyWorkingSet",arg1$,arg2$)
CloseLibrary(0)
EndIf
Re: Add API Functions
Posted: Sat Jul 13, 2013 9:30 am
by c4s
PB wrote:Since PureBasic supports all the way back to Win 95 [...]
Just as a small side note: If I recall correctly, support for Win95 has been dropped with PB5.10.
Re: Add API Functions
Posted: Sat Jul 13, 2013 9:45 am
by Blankname
PB wrote:MSDN wrote:Minimum supported client: Windows XP [desktop apps only]
Since PureBasic supports all the way back to Win 95, these won't be added.
Fred has stated in the past that only APIs made for
all Windows get included.
That said, you CAN always call them manually yourself, assuming the relevant
DLLs (or needed files) are installed on the client machine. It's as easy as this:
Code: Select all
; Pseudo-code; not a working example!
If OpenLibrary(0,"psapi.dll") And GetFunction(0,"EmptyWorkingSet")
result=CallFunction(0,"EmptyWorkingSet",arg1$,arg2$)
CloseLibrary(0)
EndIf
In my opinion anything older than Windows XP should be dropped, including the DirectX 7 subsystem. There is less than 0.01% of people who use Windows older than XP worldwide. If PureBasic is going to progress and become a popular language, it will eventually need to drop older versions of Windows anyways. Windows 95, Windows 98, Windows ME, and Windows 2000 all should be dropped from support. That alone would free up a lot of code, and take a load off the development team. I know its there and they haven't had any issues with it, but that's because no one uses it. Current support could be left in, but why waste the resources if it's not going to be used. Especially when older versions of PureBasic will always support older versions of Windows. It would be a right move by Fred in taking the PureBasic language forward. The more Windows XP to Windows 8 support there is, the more useful and popular the language will become. Or just leave it as it is and add in the PSAPI functions, then add a little note to the documentation "only supported on Windows XP and later". That is peaceful compromise as you seem to be bothered by PureBasic improving.
P.S.
PSAPI functions are included in all Windows...
...that people actually use.
Re: Add API Functions
Posted: Sat Jul 13, 2013 10:23 am
by c4s
Blankname wrote:In my opinion anything older than Windows XP should be dropped, including the DirectX 7 subsystem. [...]
c4s wrote:Just as a small side note: If I recall correctly, support for Win95 has been dropped with PB5.10.
I guess DirectX7 too:
Re: Add API Functions
Posted: Sat Jul 13, 2013 4:22 pm
by PB
> support for Win95 has been dropped with PB5.10
Where does it say that? Dropping DX7 is a different issue.
Re: Add API Functions
Posted: Sat Jul 13, 2013 8:32 pm
by c4s
PB wrote:> support for Win95 has been dropped with PB5.10
Where does it say that?
Sorry, I confused NT4 with Win95.
Anyway, it's obvious that support for such an old system should be dropped very soon in favor of updated API support.
What about making XP the low end on Windows? Even XP is so old that extended support from Microsoft will stop next year...
Re: Add API Functions
Posted: Sat Jul 13, 2013 9:12 pm
by Danilo
c4s wrote:Anyway, it's obvious that support for such an old system should be dropped very soon in favor of updated API support.
You can provide the newest import libraries, even with Win8 functions. As long as you don't use these
functions, they get not linked to your .EXE and you are still able to write Win95 programs.
It is a little bit more complicated with some structures, because some structures have additional fields
on newer version of Windows. PB's "resident" files do not support a switch like WINVER yet, so the PB team
wants to provide the most compatible (Win95) structures.