|
|
|
|
|
Events are mostly a result of something you do. You click the mouse on a button, for example, or you press the key in a dialog box. You are not the only source of events, however. Windows also causes events such as a timer event that occurs each time Windows internal clock ticks. The Web browser creates events, too, such as an event that occurs each time it loads a Web page. Events in Windows generate messages. Messages in Windows tell the applications and the operating system what to do and what is going on. Along with message, Windows sends any data that the object needs to better understand the message such as the mouse's position when you clicked a window. The object's message loop transforms that message to the bit of code that handles the message. Objects which can receive these messages include windows, dialog boxes, buttons, images and so on.
An object doesn't always know how to handle every message, either. A window may not understand what to do with a message telling it that the user is moving it. In these cases, the object gives the message back to Windows and tells it to handle the message. Windows doesn't do events itself. It does messages. The objects cause events in response to something you do to it. In VBScript, a button object causes a click event when it receives a mouse click message from Windows. Likewise, an edit box causes a change event when it receives keyboard messages from Windows that change the contents of the field. Go To Page: 1 2 |
|
|
|