PDA

View Full Version : Windows API Thread (for Dummies)


plinydogg
10-05-2006, 12:12 AM
Hello everyone,

I've taken the suggestion of BManske and created this thread for those of us (hopefully I'm not alone) that are not familiar with the Windows API and the Windows architecture. I may be mistaken but I feel that without such knowledge using PPL will be very difficult.

I'll start out by pasting two comments, one by BManske and one by Kornalius, that were originally posted in another thread. Each addresses something basic about how Windows and/or the Windows API works.

From Kornalius:

"Each event, mouse down, up, move, key down, up, window resize, move etc... all have messages generated for them and passed to a procedure with hwnd, message, wparam, lparam. PPL goes over one level in simplicity eliminating the need to know what possible event can be triggered for each control type. You get a list of all possible events on the right side of the control in the properties tab. Click Events to display them. Then you choose which event you want to write code for. Now you need to know what parameters are being passed to this event. That is where you need to press CTRL+F1 by selecting the event in the list. The MSDN will tell you what is suppose to be passed in wParam$ and lParam$."

From BManske:

"You just need to get used to the idea that behind every action in the system is an event message. Windows sends messages to tell you about a user actions as Kornalius describes, but you also control windows with actions. You send a message to windows to put a checkbox on a menu for example.

Another key concept is that almost everything is a window. Scroll bars, edit boxes, buttons almost everything is a window and can be sent messages. For example in the editor, it received a message from windows that the user has pressed a button, then a message is sent from the handler that received the message to the edit window to load the text. You are not limited to sending and receiving from your own program, you can also work between other programs in the same manor.

There are huge numbers of messages in the system at almost every point of execution. The trick to making it managable is that windows has default actions for every message if you don't write any code for it."

Please, I beg you, anyone, ask some questions in this thread so that I dont' feel so alone :( Plus, today is my birthday so you should be nice :D

kornalius
10-05-2006, 12:48 AM
Happy Birthday! Here's something for your birthday.

Best source for tutorials on how to program the Windows API:
http://winprog.org/tutorial

Some other interesting articles:

Beginner's Guide to the Windows API:
http://www.apifinder.com/APIFinder/Article/28769

Reading C code in Win32 API:
http://delphi.about.com/od/windowsshellapi/l/aa101303a.htm

Creating an API GUI Windows program with message loop :
http://delphi.about.com/od/windowsshellapi/l/aa111503a.htm

Happy reading.

kornalius
10-05-2006, 12:51 AM
The PPL Tutorials page has been updated with a link to the fabulous WinProg.org site.

plinydogg
10-05-2006, 01:00 AM
Thanks for these Kornalius!

plinydogg
01-02-2007, 01:24 PM
Hi everyone! I've just recently had enough time again to start thinking about PPL and I've been looking over some of the documents mentioned above (and at least partially understanding some of them). Now, I've got a rather silly introductory question: does one really NEED to learn the Windows API to use PPL? If not, then why would one ever want to create a Windows API project instead of a regular old PPL project? How does the Windows API stuff and the "pure" PPL stuff interrelate? In other words, what would happen if you tried to post a message in a non-Windows API project?

Thanks and happy New Year everyone!

PointOfLight
01-02-2007, 02:57 PM
Between the swapi functions, the native PPL functions, and the various other wrappers (bluetooth, ADO, SQDB, etc.) that are being written, it is probably entirely possible to create a PPL program without using any "actual" Windows API. If you understand the API, however, then when you get in the situation where one of the various wrappers won't help, you'll be able to write the code without batting an eyelash :) By the way, happy birthday!

kornalius
01-02-2007, 05:16 PM
Now with the SWAPI functions and the Visual Form Builder with Event and Properties support, it is becoming a lot easier to write Windows applications without knowing much about the Windows API.

There will be more evolution in the upcoming releases of PPL concerning visual development.