home *** CD-ROM | disk | FTP | other *** search
-
-
- 'CALLDLL.BAS - Show how to run an external program, and how
- 'to minimize a window using API calls
-
- nomainwin
-
- WindowWidth = 232
- WindowHeight = 195
- UpperLeftX = 1000
-
- statictext #main.statictext1, "Please select an action:", 14, 16, 192, 20
- button #main, "Run File Manager", [runFileManager], UL, 30, 46, 160, 25
- button #main, "Beep", [beep], UL, 30, 81, 160, 25
- button #main, "Quit", [quit], UL, 30, 116, 160, 25
- open "Call DLL Example" for window_nf as #main
- print #main, "trapclose [quit]"
-
-
- [main.inputLoop] 'wait here for input event
- input aVar$
- goto [main.inputLoop]
-
-
-
- [runFileManager] 'Perform action for the button named 'Fileman'
-
- open "kernel" for dll as #kernel
-
- calldll #kernel, "WinExec", _
- "winfile.exe" as ptr, _
- _SW_SHOWNA as word, _
- result as word
-
- close #kernel
-
- goto [main.inputLoop]
-
-
- [beep] 'Perform action for the button named 'beep'
-
- open "user" for dll as #user
-
- calldll #user, "MessageBeep", _
- 1 as word, _
- result as void
-
- h = hwnd(#main)
- calldll #user, "CloseWindow", _
- h as word, _
- result as void
-
- calldll #user, "SetWindowText", _
- h as word, _
- "I was minimized!" as ptr, _
- result as void
-
- close #user
-
- goto [main.inputLoop]
-
-
- [quit] 'Perform action for the button named 'quit'
-
- print #main.statictext1, "OK. Closing..."
-
- 'pause for a moment
- t$ = time$()
- while t$ = time$() : wend
-
- close #main
-
- end
-
-
-