Example EXTFUNC.PRT
; 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
Samples index Next example Previous example Contents Index
Midnight Lake iPhone Case Black Women Shoes Black Flat Shoes Leather Flats Black Patent Ballerinas Black Ballet Shoes Casual Shoes Black Shoes Women Balle Record Player Cufflinks Best iPhone XR Clear Cases iPhone XS/XS Max Leather Cases Sale Best iPhone 8/8 Plus Silicone Cases iPhone 7/7 Plus Cases & Screen Protector New Cases For iPhone 6/6 Plus iPhone 8 Case Sale iPhone Xr Case Online iPhone 7 Case UK Online iPhone X Case UK Sale iPhone X Case Deals iPhone Xs Case New Case For iPhone Xr UK Online Case For iPhone 8 UK Outlet Fashion Silver Cufflinks For Men Best Mens Cufflinks Outlet Online The Gold Cufflinks Shop Online Cheap Shirt Cufflinks On Sale Nice Wedding Cufflinks UK Online Top Black Cufflinks UK Online Mens Cufflinks Online Silver Cufflinks For Men Men Cufflinks UK Sale Gold Cufflinks UK Online Gold Cufflinks UK Silver Cufflinks UK Shirt Cufflinks Discount Online Mens Cufflinks Deals & Sales Girls Shoes For Dance Fashion Ballet Dance Shoes Best Ballet Flats Shoes UK Online Cheap Ballet Pointe Shoes UK Online Best Ballet Shoes Outlet Best Dance Shoes Sale Cheap Ballet Flats Sale UK Best Pointe Shoes Online UK Ballet Dance Shoes UK Shoes For Dance UK Best Ballet Slippers Shop Best Yoga Shoes Hotsell