WinDeclare300x198Xojo Windows Declare Version 3.0 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 r3.  

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 32-bit, 64-bit, ANSI, and Unicode versions.This book is Version 3.0 (December 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 25 chapters and contains over 900 pages with over 140 example programs.

The targets for Version 3.0 are the following:

  1. Minimize use of Aliases
  2. ANSI, Unicode, 32-bit, adn 64-bit compatible for older and newer computers
  3. Add new functions
  4. Add module methods for increased portability across programs
  5. More Constants
  6. More API Declares
  7. More working API examples
  8. More native Windows controls
  9. Added many TargetWindow conditional statements
  10. Standardize the writing of declare methods
  11. All examples work in Xojo 2018 R3
  12. Removed ByVal prefix's as this is the default setting
  13. Cleaned up previous code to be easier understood
  14. 30 added examples
  15. Over 66 updates

 

Note: Programming in Windows API is an advanced topic!


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

 

 

 

 

 

 

 

 

 

 

 

 

 

 

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

Declare500 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Play an Audio File with details:

16 3Audio

 

 

 

 

 

 

 

 

 

 

 

Added API Calendar Control (Example 6-9)

APICalendar

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Added API Keyboard (Example 25-1)

Keyboard

...and many more.

New to Version 3.0 – December 2018

1) Added new CheckBox API example (Example 6-13) that is ANSI, Unicode, 32-bit and 64-bit compatible
2) PDF Bookmarks have been added to make topic browsing easier
3) Added LCID data type conversion in Appendix A
4) Added Example 25-1: On-Screen Keyboard, ANSI, Unicode, 32-bit, and 64-bit compatible
5) Added Example 25-2: Move On-Screen Keyboard, ANSI, Unicode, 32-bit, and 64-bit compatible
6) Added Example 23-5: PRINTER_INFO_2 with ANSI and Unicode DEV_MODE structures: Compatible with ANSI, Unicode, 32-bit, and 64-bit programs
7) Added Example 23-6: PRINTER_INFO_1 with compatibility for ANSI, Unicode, 32-bit, and 64-bit projects
8) Added Example 4-11: GetFileInfo, compatible with ANSI, Unicode, 32-bit and 64-bit projects
9) Added GetSysColorBrush for hbrBackground Window refresh (Example 6-12) that is compatible with ANSI, Unicode, 32-bit and 64-bit projects
10) Add a CheckBox API control (Example 6-13) that is compatible with ANSI, Unicode, 32-bit and 64-bit projects
11) Added Static control window class styles (Appendix AP) constants
12) Added the ability to show a static image (Example 6-14) that is compatible with ANSI, Unicode, 32-bit and 64-bit projects
13) Added Static control messages in Appendix AQ
14) Added ICC Control Class Constants (used in Example 6-15) shown in Appendix AR
15) Added Trackbar message constants shown in Appendix AS
16) Added month control style constants in Appendix AT
17) Added Calendar control message constants in Appendix AU
18) Added Calendar notification codes in Appendix AV
19) Added API calendar control (Example 6-16) that is compatible with ANSI, Unicode, 32-bit and 64-bit projects
20) Added snippet to populate a Structure from a memory address (Example 24-8)
21) Added GetMBFromAddress method (Example 24-9)
22) Added Tooltip control in Example 6-17 which is compatible with ANSI, Unicode, 32-bit and 64-bit projects
23) Added an UpDown control in Example 6-18 which is compatible with ANSI, Unicode, 32-bit and 64-bit projects
24) Added a GroupBox and Radio buttons example that is compatible with ANSI, Unicode, 32-bit and 64-bit projects (Example 6-19)
25) Added a ComboBox example which is ompatible with ANSI, Unicode, 32-bit and 64-bit projects (Example 6-20)
26) Added a Tab Control in Example 6-21 which is compatible with ANSI, Unicode, 32-bit and 64-bit projects
27) Added a Listbox Control in Example 6-22 which is compatible with ANSI, Unicode, 32-bit and 64-bit projects
28) Added a Bezier drawing example in Example 7-6 which is compatible with ANSI, Unicode, 32-bit and 64-bit projects
29) Added PointsArrayToMB in Example 24-11 which is compatible with ANSI, Unicode, 32-bit and 64-bit projects
30) Added TOKEN_PRIVILEGES structure, OpenProcessToken function, LUID_AND_ATTRIBUTES structure, LUID structure, LookupPrivilegeValue function, and AdjustTokenPrivileges function to Example 9-1 which are compatible with ANSI, Unicode, 32-bit and 64-bit projects

  

