PPL only for games?

Posted:
May 19, 2006 @ 2:19pm
by Joerg
Hi Kornalius,
I am programming a little "database" program, to store personal data as accounts, insurance numbers etc., using the standard Windows controls as forms, tab and text controls, labels (statics), control bar and menus, list boxes, but also the integrated encryption functionality (that's a nice thing!). I'm doing that using PPL, because I wanted to try out it. All is working fine. It needed some time more as usually, because I was new in PPL and API programming.
Therefore I'm sure, that PPL is usefull not only for games, but even to create Windows "standard" programs w/o the game API.
But because I have only little experiences relating API programming, I have still one problem, which about I already asked in this forum (three weeks ago), but unfortunately didn't get an answer till now:
ALL ELEMENTS OF THE WINDOWS ARE ONLY WHITE.
How can I change the background color of a form and of a control?
In the internet I found out, how it works in C, and I think, I understand the principle. But I didn't understand till now, how I access class members in PPL, resp. how I create at first a window class with the needed members; is there any template, predefined structure etc.? Or is this the wrong way?
I think, I understand right, that the intention of PPL is programming games at first.
But I think, that other programms, as the example above, are important too, or not?
So it would be very nice, and I would be very, very glad, if you could help me with any suggestion or example, which shows me the right way to a colored background...
Please help!
Best regards from Berlin (Germany)
Joerg.

Posted:
May 19, 2006 @ 6:41pm
by bmanske
Jeorg,
We are very close to the launch time for 1.0 of PPL, so I suspect that Kornalius is busy getting ready for that event.
In answer to your question. Your are correct in that the WinClass structure is not exposed, so you can't change the background that way. The magic of the WinClass structure is that you can define a bruch that will be used to erase the background by the default WinProc, so it just happens for you.
The default WinProc does this in response to a WM_ERASEBKGND message. This message gets sent a rectangle to draw because it has been invalidated. You could service the message yourself and return a non zero value after painting the background.
I may try this myself this weekend and post an example.
bmanske

Posted:
May 22, 2006 @ 9:53pm
by bmanske
Here is a link with an example of using the WM_CTLCOLOR messages
I will take a stab at getting the WM_EraseBKGND to work.
bmanske

Posted:
May 25, 2006 @ 1:23am
by kornalius
Thanks Brad.
Btw, there is a 64k limit in the editor.ppl. It's a Windows limitation of the standard Edit control. Do you think you can find a way to replace it by a RichEdit. I don't even know if it's possible on the PPC, just asking. Let me know how big of a job it will be too. I don't want you to start anything too big just before the release.