; EXTFUNC
;
; Program for Proteus
;
; (C) 2003-2004 Simone Zanella Productions
;
; Demonstrate how it is possible to invoke an external function, compiled
; into a DLL.
;
; Functions loaded in this example are looked for into PROTEXT.DLL.
#!proteus -z -j
; Constants for MessageBox
; Buttons
; - OK (default)
CONST MB_OK 0x00000000
; - OK, CANCEL
CONST MB_OKCANCEL 0x00000001
; - ABORT, RETRY, IGNORE
CONST MB_ABORTRETRYIGNORE 0x00000002
; - YES, NO, CANCEL
CONST MB_YESNOCANCEL 0x00000003
; - YES, NO
CONST MB_YESNO 0x00000004
; - RETRY, CANCEL
CONST MB_RETRYCANCEL 0x00000005
; Icon
; - hand
CONST MB_ICONERROR 0x00000010
CONST MB_ICONHAND 0x00000010
CONST MB_ICONSTOP 0x00000010
; - question mark
CONST MB_ICONQUESTION 0x00000020
; - exclamation
CONST MB_ICONWARNING 0x00000030
CONST MB_ICONEXCLAMATION 0x00000030
; - information
CONST MB_ICONINFORMATION 0x00000040
CONST MB_ICONASTERISK 0x00000040
; Default button
; - first
CONST MB_DEFBUTTON1 0x00000000
; - second
CONST MB_DEFBUTTON2 0x00000100
; - third
CONST MB_DEFBUTTON3 0x00000200
; - fourth
CONST MB_DEFBUTTON4 0x00000300
; Window modal
; - application
CONST MB_APPLMODAL 0x00000000
; - system
CONST MB_SYSTEMMODAL 0x00001000
; - task
CONST MB_TASKMODAL 0x00002000
; Help button
CONST MB_HELP 0x00004000
; Message window does not take focus
CONST MB_NOFOCUS 0x00008000
; Window takes focus
CONST MB_SETFOREGROUND 0x00010000
; Window appears only on default desktop
CONST MB_DEFAULT_DESKTOP_ONLY 0x00020000
; Always topmost
CONST MB_TOPMOST 0x00040000
; Text right justified
CONST MB_RIGHT 0x00080000
; Notification from service
CONST MB_SERVICE_NOTIFICATION 0x00200000
!extern MessageBox, PROTEXT.DLL, ProteusMessageBox, 3, 0
; Shows two system messages
CONSOLELN "First MessageBox result: " \
MessageBox("Message example.", "Title", NOR(MB_OK, MB_ICONINFORMATION))
CONSOLELN "Second MessageBox result: " \
MessageBox("Continue?", "Question", NOR(MB_YESNO, MB_ICONQUESTION))
; Example of connection between Proteus and a third party DLL
!extern BCFEncode, PROTEXT.DLL, BCFEncode, 3, 512
CONSOLELN "Result of first call to BCFEncode: " BCFEncode("0123456789", "ITF", 1)
CONSOLELN "Result of second call to BCFEncode: " BCFEncode("123456789012", "EAN13", 1)
ABORT 0