Updates
1) Updated Example 3-3: GetWindow, FindWindow, and GetWindowText functions for ANSI and Unicode
2) Updated Example 5-1: GetWindow, FindWindow, and GetWindowText functions for ANSI and Unicode
3) Updated Example 5-4: GetWindowText functions for ANSI and Unicode
4) MAX_PATH constant is 260 on ANSI and 520 with Unicode (Example 4-11)
5) Fixed grammatical and spelling mistakes
6) Updated Example 2-2 GetVersionInformation for ANSI, Unicode, 32-bit, and 64-bit compatibility, and added functionality.
7) Updated Example 2-3 to also be compatible with ANSI and Unicode for 32-bit and 64-bit systems.
8) Updated Example 2-5 for ANSI, Unicode, 32-bit, and 64-bit compatibility
9) Modified GetSysColor function (Example 2-6) for ANSI, Unicode, 32-bit, and 64-bit compatibility
10) Updated GetLocaleInfo (Example 2-7) for ANSI, Unicode, 32-bit, and 64-bit compatibility
11) Added SYSTEMTIME structure in Example 2-8 for GetLocalTime
12) Added compatibilility for ANSI and Unicode API calls for GetUserName (Example 2-9)
13) Added Wow64 compatiblity for Example 2-10 and the calls are now automatically peformed
14) Updated Example 3-2 to be compatible with both Unicode and ANSI GetModuleFileName API calls in 32-bit and 64-bit.
15) Updated Example 3-1 to be compatible with both Unicode and ANSI GetWindowLongPtr API calls in 32-bit and 64-bit.
16) GetWindowLong example 3-1 is not a preferred method for 64-bit executables
17) Updated GetDiskFreeSpace (Example 4-1) to be compatible with ANSI, Unicode, 32-bit, and 64-bit systems
18) Updated GetFileAttributes (Example 4-2) to be compatible with ANSI, Unicode, 32-bit, and 64-bit systems
19) Updated CreateDirectory, CreateFile, WriteFile, CloseHandle, and DeleteFile API calls (Example 4-3) to be compatible with ANSI, Unicode, 32-bit, and 64-bit systems
20) Updated CopyFile API calls (Example 4-4) to be compatible with ANSI, Unicode, 32-bit, and 64-bit systems
21) Changed Example 4-7 to use the proper UInt64 datatype
22) Updated SHQueryRecycleBin API calls (Example 4-8) to be compatible with ANSI, Unicode, 32-bit, and 64-bit systems. Added functional SHQueryRBInfo structure.
23) Updated GetVolumneInformation API calls (Example 4-9) to be compatible with ANSI, Unicode, 32-bit, and 64-bit systems. Added GetVolumeInfo structure, and GetVolumeInfo file flags.
24) Updated FindFirstFile and FindNextFile API calls (Example 4-10) to be compatible with ANSI, Unicode, 32-bit, and 64-bit systems. Modified StringWidth to be compatible with Xojo 2018 R3.
25) Corrected GetClassInfoExW and GetClassInfoExA structures, along with adding GetClassInfoEx_ClassStyle bit flag checking method for Example 5-3 which is compatible with ANSI, Unicode, 32-bit, and 64-bit systems. Also changed data display from a label to a TextArea control.
26) Updated SHQueryRecycleBin API calls (Example 4-8) to be compatible with ANSI, Unicode, 32-bit, and 64-bit systems. Added functional SHQueryRBInfo structure.
27) Updated GetForegroundWindow, GetWindowText, and GetWindowTextLength API calls (Example 5-4) to be compatible with ANSI, Unicode, 32-bit, and 64-bit systems.
28) Updated FlashWindow API call (Example 5-5) to be compatible with ANSI, Unicode, 32-bit, and 64-bit systems.
29) Updated GetKeyboardLayout API call (Example 5-6) to be compatible with ANSI, Unicode, 32-bit, and 64-bit systems.
30) Updated SetLayeredWindowAttributes and SetWindowLongPtr with SetWindowLong API calls (Example 5-7) to be compatible with ANSI, Unicode, 32-bit, and 64-bit systems.
31) Updated MoveWindow API call with proper data types in Example 5-8.
32) Updated Example 2-4 with Xojo GetSystemMetrics method with API call.
33) Many changes to create a Windows API simple window example (Example 6-1) to be compatible with ANSI, Unicode, 32-bit, and 64-bit systems.
34) Updated the common window example (Example 6-2) to be compatible with ANSI, Unicode, 32-bit, and 64-bit systems.
35) Updated the left-mouse-click example (Example 6-3) to be compatible with ANSI, Unicode, 32-bit, and 64-bit systems.
36) Updated Cursors (Example 6-4) with API’s for LoadCursor, SetCursor, Constants, and required updates to RegisterClassExA and RegisterClassExW that effects all other examples in Chapter 6. Now ANSI, Unicode, 32-bit, and 64-bit compatible.
37) Updated Menu creation (Example 6-5) with LoadCursor, Including a menu name, AppendMenu, SetMenu, and DestroyMenu API calls. Compatible with all Windows systems.
38) Updated Add Buttons Example 6-6 to be compatible with ANSI, Unicode, 32-bit, and 64-bit systems.
39) Updated Create a Label Example 6-7 with updated SetWindowText method. Compatible with ANSI, Unicode, 32-bit, and 64-bit systems.
40) Updated Create a TextBox Example 6-8 to be compatible with ANSI, Unicode, 32-bit, and 64-bit systems.
41) Updated APIMessageBox Example 6-9 to be compatible with ANSI, Unicode, 32-bit, and 64-bit systems.
42) Updated screen grab for Example 2-11.
43) Removed WString and CString from tagWNDCLASSEXA and tagWNDCLASSEXW to Ptr, which made window creation stable.
44) Updated drawing text to be compatible with ANSI, Unicode, 32-bit, and 64-bit systems in Example 7-1.
45) Updated drawing a line to be compatible with ANSI, Unicode, 32-bit, and 64-bit systems in Example 7-2.
46) Updated drawing a rectangle and ellipse to be compatible with ANSI, Unicode, 32-bit, and 64-bit systems in Example 7-3.
47) Updated drawing with pens to be compatible with ANSI, Unicode, 32-bit, and 64-bit systems in Example 7-4.
48) Updated drawing with a brush to be compatible with ANSI, Unicode, 32-bit, and 64-bit systems in Example 7-5.
49) Updated drawing with pictures be compatible with ANSI, Unicode, 32-bit, and 64-bit systems in Example 8-1.
50) Updated mask picture drawing to be compatible with ANSI, Unicode, 32-bit, and 64-bit systems in Example 8-2.
51) Updated drawing a mask at runtime with pictures be compatible with ANSI, Unicode, 32-bit, and 64-bit systems in Example 8-3.
52) Updated getting a Screen Grab to be compatible with ANSI, Unicode, 32-bit, and 64-bit systems in Example 8-4.
53) Updated Example 9-2 with a more-compatible SetSuspendState method.
54) Update code from Example 11-1 from legacy AbsolutePath to NativePath
55) Updated ShellExecute code from Example 13-1 to be compatible with both ANSI and Unicode on 32-bit and 64-bit systems.
56) Updated Example 14-1 with a new GetKeyState method and Declaration
57) Updated Example 14-2 with new GetAsyncKeyState Method and Declaration
58) Updated API colour picker to be compatible with ANSI, Unicode, 32-bit, and 64-bit systems in Example 15-1.
59) Updated mciSendString A and W functions for Example 16-1, 16-2, 16-3, 16-4 to be compatible with ANSI, Unicode, 32-bit, and 64-bit.
60) Updated QueryPerformanceCounter and QueryPerformanceFrequency with proper data types and made drag-and-drop methods for portability (Examples 17-1 and 17-2)
61) Updated CopyMemoryRead, CopyMemoryWrite, GetProcessHeap, HeapAlloc, and HeapFree with proper data types and made drag-and-drop methods for portability (Examples 18-1)
62) Updated API DisplayDevice to be compatible with ANSI, Unicode, 32-bit, and 64-bit systems in Example 19-1.
63) Created workaround for Rectangle structure incompatibility issue to be compatible with ANSI, Unicode, 32-bit, and 64-bit systems in Example 19-2.
64) Updated data types in Example 20-1
65) Updated Example 20-2 to be compatible with ANSI, Unicode, 32-bit, and 64-bit systems
66) Updated Example 10-1 to be compatible with ANSI, Unicode, 32-bit and 64-bit projects

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