home *** CD-ROM | disk | FTP | other *** search
-
-
- 'CALLDLL7.BAS Show how to make a window 'Always On Top' 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 "Always On Top Example" for window_nf as #main
- print #main, "trapclose [quit]"
-
- mainH = hwnd(#main)
- toTop = (-1 or 0) 'OR the negative number with 0 to call it in an API
- flags = _SWP_NOMOVE or _SWP_NOSIZE
-
- open "user" for dll as #user
-
- calldll #user, "SetWindowPos", _
- mainH as ushort, _
- toTop as short, _
- 0 as short, _
- 0 as short, _
- 0 as short, _
- 0 as short, _
- flags as ushort, _
- result as void
-
- close #user
-
-
- [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
-
-
-