02-13-2007 08:27 AM
02-13-2007 03:57 PM
@mrbean wrote:
I want to use UIMsg_UserMessageBase to create some custom user messages to use in my PostUIMessage_Ex calls. Is there a preferred way/location to define custom messages or do we just use UIMsg_UserMessageBase + 0, +1, +2, etc? Then, looking ahead to the case that handles the different messages, is there a way to have mneomonics instead of 10000, 10001, 10002?
I don't think there is a way to add custom user messages that would be populated in the drop-down when posting a UI messages. The ones that are already there are probably built in to the PostUIMessageEx method. That doesn't mean you can't enter your own variable that has the desired value. It could be a list in the local or global variables. The values could be the exact value (ex. Message1 = 10000, Message2 = 10001) or the offset and add it to the base.
Since this is custom you will have to create any mneomonics, like a custom enum.
One other thing you might consider is to be creative with the other parameters that you pass. For example, you could make "sub messages" out of one custom UIMsg_UserMessage. This could be accomplished by using UIMsg_UserMessageBase + 1 for the event code and use the string data to determine sub messages