WinDeclare300x198Xojo Windows Declare Version 2.7 has just been finished with more examples, more constants, more data, more explanations, updates from ANSI to Unicode, all Windows 10 compatible, both 32-bit and 64-bit compatible, and updated to Xojo 2018 r2. Version 1.x of the Declares book has been impressive and has had many updates for programmers. With the release of Xojo 64-bit debugger coming soon, the declares also needed updating. 

Xojo provides a RAD (Rapid Application Development) environment because it protects the user from the Operating System. Xojo has many helpful functions, and declares add to this existing toolbox.

Tapping into the Operating System directly with Declares opens up almost all of the options available for a program - but you are also out of the protection of the safe IDE (Integrated Development Environment) of Xojo. With the ability to change anything with the program or operating system, improper code also provides the ability of a crash. This is written for intermediate and advanced programmers of Xojo.

Thanks to Julian Samphire for work on the 64-bit version of the ChooseColor example and for his comprehensive list of Xojo Data Type Conversions

All examples have been converted to both 32-bit and 64-bit versions.This book is Version 2.7 (October 2018).

 

This book provides many examples that are converted from C++ functions to Xojo. Although there are many Visual Basic examples that can be converted, vb declare example are becoming outdated, have different parameters, or contain misinformation. For these reasons converting from C++ to Xojo is a long-lasting alternative and which this book provides many descriptions, reasons, references, and working examples for Xojo declares.
There are 24 chapters and contains over 650 pages with over 100 example programs.


Examples include creating controls, a new window, GDI, Pens, brushes, Structures, Files, LoWord, Audio, play video, and much more. Many screenshots have been added to show the results of the code with an index to help find topics quickly.

 

Screen grab of the ChooseColor Dialogue Box example 15-1:

ChooseColor Screen Grab

 

 

 

 

 

 

 

 

 

 

 

 

 

Added content to Version 2.0 and 2.1 (June 2017) are:

  1. Added String values for Example 5-3
  2. Added Set application and windows icon: Example 6-11 – 32 and 64 bit compatible
  3. Added WS_OVERLAPPEDWINDOW constant on Page 173
  4. Added WS_TILEDWINDOW constant on Page 173
  5. Added WS_EX_PALETTEWINDOW constant on Page 172
  6. Added WS_EX_OVERLAPPEDWINDOW Constant on Page 172
  7. Added WM_REDRAW example to quickly update a listbox control (Example 10-4) – 32 and 64 bit compatible
  8. Updated Data Type Conversions in Appendix A – Thank you Julian Samphire
  9. Added sound recording (Example 16-1) – 32 and 64 bit compatible
  10. Added audio playback (Example 16-2) – 32 and 64 bit compatible
  11. Added additional audio playback options (Example 16-3) – 32 bit only – Waiting for 64-bit Windows debugger
  12. Added Video player (Example 16-4) – 32 and 64 bit compatible
  13. Checked, changed, and confirmed all samples for 32-bit and 64-bit compatibility
  14. Added Alias information in Chapter 1
  15. Added WString MemoryByte example (Example 1-17) – 32 and 64 bit compatible
  16. Added CString information (Example 1-10)
  17. Added PString information (Example 1-11)
  18. Changed Example1-13 screen grab
  19. Rewrote Example 1-16 to be compatible on 32-bit and 64-bit systems
  20. Changed Example 2-1 to use GetTickCount64 function
  21. Rewrote Example 2-2 example – 32-bit and 64-bit compatible
  22. Updated Example 2-3 from ANSI to Unicode
  23. Updated Example 2-5 from ANSI to Unicode
  24. Updated Example 2-7 from ANSI to Unicode
  25. Changed Old Short Data type to Int16 in Example 2-8
  26. Updated TargetWin32 to TargetWindows in Example 2-9
  27. Added GetWindowLongPtr function for 64-bit compatibility in Example 3-1
  28. Updated Example 3-2 from ANSI to Unicode
  29. All code was tested and updated to Xojo 2017 r1 files
  30. Update Example 4-1 from ANSI to Unicode and updated to MemoryBlock
  31. Changed Example 4-3 from ANSI to Unicode
  32. Updated Example 4-4 from ANSI to Unicode and is 32/64 bit compatible
  33. Updated Example 4-6 code
  34. Updated Example 4-8 code for 32-bit and 64-bit compatibility, and converted to be Unicode compatible
  35. Updated Example 5-2
  36. Updated Example 5-4 to Unicode
  37. Updated Example 5-6 for 32-bit and 64-bit compatibility
  38. Added SetWindowLongPtr for future 64-bit compatibility to Example 5-7
  39. Convert Example 6-1 from ANSI to Unicode – 32-bit and 64-bit compatible
  40. Convert Example 6-2 from ANSI to Unicode – 32-bit and 64-bit compatible
  41. Convert Example 6-3 from ANSI to Unicode – 32-bit and 64-bit compatible
  42. Convert Example 6-4 from ANSI to Unicode – 32-bit and 64-bit compatible
  43. Convert Example 6-5 from ANSI to Unicode – 32-bit and 64-bit compatible
  44. Convert Example 6-6 from ANSI to Unicode – 32-bit and 64-bit compatible
  45. Convert Example 6-7 from ANSI to Unicode – 32-bit and 64-bit compatible
  46. Convert Example 6-8 from ANSI to Unicode – 32-bit and 64-bit compatible
  47. Convert Example 7-1 from ANSI to Unicode – 32-bit and 64-bit compatible
  48. Convert Example 7-2 from ANSI to Unicode – 32-bit and 64-bit compatible
  49. Convert Example 7-3 from ANSI to Unicode – 32-bit and 64-bit compatible
  50. Convert Example 7-4 from ANSI to Unicode – 32-bit and 64-bit compatible
  51. Convert Example 7-5 from ANSI to Unicode – 32-bit and 64-bit compatible
  52. Convert Example 8-1 from ANSI to Unicode – 32-bit and 64-bit compatible
  53. Convert Example 8-2 from ANSI to Unicode – 32-bit and 64-bit compatible
  54. Convert Example 8-3 from ANSI to Unicode – 32-bit and 64-bit compatible
  55. Convert Example 10-1 from ANSI to Unicode
  56. Updated Example 10-2 from ANSI to Unicode
  57. Updated Example 10-3 from ANSI to Unicode
  58. Updated Example 13-1 from ANSI to Unicode
  59. Updated Example 13-2 from ANSI to Unicode
  60. Updated Example 13-3 from ANSI to Unicode
  61. Convert Example 15-1 from ANSI to Unicode – 32-bit and 64-bit compatible
  62. Created Audio Recorder Example 16-1 from ANSI to Unicode
  63. Created Simple Audio Player Example 16-2 from ANSI to Unicode
  64. Created Advanced Audio Player Example 16-3 from ANSI to Unicode
  65. Created Video Player Example 16-4 
  66. Updated #If TargetWin32 to newer #If TargetWindows
  67. Added more information on Structures in Chapter 1
  68. Changed many examples with numeric conversions from CStr to.ToText

 

