Guidance
指路人
g.yi.org
software / rapidq / Examples / Memory Process Thread Message / shell / ShellExecute.bas

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
     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
'function to open the webpage.

     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
' a function to make the program minmize right.
'$include "setup.inc"


     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
'Height = 40
       Align = 5
       ONKEYPRESS = FILTER
      END CREATE
     END CREATE
     setwindowlong(form.handle, GWL_HWNDPARENT, _
      HWND_DESKTOP) 'calling the minimize function.
     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
掌柜推荐
 
 
¥738.00 ·
 
 
¥1,480.00 ·
 
 
¥397.00 ·
 
 
¥950.00 ·
 
 
¥264.00 ·
 
 
¥1,005.00 ·
© Sun 2024-11-24  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2002-07-06 10:39:28