DECLARE FUNCTION ShellExecute LIB "shell32.dll" _
ALIAS "ShellExecuteA" (BYVAL hwnd AS LONG, BYVAL _
lpOperation AS STRING, BYVAL lpFile AS STRING, _
BYVAL lpParameters AS STRING, BYVAL lpDirectory _
AS STRING, BYVAL nShowCmd AS LONG) AS LONG
CONST GWL_HWNDPARENT = -8
CONST HWND_DESKTOP = 0
DECLARE FUNCTION SetWindowLong LIB "user32" ALIAS _
"SetWindowLongA" (hwnd AS LONG, nIndex AS LONG, _
dwNewLong AS LONG) AS LONG
DECLARE SUB LAUNCH
DECLARE SUB FILTER (KEY AS WORD)
CREATE Form AS QFORM
CAPTION = "Launch IT!"
Width = screen.width
Height = 57
top = 0
left = 0
borderstyle = 2
DELBORDERICONS = 2
CREATE CoolBtn1 AS QCOOLBTN
CAPTION = "GO!"
Left = 453
Top = 0
Width = 100
Height = 20
Align = 4
onclick = launch
END CREATE
CREATE Edit1 AS QEDIT
Text = ""
Left = 0
Top = 0
Width = 453
Align = 5
ONKEYPRESS = FILTER
END CREATE
END CREATE
setwindowlong(form.handle, GWL_HWNDPARENT, _
HWND_DESKTOP)
setwindowlong(application.handle, _
GWL_HWNDPARENT, form.handle)
Form.SHOWMODAL
SUB LAUNCH
FORM.WINDOWSTATE = 1
IF UCASE$(EDIT1.TEXT) = "ABOUT" THEN
SHOWMESSAGE "ABOUT"
EXIT SUB
END IF
IF UCASE$(LEFT$(EDIT1.TEXT, 7)) = "HTTP://" THEN
rediff = ShellExecute(FORM.HANDLE, "Open", EDIT1.TEXT, "", "", 1)
ELSE
IF UCASE$(LEFT$(EDIT1.TEXT, 6)) = "FTP://" THEN
rediff = ShellExecute(FORM.HANDLE, "Open", EDIT1.TEXT, "", "", 1)
END IF
rediff = ShellExecute(FORM.HANDLE, "Open", "http://"+EDIT1.TEXT, "", "", 1)
END IF
END SUB
SUB FILTER (KEY AS WORD)
SELECT CASE KEY
CASE 13
LAUNCH
CASE 27
FORM.CLOSE
END SELECT
END SUB
|