Play a Video (MPEG screen grab of video shown):

Declare500 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Play an Audio File with details:

16 3Audio

 

 

 

 

 

 

 

 

 

 

 

Added content to Version 2.2 (August 2017) are:

  1. Explanation of EX and Ptr suffix (Chapter 1)
  2. Added WOW64 definition (example 1-18), 32-bit and 64-bit compatible
  3. Added GetSystemInfo and GetNativeSystemInfo, 32-bit and 64-bit compatible (Example 2-10)
  4. Added LARGE_INTEGER data type (Appendix C)
  5. Added precision time the computer has been turned on (Example 17-1)
  6. Added precision delta time that could be used for graphics (Example 17-2)
  7. Updated RECT structure for 64-bit compatibility (Example 7-1)
  8. Update hDC conversion type to UInteger from Integer (getting negative values with Integer data type with PIXELFORMATDESCRIPTOR)
  9. Added Centre Screen Example (GetSystemMetrics and MoveWindow API) Example 5-8, 32-bit and 64-bit compatible
  10. Added Pointer and Operator code (Example 18-1) with is 32-bit and 64-bit compatible
  11. Edit and Add more Data type conversions in Appendix A
  12. Added more ByRef and ByVal information in Chapter 1 section
  13. Added INVALID_HANDLE_VALUE constant in Chapter 13
  14. Added file and subdirectory search Example 4-10, Unicode and 32-bit and 64-bit compatible
  15. Added many File contents in Appendix H

 

Added content to Version 2.3 (September 2017) are:

  1. Updated Example 6-11 SendMessageW call
  2. Updated Example 10-3 SendMessageW call
  3. Updated Example 10-4 SendMessageW call
  4. Added Struct ByRef for Pointer in ByRef and ByVal Section
  5. Added information on ANSI and Unicode (A and W Suffix) (use Unicode on all new programs)
  6. Added more conversion Data Types for TChar in Appendix A
  7. Added Comparison between Unicode Structure, Unicode MemoryBlock, ANSI Structure, and ANSI MemoryBlock code for the same declare (Example 1-19) – 32-bit and 64-bit compatible
  8. Created Multiple Display detail information in Example 19-1 – 32 bit and 64-bit compatible
  9. Created primary display working area size in Example 19-2 – 32 bit and 64 bit compatible
  10. Updated POINTAPI structure for multiple screen compatibility with Examples 7-2 through 7-5. (Integer to Int32)
  11. Added chapter on Monitors (32-bit and 64-bit Unicode compatible)
    1. Monitor Theory
    2. Multiple monitors
    3. Virtual Desktop and dimensions
    4. Monitor Number
    5. Total Monitor Screen Dimensions
    6. Working Monitor Screen Dimensions

