Forum > Windows

Windows API test programs / Examples

(1/12) > >>


During years of programming, I've accumulated a fairly large number of programs whose purpose is to test the operation of specific Windows APIs.  All of the programs are pure Windows API, that is, no objects/classes and independent of Delphi/Lazarus.  IOW, programs along the lines of what is presented in Petzold's Programming the Windows API but, in Pascal.

The great majority of the programs, likely around 95% are very simple, even trivial, programs meant to show how to correctly build the API call and to occasionally be used as the foundation for further tests (such as performance.)   About 5% of the programs are more sophisticated and, are not API specific but goal/technique specific instead.  Such as, how to avoid/eliminate flicker using various methods, implementing the functionality of undocumented APIs using documented APIs and many other unrelated purposes that are often useful in one way or another.

Through the years, I have accumulated about 700+ such (Pascal) programs.  _Important note_ : these programs are _not_ programming examples, they are API _test_/example programs.  This means that almost all of them use global variables and other ways of getting things done that are fine in throw away code but, would be questionable and, sometimes even unacceptable, in production quality code.

I am offering these test programs mostly as a way to learn the Windows API.  A few, very few (maybe 5%), can be used as programming Windows examples (IOW, the programming is halfway decent.)

The point of this post is two fold:

First, find out if the community is interested in these API test programs.

If there is interest then, I'd post _about_ 5 of them on a daily basis.  One short post per API test program and, proceed from simplest (usually downright trivial) to more complex as the number of post increases with a few exceptions along the way to keep things interesting.

Second if there is interest then I'd like the moderators to confirm that my creating about 5 individual posts every day is acceptable (possibly fewer on some days but never larger.)

If there is interest and approval from the moderators, I'd start about a week from today, this to give me a little time to organize the programs.

All feedback welcome,

Thank you.

Your Windows API test programs sound really useful, but it may be better to put them up on your favourite repository (Sourceforge, Github, GitLab etc) and add a link in the forum and the Wiki.

Thank you Trev.

I am usually not fond of sharing my code, for that reason, sourceforge, github, etc, are not appealing avenues to me. 

That said, I thought that if FPC forum members were interested then I would share it here and, since this is s forum, answer any questions that may arise.  Given that all programs are pure API, I didn't expect much interest but, I figured just in case, I'd offer.

However, I appreciate your suggestion, which admittedly is probably the "natural" solution. 

May I make a suggestion, maybe towards a middle ground.

Since you want to post an article with the sources, yes that can be done on the forum.
I would suggest the "Programming / os / win" board. Or 3rd party announce.

However, it probably be best to collect several posts into one thread. If you had a 100 samples (no idea how many you have) grouping an average of 5 per day would still be 20 topics. But IMHO ok (well to much for the announcment board). If you have 1000 then maybe grouping several days....

The announcement board should be shared fairly. Max 2 or 3 threads per user per month. But as many posts as you like, inside those threads.

In the programming/os/win, I think it is ok. I would suggest that if several daily topics do not attract lots of answers, then they could be merged by an admin to become one thread.

About a repro to share source, I am not sure if by "not appealing" you mean
- you do not want the sources to end up there.
- you do not want to go into the trouble to put them there.

If the latter, then maybe someone  can volunteer to upload them in groups of 5 a day?

Also, it may be easier than you think. Github allows you to upload via web interface.
- Get an account
- Create a repro
- Go to upload files
- drag and drop each folder that you want to upload (that way the folder is created in the repro)
- add a commit message
- commit

Having the sources avail on a repro would also, if interest is big, make it easier to collect info on the wiki. (again could be done by a volunteer, if alright with you, and someone wants to do that)

Thank you Martin.

The programming / os / win does sound like it would be the best suited forum.  I estimate that I have somewhere between 700 and 800 examples/test programs.

The reason I thought about doing one post per API was to make it easy to find.  I would title each post along the lines of "Win API example - api name" which I believe would make it easy to find using the forum's search engine.  Combining multiple APIs into one post could make finding the example for a specific API more difficult for the interested party.

I don't find the repositories attractive because they are very static.  The great advantage of the forum is that they are interactive, every one can participate either with questions, suggestions and/or improvements. 

The above is just to show where I'm coming from.  I appreciate your suggestions.

So far, the level of interest does not seem to be high enough to even merit concern on how to go about it.


[0] Message Index

[#] Next page

Go to full version