- fixed CustomDraw to work in 64bit Windows 8

- fixed exception for cross thread operation
- code clean-up
- other small fixes