Added content to Version 2.4 (July 2018) are:

  1. Added GetMessage (Example21-1) - 32-bit and 64-bit compatible
  2. Added PeekMessage (Example21-2) - 32-bit and 64-bit compatible
  3. Added PostMessage (Example21-3) - 32-bit and 64-bit compatible
  4. Added SendMessage (Example21-4) - 32-bit and 64-bit compatible
  5. Added GetMessagePost (Example21-5) - 32-bit and 64-bit compatible
  6. Added GetMessageTime (Example21-6) - 32-bit and 64-bit compatible
  7. Added tagMSG structure (Example21-1) - 32-bit and 64-bit compatible
  8. Added PointAPI32 structure (Example21-1) - 32-bit and 64-bit compatible

Added content to Version 2.5 (August 2018) are:

  1. Added Windows Services chapter (Chapter 22)
  2. Added TestServicesConsole app (Example22-1) – 32-bit and 64-bit compatible
  3. Added Access Rights for a Service Constants (Appendix I)
  4. Added Service Type Constants (Appendix J) 
  5. Added Start Type Constants (Appendix K)
  6. Added Error Control Constants (Appendix L)
  7. Added Access Rights for the Service Control Manager (Appendix M)
  8. Added an example to create a new service (Example 22-2) – 32-bit and 64-bit compatible. Includes OpenSCManager, CreateService, and CloseServiceHandle API.
  9. Added example to delete a service entry (Example 22-3) – 32-bit and 64-bit compatible. Includes DeleteService API.
  10. Added Example 22-4 to change the service description entry in the database with the ChangeServiceConfig2 API – 32-bit and 64-bit compatible.
  11. Added Example 22-5 to start a Service with the StartService API – 32-bit and 64-bit compatible.
  12. Added Example 22-6 to stop a Service with the ControlService API – 32-bit and 64-bit compatible.
  13. Added Example 22-7 to show the status of a service with QueryServiceStatus API – 32-bit and 64-bit compatible
  14. Added Example 22-8 to pause a service with the ControlService API – 32-bit and 64-bit compatible
  15. Added Example 22-9 to resume a service with ControlService – 32-bit and 64-bit compatible.

New content to Version 2.6 (September 2018) are:

  1. Added bookmarks to the PDF document to easier navigate the book. Thanks Julia Truchsess.
  2. Added Printers section (Chapter 23).
  3. Added the ability to retrieve the default local printer name (GetDefaultPrinter A and W). 32- and 64-bit compatible (Example 23-1)
  4. Updated Example1-8 on Pointers.
  5. Added Chapter 24 on Pointers.
  6. Added retrieving memoryblock memory address example (Example 24-1) – 32-bit and 64-bit compatible.
  7. Added Referencing of a MemoryBlock (Example 24-2) – 32-bit and 64-bit compatible.
  8. Added Dereferencing a MemoryBlock (Example 24-3) – 32-bit and 64-bit compatible.
  9.  Added Dereferencing a nil MemoryBlock (Example 24-4) – 32-bit and 64-bit compatible (don’t do it).
  10. Added BitCheck comparison method (Example 1-20) – 32-bit and 64-bit compatible.
  11. Added a lengthy EnumPrinters example to show information about printers on a computer (Example 23-2) – 32-bit and 64-bit compatible.
  12. Added the ability to set the default printer (Example 23-3) – 32-bit and 64-bit compatible.
  13. Added the issue with MemoryBlock nil dereferencing (Example 24-4).
  14. Added Example 23-4 to send string data to the printer. – 32-bit and 64-bit compatible.
  15. Changed description of a CString on Page 31 – Thanks Robin Lauryssen-Mitchell.
  16. Added many constants needed for the latest declares.

New content to Version 2.7 (October 2018) are:

  1. Added numerical MemoryBlock to Structure Conversion (Example 24-5) - 32-bit and 64-bit compatible.
  2. Retrieve the MemoryBlock address (Example 24-6) - 32-bit and 64-bit compatible
  3. Variable Length string data memory addresses with structures (Example 24-7) - 32-bit and 64-bit compatible
  4. Add GetMBFromAddress Offset Parameter (Example 24-6)
  5. Updated Example 23-2 ANSI section

The ebook is a pdf formatted document and all examples include Xojo code. Click to download the Table of Contents.

This is one of the many available books at Xojo Library where many Xojo resources are available.

ISBN: 978-1-927924-10-5