June 25, 2024, 06:15:50 PM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Default Window Procedure

Started by Bruce Peaslee, October 16, 2015, 03:50:37 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Bruce Peaslee

In mucking about the internet, a lot of coding examples have something like this in their main window procedure:


select @MESSAGE
  case...
    ...
    return 0
  case...
    ...
    return 0
endselect

return DefWindowProc(...)


In IWB, I have never done that and things seem to work OK. Is this correct?

Thanks.
Bruce Peaslee
"Born too loose."
iTired (There's a nap for that.)
Well, I headed for Las Vegas
Only made it out to Needles

LarryMc

It's done in the background of the OPENWINDOW control for you.
That's why you don't have to handle messages like WM_PAINT and all those other windows messages all the time.

The same thing for CONTROL. That is nothing but another type of window and their is a DefControlProc
to handle the messages you don't handle.

The CONTROLX command gets down a little closer to the nitty-gritty.

But the bottom line it a bunch of all of that is hidden from you by IWBasic and that is one of the beauties of the language.

BTW those return 0 in most cases are telling the default procedure whether are not it should proceed or be skipped. Hince the return o at the end of the openwindow handler and the same handler being declared with
sub  handler(), int
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Bruce Peaslee

The language is beautiful. I had been thinking about taking a class in assembler for the PC (I took one for IBM mainframes ages ago). So I downloaded a popular one to get a jump on the competition.  8)

Assembly language itself was not difficult, IWB's coding structure is actually quite similar, but I could not get help for programming issues. It appears that assembly has passed out of favor and textbooks are hard to find. (The class I was considering hasn't listed anything yet.) There are forums with nice people, but when I got stuck, it was a day or so before the help arrived.

I eventually decided I was wasting my time, but I did want to explore something new, so I downloaded Microsoft's free Visual C++ system. Ouch! C++ is similar to Aurora, but the logic behind the casting of types all over the place eludes me. Much of the help - and there is lots of it - centers around Microsoft Foundation Classes or .NET, but these systems are far removed from what I already know.

To shorten this up a bit, just let me say that I have decided to come home. IWB is just so much easier. (I never did get an answer for how to change the color of a button, in either language, something that is trivial in IWB.)

Thanks to all who support this work.
Bruce Peaslee
"Born too loose."
iTired (There's a nap for that.)
Well, I headed for Las Vegas
Only made it out to Needles