h6. [[WindowManager]] h6(. » [[WindowManager SWI Calls|SWI Calls]] h6((. » Wimp_Initialise h2. Wimp_Initialise h5. (SWI &400C0) |_<. Entry | | |<^. R0 |Last known Wimp version x 100 | |<^. R1 |"TASK" (&4B534154) | |<^. R2 |Pointer to description string to display in Task Manager | |<^. R3 |Pointer to list of acceptable [[Message Codes|User Messages]] | |_<. Exit | | |<^. R0 |Current Wimp version x 100 | |<^. R1 |Task handle| h4. Use The purpose of this call is to register a task with the Wimp. h4. Notes This call should only be used once when starting up. And before a task closes, it should call [[Wimp_CloseDown|Wimp_CloseDown]]. The input R0 value should indicate the version of the Wimp that your application was developed for. The Wimp will use this information to adjust its behaviour, so that your program can still run as intended when running under a newer Wimp. The interpretation of R3 depends on the input R0 value (and ultimately, on whether the current Wimp version is >= R0): * If R0 is less than 300, or the Wimp version is less than 300, R3 is ignored, and all user messages will be delivered to the task * If R0 is greater than or equal to 300, R3 is treated as a pointer to a zero-termiantd list of user message codes. Only the user messages given in this list will be delivered to the task, resulting in a more responsive system when faced with e.g. applications which regularly send broadcast messages. ** Take care not to include [[Message_Quit]] in the list, as its value of zero will get mistaken for the list terminator. The Wimp will always deliver Message_Quit to tasks, regardless of any message filter which they have set up. ** Behaviour of empty lists and null pointers differs depending on Wimp version: *** If the Wimp version is before 310, an empty list is treated as "no messages are important" (other than Quit) *** If the Wimp version is 310 or later, an empty list is treated as "all messages are important". A null pointer is treated as "no messages are important" (other than Quit). The task can add or delete messages that it can respond to by [[Wimp_AddMessages|Wimp_AddMessages]] and [[Wimp_RemoveMessages|Wimp_RemoveMessages]]. h4. See also * [[Message Codes|User Messages]] * [[Wimp_AddMessages|Wimp_AddMessages]] * [[Wimp_CloseDown|Wimp_CloseDown]] * [[Wimp_Poll|Wimp_Poll]] * [[Wimp_RemoveMessages|Wimp_RemoveMessages]]