SetGadget* sends an event?
SetGadget* sends an event?
I would like to know if it's normal that a SetGadget call (SetGadgetState, SetGadgetItemText, etc...) produces an event to the interested gadget. I mean after SetGadget is called, I get an event for the gadget has been set. Since I use this in a program of mine, I wanted to be sure it isn't a bug or something will change in future. Thanks.
I just saw this last night and was getting ready to ask this myself. I don't think it should send an event either (IMHO!)...
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
To send or not to send, this is the question. Well.. if it's involved Windows itself (something with SendMessage API, I guess) it should stay. Another important thing to know if people does use such feature or not, as it could be annoying to break compatibility. I don't know if that would be possible, what about a compiler option or a command to switch it?
Though it can be useful to write smarter code. For example I have a button gadget that opens a path requester. After the choice, I set a string gadget with the returned path (so the user can always sees it). When I set the string gadget, the string gadget receives an event so I make things happen then. And if the user changes the path manually (that is editing the string gadget) the same event is generated, so I use the same code.
If the event trapping routine is a callback, some kind of recursive function could also be used, etc...
Though it can be useful to write smarter code. For example I have a button gadget that opens a path requester. After the choice, I set a string gadget with the returned path (so the user can always sees it). When I set the string gadget, the string gadget receives an event so I make things happen then. And if the user changes the path manually (that is editing the string gadget) the same event is generated, so I use the same code.
If the event trapping routine is a callback, some kind of recursive function could also be used, etc...


