Fix type of default passed to WaitWithMessageLoop
Added two new helper methods: SendMessageToForm() and ValidHandleValue()