IonicWind Software

IWBasic => GUI Central => Topic started by: Bruce Peaslee on December 31, 2008, 09:35:54 AM

Title: When to return TRUE from a handler
Post by: Bruce Peaslee on December 31, 2008, 09:35:54 AM
"A message handler must return an integer indicating whether or not any other handlers should be called.  0 means it is ok to call the default handler for the message, 1 indicates no other action should be performed.  Just return 0 for now as I will document the reasons for this in the final release."

I'm using 0 (zero), but when would I want to use 1?
Title: When to return TRUE from a handler
Post by: Ionic Wind Support Team on December 31, 2008, 11:12:25 AM
When you don't want the default windows handler to do anything after you processed the message.

For example, you have a 'Quit' menuitem and during processing you close the window and delete the dynamically created window UDT.  Return TRUE or you'll get an exception as Windows will attempt to send another menu message.

During processing of WM_INITDIALOG the MS docs say to return TRUE if you set focus to a control. 

It depends on the message.

Paul.
Title: Re: When to return TRUE from a handler
Post by: Ionic Wind Support Team on December 31, 2008, 11:26:43 AM
Topic split and moved here as it was a more appropriate forum.