In order to use this services, you must declare the functions you will use.
There are 2 ways to declare the functions:
a) Declaring them directly into the .tBasic program like:
Code: Select all
DECLARE FUNCTION MessageBox LIB "USER32.DLL" ALIAS "MessageBoxA" (BYVAL hWnd AS DWORD, lpText AS ASCIIZ, lpCaption AS ASCIIZ, BYVAL dwType AS DWORD) AS LONG
You need to inform to the .tBasic program you will use this services using this line:
Code: Select all
#Include "Win32API.inc"
Code: Select all
#Include "RichEdit.inc"
All the include files are in this link:
https://app.box.com/s/eradrsfxf2h4t2l0g14u
Unzip this files into the \inc Folder
Example of use:
a) Declaring the function directly into the .tBasic program
Code: Select all
' Function Declaration
DECLARE FUNCTION MessageBox LIB "USER32.DLL" ALIAS "MessageBoxA" (BYVAL hWnd AS DWORD, lpText AS ASCIIZ, lpCaption AS ASCIIZ, BYVAL dwType AS DWORD) AS LONG
' Possible icon styles: change as you need
' %MB_ICONHAND = &H00000010&
' %MB_ICONQUESTION = &H00000020&
' %MB_ICONEXCLAMATION = &H00000030&
' %MB_ICONASTERISK = &H00000040&
' Execution
MessageBox (0,"Hello World!, hello NeoBook!, hello thinBasic!", "Welcome message", %MB_ICONASTERISK )
Code: Select all
' Include Declaration
#Include "Win32API.inc"
' Possible icon styles: change as you need
' %MB_ICONHAND = &H00000010&
' %MB_ICONQUESTION = &H00000020&
' %MB_ICONEXCLAMATION = &H00000030&
' %MB_ICONASTERISK = &H00000040&
' Execution
MessageBox (0,"Hello World!, hello NeoBook!, hello thinBasic!", "Welcome message", %MB_ICONASTERISK )