无忧启动论坛

 找回密码
 注册
搜索
系统gho:最纯净好用系统下载站投放广告、加入VIP会员,请联系 微信:wuyouceo
查看: 3476|回复: 7
打印 上一主题 下一主题

请高手说说QB的代码怎么写

[复制链接]
跳转到指定楼层
1#
发表于 2010-4-7 07:33:43 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
下面代码是QW生成的BAS 无改过任何代码 我想实现这样的功能 F8备份镜像 F9恢复镜像 F1设置密码
如设置了密码 F8恢复镜像提示要输入密码


DEFINT A-Z
'-------------------------------------------------------------------
'定义各控件最多可用的数目:
CONST MaxButton = 8 , MaxCheck = 0 , MaxOptG = 0 , MaxOptI = 0
'        按钮           复选按钮    单选按钮(组数),(每组项目数)
CONST MaxFrame = 0 , MaxList = 0 , MaxListItem = 100, MaxText = 1
'        框架         列表框   ,  每一列表项目数     文本框
CONST MaxCombo = 0 , MaxLabel = 6 , MaxMainMenu = 0, MaxMenuItem = 5
'      下拉式列表      标签            菜单           菜单项目
CONST MaxPercent = 0
CONST ListScrollSpeed = 1       '列表屏幕滚动速度(-1最快)
'$INCLUDE: '..\QBWIN\QBWIN.BI'
'$INCLUDE: '..\QBWIN\QBWIN.DAT'
SystemInit 1      '系统初始化
'0:不使用中文字库与输入法文件
'1:必须要中文字库文件(QBWIN.FNT),否则程序不能运行
'-1:如果程序找到有中文字库与输入法文件时可以使用,可以不使用
'定义及初始化用户变量区域 ----------------------------
'-----------------------------------------------------

DO
  '桌面定义
  '格式: DrawDesktop 提示行开关,桌面颜色,提示行字体颜色,背景色,提示文字$
  IF ExitWin < 2 THEN DrawDesktop 2, 3, 0, 7, "Ctrl+X:关闭窗口    Ctrl+F1:输入法"
  '各表单控件读入区域, 读入各种控件之间用 [=] 表示该种控件读完
  SELECT CASE Wins
    'jiemian.QWF
    CASE 0:
      '格式: LoadWindow X,Y,W,H,Font,BC,Box,TC,Caption
      LoadWindow 185,100,320,240,1010,7,1,11,"一键还原"
      RESTORE WIN00
WIN00:
      '热键值:  Alt+  F1=360 1=376 Q=272 A=286 Z=300
      'LoadMenu   '读入菜单
      '格式: DATA [-,Hotkey,] Enabled,Value,Caption    []里的参数为分组用
      'DATA -,289,1,0,文件(F)
      'DATA 1,0,Menu(1)
      'DATA =
      '格式: DATA X,Y,W,H,FC,FM,BC,Mode,Caption
      LoadFrame 0   '读入框架  是否读入到变量
      DATA 20,25,120,160,0,0,-1,5,"选择你需要的功能"
      DATA =
      '格式: DATA X,Y,W,H,Enabled,FC,FW,FH,Hotkey,Caption
      LoadButton 0   '读入命令按钮  背景框
      DATA 45,55,70,30,-1,12,8,25,323,"F9恢复"
      DATA 45,103,70,30,-1,9,8,25,322,"F8备份"
      DATA 192,121,70,20,-1,0,0,12,315,"保护密码"
      DATA 45,150,70,19,-1,0,0,15,27,"Esc退出"
      DATA =
      '格式: DATA X,Y,BW,FW,FH,FC,BC,FM,Style,Caption
      LoadLabel 0, 0   '读入标签  是否读入到变量, 背景框
      DATA 185,40,19,12,12,0,-1,8,0,"该软件版权归"
      DATA 185,60,0,12,12,0,-1,8,0,"工作室所有,任何人可随"
      DATA 185,80,0,12,12,0,-1,8,0,"意传播!"
      DATA 185,100,19,12,12,1,-1,18,0,"QQ:"
      DATA 185,150,20,12,12,4,-1,0,0,"建议设置保护密码"
      DATA 185,170,20,12,12,4,-1,0,0,"避免他人破坏你的"
      DATA 185,185,0,12,12,4,-1,0,0,"备份"
      DATA =

  END SELECT
  IF ExitWin = 0 THEN ProcessLoop     '过程循环处理
LOOPSUB C.ButtonClick (NWin, Inx)
  Sel = NWin * 100 + Inx
  SELECT CASE Sel
    CASE 1:

  END SELECT
END SUB
SUB C.ButtonState (NWin, Inx, State)
  Sel = NWin * 100 + Inx
  SELECT CASE Sel
    CASE 0:
      
  END SELECT
END SUB
SUB C.CheckClick (NWin, Inx)
  Sel = NWin * 100 + Inx
  SELECT CASE Sel
    CASE 0:
  END SELECT
END SUB
SUB C.ComboClick (NWin, Inx)
  Sel = NWin * 100 + Inx
  SELECT CASE Sel
    CASE 0:
      
  END SELECT
END SUB
SUB C.FormUnload (NWin, QBCancel)
  SELECT CASE NWin
    CASE 0:
      'K$ = "OC": MsgBox K$, "退出", "    确定想离开吗?"
      'QBCancel = (K$ = "C")
  END SELECT
  
END SUB
SUB C.FrameClick (NWin, Inx, Button)
  Sel = NWin * 100 + Inx
  SELECT CASE Sel
    CASE 0:
  END SELECT
END SUB
SUB C.FrameDblClick (NWin, Inx)
  Sel = NWin * 100 + Inx
  SELECT CASE Sel
    CASE 0:
  END SELECT
END SUB
SUB C.FrameMouseInOut (NWin, Inx, State)
  Sel = NWin * 100 + Inx
  SELECT CASE Sel
    CASE 0:
  END SELECT
  
END SUB
SUB C.FrameMouseState (NWin, Inx, X, Y, Button)
  Sel = NWin * 100 + Inx
  SELECT CASE Sel
    CASE 0:
  END SELECT
  
END SUB
SUB C.ListChange (NWin, Inx, CType)
  Sel = NWin * 100 + Inx
  SELECT CASE Sel
    CASE 1:
  END SELECT
END SUB
SUB C.ListClick (NWin, Inx)
  Sel = NWin * 100 + Inx
  SELECT CASE Sel
    CASE 0:
  END SELECT
  
END SUB
SUB C.ListDblClick (NWin, Inx)
  Sel = NWin * 100 + Inx
  SELECT CASE Sel
    CASE 0:
  END SELECT
END SUB
SUB C.ListKeyPress (NWin, Inx, KeyCode)
  Sel = NWin * 100 + Inx
  SELECT CASE Sel
    CASE 0:
  END SELECT
END SUB
SUB C.MenuClick (NWin, MInx, Inx)
  DIM Sel AS LONG
  Sel = NWin
  Sel = Sel * 10000 + MInx * 100 + Inx
  SELECT CASE Sel
    CASE 1:
      
  END SELECT
END SUB
SUB C.OptionClick (NWin, GInx, Inx)
  Sel = NWin * 100 + GInx
  SELECT CASE Sel
    CASE 0:
  END SELECT
END SUB
SUB C.TextKeyPress (NWin, Inx, KeyCode)
  Sel = NWin * 100 + Inx
  SELECT CASE Sel
    CASE 0:
  END SELECT
END SUB
SUB C.Timer (NWin, KeyCode)
  SELECT CASE NWin
    CASE 0:
  END SELECT
  
  'LOCATE 1, 1: PRINT Mouse.X - Win.X; Mouse.Y - Win.Y
  'LOCATE 1, 1: PRINT FRE(-1)
  
END SUB
SUB DisplayMenu (MenuNo, X, Y)
  SHARED XMenu, ContObj
  XMenu = MenuNo: ContObj = -1
  IF X >= 0 THEN Mouse.X = X: Mouse.Y = Y
  XMenu = MenuNo: ContObj = -1
  IF X >= 0 THEN Mouse.X = X: Mouse.Y = Y
END SUB
SUB ListAdd (Inx, InsNo, Item$)
  XListAdd Inx, InsNo, Item$, ListB(), ListI(), MaxListItem
END SUB
SUB ListRemove (Inx, RemNo)
  XListRemove Inx, RemNo, ListB(), ListI(), MaxListItem
END SUB
SUB LoadButton (Cmd)
  DO
    READ T$: IF T$ = "=" THEN EXIT DO
    SumButton = SumButton + 1
    B = SumButton
    Button(B).X = VAL(T$)
    READ Button(B).Y, Button(B).W, Button(B).H, Button(B).Enabled
    READ Button(B).FC, Button(B).FW, Button(B).FH, Button(B).Hotkey, ButtonCap(B)
    IF Cmd THEN Get3DCmd Win.X + Button(B).X - 2, Win.Y + Button(B).Y - 2, Button(B).W + 4, Button(B).H + 4, -1, Cmd, Win
  LOOP
END SUB
SUB LoadCheck
  DO
    READ T$: IF T$ = "=" THEN EXIT DO
    SumCheck = SumCheck + 1
    B = SumCheck
    Check(B).X = VAL(T$)
    READ Check(B).Y, Check(B).Enabled
    READ Check(B).Value, Check(B).Hotkey, CheckCap(B)
  LOOP
END SUB
SUB LoadCombo
  DO
    READ T$: IF T$ = "=" THEN EXIT DO
    SumCombo = SumCombo + 1
    B = SumCombo
    Combo(B).X = VAL(T$)
    L = B + SumList + 1
    READ Combo(B).Y, Combo(B).BW, Combo(B).Col, Combo(B).Enabled, HK, Combo(B).G3D
    ListB(L).Hotkey = HK
    ListB(L).Count = -1: ListB(L).Index = -1
  LOOP
END SUB
SUB LoadFrame (Memo)
  DO
    READ T$: IF T$ = "=" THEN EXIT DO
    X = VAL(T$)
    READ Y, W, H, FC, FM, BC, Mode, C$
    IF Memo THEN
      SumFrame = SumFrame + 1
      B = SumFrame
      Frame(B).X = X: Frame(B).Y = Y
      Frame(B).W = W: Frame(B).H = H
    END IF
    PrintFrame X, Y, W, H, FC, FM, BC, Mode, C$, Win
  LOOP
END SUB
SUB LoadLabel (Memo, Cmd)
  DO
    READ T$: IF T$ = "=" THEN EXIT DO
    X = VAL(T$)
    READ Y, BW, FW, FH, FC, BC, FM, ST, MSG$
    Get3DCmd Win.X + X - 3, Win.Y + Y - 3, BW * 6 + 6 + (FW - 12) * BW, FH + 5, BC, Cmd, Win
    IF Memo > 0 THEN
      SumLabel = SumLabel + 1
      B = SumLabel
      Label(B).X = X: Label(B).Y = Y
      Label(B).FW = FW: Label(B).FH = FH
      Label(B).BW = BW: Label(B).FC = FC
      Label(B).BC = BC: Label(B).FM = FM
      Label(B).Style = ST: LabelCap(B) = MSG$
    ELSE
      S = 1: MN = -1
      DO
        E = INSTR(S, MSG$, "`")
        EE = E
        IF E = 0 THEN EE = LEN(MSG$) + 1
        MN = MN + 1
        PrintFont X, Y + MN * FH, FW, FH, FC, BC, FM, MID$(MSG$, S, EE - S), Win
        S = E + 1
      LOOP WHILE E > 0
    END IF
  LOOP
END SUB
SUB LoadList
  DO
    READ T$: IF T$ = "=" THEN EXIT DO
    SumList = SumList + 1
    B = SumList
    ListB(B).X = VAL(T$)
    READ ListB(B).Y, ListB(B).BW, ListB(B).Col, ListB(B).BH, ListB(B).Hotkey, ListB(B).G3D
    ListB(B).Count = -1: ListB(B).Index = -1
  LOOP
END SUB
SUB LoadMenu
  DO
    READ T$
    IF T$ = "=" THEN EXIT DO
    IF T$ = "-" THEN
      SumMMenu = SumMMenu + 1: B = SumMMenu: A = 0
      READ MenuHotkey(B), Menu(B, A).Enabled
    ELSE
      Menu(B, A).Enabled = VAL(T$)
    END IF
    READ Menu(B, A).Value, MenuCap(B, A)
    SumMenu(B) = A: A = A + 1
  LOOP
END SUB
SUB LoadOption
  DO
    READ T$
    IF T$ = "=" THEN EXIT DO
    IF T$ = "-" THEN
      SumOptG = SumOptG + 1: B = SumOptG: A = 0
      READ OptBValue(B), OptB(B, A).X
    ELSE
      OptB(B, A).X = VAL(T$)
    END IF
    READ OptB(B, A).Y, OptB(B, A).Enabled
    READ OptB(B, A).Hotkey, OptBCap(B, A)
    SumOptI(B) = A: A = A + 1
  LOOP
END SUB
SUB LoadPercentbar
  DO
    READ T$: IF T$ = "=" THEN EXIT DO
    SumPercent = SumPercent + 1
    B = SumPercent
    PercentBar(B).X = VAL(T$)
    READ PercentBar(B).Y, PercentBar(B).W, PercentBar(B).H
    READ PercentBar(B).FC, PercentBar(B).BC, PercentBar(B).Style
    ShowPercentbar B, 0, PercentBar(), Win
  LOOP
END SUB
SUB LoadText
  DO
    READ T$: IF T$ = "=" THEN EXIT DO
    SumText = SumText + 1
    B = SumText
    Text(B).X = VAL(T$)
    READ Text(B).Y, Text(B).BW, Text(B).Enabled, Text(B).FC
    READ Text(B).Password, Text(B).MaxLen, Text(B).Hotkey, Text(B).G3D
  LOOP
END SUB
SUB LoadWindow (XX, YY, W, H, Font, BC, Box, TC, T$)
  ON ERROR RESUME NEXT
  ERASE Button, OptB, SumOptI, Check, Frame, ListB, ListI, TextTXT, Text
  ERASE ButtonCap, OptBCap, OptBRValue, OptBValue, CheckCap, Combo, ComboTXT
  ERASE Label, LabelCap, LabelRCap
  ERASE Menu, MenuCap, SumMenu, PercentBar
  SumPercent = -1
  SumButton = -1
  SumCheck = -1
  SumOptG = -1
  SumFrame = -1
  SumList = -1
  SumText = -1
  SumCombo = -1
  SumLabel = -1
  SumMMenu = -1
  DrawWindow XX, YY, W, H, Font, BC, Box, TC, T$, Button(), ButtonCap(), Win, SumButton
  RW = ASC(MID$(Win.RetWins, 1, 1))
  RW = RW + 1
  MID$(Win.RetWins, 1, 1) = CHR$(RW)
  MID$(Win.RetWins, RW + 1, 1) = CHR$(Wins)
  ExitWin = 0
END SUB
SUB MsgBox (KeyB$, Titl$, MSG$)
  ON ERROR RESUME NEXT
  SHARED MsgKey, ContObj
  RW = Wins
  IF LEFT$(KeyB$, 1) = "@" THEN
    TWW = 39: H = 110
    Wins = -2
    SumText = SumText + 1
    TextTXT(SumText) = MSG$: Text(SumText).Hotkey = 9
    Text(SumText).Enabled = -1: Text(SumText).FC = 0
    Text(SumText).MaxLen = VAL(MID$(KeyB$, 2)): Text(SumText).G3D = -1
    Text(SumText).Locate = LEN(MSG$)
    KeyB$ = "OC"
    MSG$ = Titl$
    Titl$ = ""
  ELSE
    IF Titl$ = "" THEN Titl$ = "信息"
    Wins = -1
    H = 90
  END IF
  S = 1: MN = -1
  MS$ = ""
  DO
    E = INSTR(S, MSG$, "`")
    EE = E
    IF E = 0 THEN EE = LEN(MSG$) + 1': IF EE - S = 0 THEN MN = -2
    IF MN < 0 AND Wins = -2 AND Titl$ = "" THEN
      Titl$ = MID$(MSG$, S, EE - S)
      IF Titl$ = "" THEN Titl$ = "输入"
    ELSE
      MN = MN + 1
      MS$ = MS$ + MKI$(S) + MKI$(EE - S)
    END IF
    IF EE - S > TWW THEN TWW = EE - S
    S = E + 1
  LOOP WHILE E > 0
  TW = TWW * 6 + 30
  KK = LEN(KeyB$)
  H = H + 14 * MN: W = 90 + (KK - 1) * 70: IF TW > W THEN W = TW
  RRXX = Win.X: RRYY = Win.Y: RRWW = Win.W: RRHH = Win.H: RRBC = Win.BC
  X = -1: Y = -1
  'X = Mouse.X: Y = Mouse.Y
  'IF X + W > 639 THEN X = 639 - W
  'IF Y + H > 450 THEN Y = 450 - H
  RSButton = SumButton + 1
  MouseHide
  GetTX X, Y, W, H, 0
  DrawWindow X, Y, W, H, 3, 7, 0, 1, CHR$(1) + Titl$, Button(), ButtonCap(), Win, SumButton
  K = SumButton
  FOR KA = 0 TO KK - 1
    K$ = MID$(KeyB$, KA + 1, 1)
    SELECT CASE UCASE$(K$)
      CASE "O": C$ = "确定": HK = 13
      CASE "Y": C$ = "是(Y)": HK = 277
      CASE "N": C$ = "否(N)": HK = 305
      CASE "A": C$ = "中断(A)": HK = 286
      CASE "R": C$ = "重试(R)": HK = 275
      CASE "I": C$ = "忽略(I)": HK = 279
      CASE ELSE: C$ = "取消": HK = 27
    END SELECT
    K = K + 1: ButtonCap(K) = C$: Button(K).Hotkey = HK
    Button(K).X = (W - KK * 68) \ 2 + 68 * KA
    Button(K).Y = H - 52
    Button(K).W = 60: Button(K).H = 17
    Button(K).Enabled = 1: Button(K).FC = 0
    Button(K).FW = 0: Button(K).FH = 12
  NEXT
  SumButton = K
  FOR A = 0 TO MN
    S = CVI(MID$(MS$, A * 4 + 1, 2))
    E = CVI(MID$(MS$, A * 4 + 3, 2))
    PrintChr Win.X + 10, Win.Y + 10 + 14 * A, 12, 12, 0, -1, MID$(MSG$, S, E)
  NEXT
  IF Wins = -2 THEN
    Text(SumText).BW = TWW - 1
    Text(SumText).X = 8
    Text(SumText).Y = H - 83
    MSG$ = TextTXT(SumText)
  END IF
  ExitWin = 0
  MsgKey = RSButton
  ProcessLoop
  PutTX X, Y, 0
  SumButton = RSButton - 1
  Win.X = RRXX: Win.Y = RRYY: Win.W = RRWW: Win.H = RRHH: Win.BC = RRBC
  KeyB$ = MID$(KeyB$, MsgKey, 1)
  IF Wins = -2 THEN
    SumText = SumText - 1: IF SumText > -1 THEN PrintText 0, 5, 0, Text(), TextTXT(), Win, CutBoard, 0
    IF MsgKey = 1 THEN MSG$ = TextTXT(SumText + 1)
  END IF
  MouseShow
  MsgKey = 0: ContObj = 0
  Wins = RW: ExitWin = 0
END SUB
SUB ProcessLoop
  DIM PicTime AS SINGLE, InitTime AS SINGLE, RTimeClick AS SINGLE
  SHARED XMenu, ContObj, MsgKey, RXInpT, KeyCode
  RecWins = Wins
  IF SumText > -1 AND RecWins <> -1 THEN ContObj = 3 ELSE ContObj = 0
  LST = 0: LEND = SumList: XLLCMD = -1: InitControl = -1
  IF RecWins = -2 THEN
    XInpText = SumText
  ELSE
    XInpText = 0
  END IF
  RXInpT = XInpText
  MouseShow
  DO
    IF ContObj <> -1 THEN GetMouse Mouse
    KeyCode = 0
    IF NOT InitControl THEN
      GetKey KeyCode
      C.Timer RecWins, KeyCode
    END IF
    RTextI = 0
    IF ContObj <> 4 AND ContObj < 10 THEN
      XRKCL = XKCL
      XRLCMD = XXLCMD: A = 0
      FOR XLCMD = MsgKey TO SumButton
        IF Button(XLCMD).Enabled <> Button(XLCMD).REnabled OR InitControl AND XLCMD > RSButton THEN PrintButton XLCMD, InitControl - 2, Button(), ButtonCap(), Win: C.ButtonState RecWins, (XLCMD), 1
        GotFocus xicmd, (Button(XLCMD).X), (Button(XLCMD).Y), (Button(XLCMD).W), (Button(XLCMD).H), Mouse, Win
        HK = KeyCode = Button(XLCMD).Hotkey
        IF (xicmd OR HK) AND Button(XLCMD).Enabled THEN
          IF Mouse.K = 1 AND Mouse.RK = 0 OR Mouse.K = 1 AND XLLCMD = XLCMD OR HK THEN
            IF A <> 2 THEN XLLCMD = XLCMD: IF HK THEN A = 2 ELSE XKCL = 2
            ContObj = 7
          ELSE
            XKCL = -1
            IF Mouse.K = 0 AND Mouse.RK = 1 THEN XKCL = 1
          END IF
          XXLCMD = XLCMD
          IF A = 0 THEN A = 1
        END IF
      NEXT
      IF XRLCMD <> XXLCMD OR A = 0 THEN
        XKCL = 0
        IF XRKCL = 2 THEN XKCL = 1
        IF Mouse.K = 0 AND Mouse.RK = 1 THEN XLLCMD = -1
      END IF
      IF XKCL <> XRKCL THEN
        PrintButton XRLCMD, XKCL, Button(), ButtonCap(), Win
        C.ButtonState RecWins, (XRLCMD), (XKCL)
      END IF
      IF Mouse.K = 0 AND XLLCMD = XXLCMD AND Mouse.RK = 1 OR A = 2 THEN
        IF RecWins < 0 THEN
          Mouse.K = -99: RXInpT = 0: MsgKey = XLLCMD - MsgKey: ExitWin = 2
        ELSE
          C.ButtonClick RecWins, (XLLCMD)
          IF MsgKey = XLLCMD THEN ExitWin = 2
        END IF
      END IF
      'IF Mouse.K = 1 AND Mouse.RK = 0 THEN
      '  GotFocus I, -5, -30, (Win.W), (Win.H), Mouse, Win
      '  IF I = 0 THEN BEEP
      'END IF
      IF RecWins <> -1 THEN
        IF RecWins = -2 THEN
          RSText = SumText
          IF RContObj = 3 AND ContObj <> 3 THEN PrintText XInpText, 3, 0, Text(), TextTXT(), Win, CutBoard, XPutII
          RContObj = ContObj
        ELSE
          RSText = 0
        END IF
        FOR L = RSText TO SumText
          IF InitControl THEN
            PrintText L, 5, 0, Text(), TextTXT(), Win, CutBoard, 0
            IF L = SumText THEN PrintText XInpText, 5, 0, Text(), TextTXT(), Win, CutBoard, 0
          ELSE
            X = Text(L).X: Y = Text(L).Y: W = (Text(L).BW) * 6 + 8
            GotFocus I, X, Y + 1, W, 17, Mouse, Win
            IF I THEN RTextI = 1
            A = (KeyCode = Text(L).Hotkey)
            IF I AND Mouse.K <> 0 AND Mouse.RK = 0 OR A THEN
              PrintText RXInpT, 3, 0, Text(), TextTXT(), Win, CutBoard, 1
              IF A = 0 THEN Text(L).Locate = (Mouse.X - (Win.X + X) + 1) \ 6
              XInpText = L: ContObj = 3
              PrintText L, 4, 0, Text(), TextTXT(), Win, CutBoard, 0: RXInpT = XInpText
            END IF
            IF Text(L).Enabled <> Text(L).REnabled THEN
              PrintText RXInpT, 3, 0, Text(), TextTXT(), Win, CutBoard, 1
              PrintText L, 5, 0, Text(), TextTXT(), Win, CutBoard, 0
              RXInpT = L
            END IF
          END IF
        NEXT
        IF ContObj = 3 THEN
          IF KeyCode <> 0 THEN
            'IF KeyCode = 328 THEN XInpText = XInpText - 1: IF XInpText < RSText THEN XInpText = SumText
            'IF KeyCode = 336 OR
            IF KeyCode = 9 THEN XInpText = XInpText + 1: IF XInpText > SumText THEN XInpText = RSText
          ELSE
            IF TIMER - PicTime > .4 THEN XPutII = 0
            IF TIMER - PicTime > .9 THEN XPutII = 1: PicTime = TIMER
          END IF
          IF RXInpT <> XInpText THEN
            PrintText RXInpT, 3, 0, Text(), TextTXT(), Win, CutBoard, 1
            PrintText XInpText, 4, 0, Text(), TextTXT(), Win, CutBoard, 0
            RXInpT = XInpText
          ELSE
            IF XPutII <> RXPutII OR KeyCode > 0 THEN
              RXPutII = XPutII
              PrintText XInpText, 2, KeyCode, Text(), TextTXT(), Win, CutBoard, XPutII
              IF KeyCode <> 0 THEN C.TextKeyPress RecWins, XInpText, KeyCode
            END IF
          END IF
        END IF
      END IF
    END IF
    IF RRTextI <> RTextI THEN RRTextI = RTextI: SetMouseCursor RTextI
    IF RecWins > -1 THEN
      IF ContObj <> 4 THEN
        II = 0
        IF ContObj = 11 THEN
          'IF Menu(XMenu, 0).Enabled THEN
            XMenuHI = Menu(XMenu, 0).Enabled
            IF XMenuHI > SumMenu(XMenu) THEN XMenuHI = SumMenu(XMenu)
            MW = (SumMenu(XMenu) - 1) \ XMenuHI + 1
            GotFocus II, RKMenuX + 2, RKMenuY - 3, MenuWidth * MW - 4, XMenuHI * 14 + 4, Mouse, Win
            IF II AND (Mouse.Y <> XRMouseY OR Mouse.X <> XRMouseX) AND Mouse.Y > Win.Y + RKMenuY THEN
              XMINX = ((Mouse.X - Win.X - RKMenuX - 1) \ MenuWidth) * XMenuHI + (Mouse.Y - Win.Y - RKMenuY - 1) \ 14 + 1
              IF XMINX > SumMenu(XMenu) THEN XMINX = XRMINX
              XRMouseY = Mouse.Y: XRMouseX = Mouse.X
            END IF
            IF II = 0 THEN IF Mouse.K = 1 THEN XMINX = 0
            FOR A = 0 TO SumMenu(XMenu)
              IF KeyCode = 336 THEN XMINX = XMINX + 1: IF XMINX > SumMenu(XMenu) THEN XMINX = 1
              IF KeyCode = 328 THEN XMINX = XMINX - 1: IF XMINX < 1 THEN XMINX = SumMenu(XMenu)
              IF MenuCap(XMenu, XMINX) <> "" THEN EXIT FOR
            NEXT
            IF KeyCode < 256 THEN
              FOR A = 1 TO SumMenu(XMenu)
                Cap$ = MenuCap(XMenu, A): L = INSTR(Cap$, "(")
                Cap$ = UCASE$(MID$(Cap$, L + 1, 1))
                IF Cap$ = UCASE$(CHR$(KeyCode)) THEN Mouse.K = 0: Mouse.RK = 1: XMINX = A: II = -1: EXIT FOR
              NEXT
            END IF
            IF KeyCode = 13 THEN Mouse.K = 0: Mouse.RK = 1: II = -1
            IF XMINX <> XRMINX THEN PrintMenu XMenu, XRMINX, XMINX, 4, Menu(), MenuCap(), SumMenu(), Win, RKSMenuX, RKSMenuY, RKMenuX, RKMenuY, MenuWidth: XRMINX = XMINX
            IF Mouse.K = 0 AND Mouse.RK = 1 AND Menu(XMenu, XMINX).Enabled AND MenuCap(XMenu, XMINX) <> "" THEN IF XMINX > 0 THEN XPUT = 2 ELSE XPUT = 1
          'END IF
          IF (Mouse.K = 0 AND Mouse.RK > 0 OR RKSMenuX = -1 AND Mouse.K = 2 AND Mouse.RK = 0) AND II = 0 THEN XPUT = 1
          PR = 0
          IF KeyCode = 27 THEN XPUT = 1
         IF RKSMenuX <> -1 THEN
          IF KeyCode = 333 THEN XMenu = XMenu + 1: PR = -1: IF XMenu > SumMMenu THEN XMenu = 0
          IF KeyCode = 331 THEN XMenu = XMenu - 1: PR = -1: IF XMenu < 0 THEN XMenu = SumMMenu
         END IF
          IF PR THEN XPUT = 2: XMINX = 0: ContObj = 10: XRMouseX = Mouse.X: XRMouseY = Mouse.Y
        END IF
        RKSMX = 0: RKSMY = -1
        FOR M = 0 TO SumMMenu
          IF M > 0 THEN
            RKSMX = RKSMX + (LEN(MenuCap(M - 1, 0)) + 2) * 6 + 2
            IF RKSMX + (LEN(MenuCap(M, 0)) + 2) * 6 + 2 > Win.W - 7 THEN RKSMX = 0: RKSMY = RKSMY + 14
          END IF
          GotFocus I, RKSMX - 1, RKSMY - 1, 6 * (LEN(MenuCap(M, 0)) + 2) + 2, 14, Mouse, Win
          IF I AND II = 0 OR KeyCode = MenuHotkey(M) THEN
            IF Mouse.K = 1 AND Mouse.RK = 0 OR KeyCode = MenuHotkey(M) OR XMenu <> M AND ContObj = 11 AND (Mouse.X <> XRMouseX OR Mouse.Y <> XRMouseY) THEN
              IF ContObj = 11 THEN XPUT = 1
              ContObj = 10: XMenu = M: XRMouseX = Mouse.X: XRMouseY = Mouse.Y
            END IF
          END IF
          IF InitControl THEN
            PrintMenu M, -1, -1, 0, Menu(), MenuCap(), SumMenu(), Win, RKSMX, RKSMY, RKMenuX, RKMenuY, MenuWidth
            IF M = SumMMenu THEN MouseHide: Get3DBox (Win.X), (Win.Y) + RKSMY + 14, (Win.W) - 8, 1, 8, 15, -1: MouseShow
          END IF
          IF M = XMenu AND ContObj = 10 THEN RKSMenuX = RKSMX: RKSMenuY = RKSMY: RKMenuX = RKSMenuX - 1: RKMenuY = RKSMenuY + 16
        NEXT
        IF XPUT THEN
          PrintMenu XRMenu, -1, -1, 3, Menu(), MenuCap(), SumMenu(), Win, RRKSMX, RRKSMY, RRKMX, RRKMY, RMW
          IF XRMenu = XMenu THEN ContObj = 0
          XRMenu = XMenu
          IF XPUT = 2 THEN
            C.MenuClick RecWins, XMenu, XMINX
          ELSE
            C.MenuClick -RecWins, -XMenu, 0
          END IF
          XPUT = 0: Mouse.K = -100: Mouse.RK = -100
          RRTextI = 0: KeyCode = 0
        END IF
        IF ContObj = -1 THEN
          SetMouseCursor 0: ContObj = 10
          RKMenuY = Mouse.Y - Win.Y + 3
          RKMenuX = Mouse.X - Win.X
          RKSMenuX = -1
        END IF
      END IF
      IF RContObj = 3 AND ContObj <> 3 THEN PrintText XInpText, 3, 0, Text(), TextTXT(), Win, CutBoard, XPutII
      IF RContObj = 5 AND ContObj <> 5 THEN PrintCombo XCombo, 3, 0, Combo(), ComboTXT(), Win
      RContObj = ContObj
      IF ContObj = 10 THEN
        C.MenuClick RecWins, XMenu, 0
        PrintMenu XMenu, -1, 0, 1, Menu(), MenuCap(), SumMenu(), Win, RKSMenuX, RKSMenuY, RKMenuX, RKMenuY, MenuWidth
        XRMenu = XMenu: XRMINX = 0: XMINX = 0
        ContObj = 12
        RRKSMX = RKSMenuX: RRKSMY = RKSMenuY
        RRKMX = RKMenuX: RRKMY = RKMenuY: RMW = MenuWidth
      END IF
      IF ContObj = 12 AND Mouse.K = 0 AND Mouse.RK = 0 THEN ContObj = 11
      IF ContObj < 10 THEN
        IF (ContObj = 2 OR ContObj = 4) AND KeyCode > 0 THEN
          I = ListB(XList).Index: S = ListB(XList).ScInx
          B = S + ListB(XList).BH * ListB(XList).Col
          IF KeyCode = 331 AND I > ListB(XList).BH - 1 THEN I = I - ListB(XList).BH: IF I < S THEN S = S - ListB(XList).BH
          IF KeyCode = 333 AND I < ListB(XList).Count - ListB(XList).BH + 1 THEN I = I + ListB(XList).BH: IF I > B - 1 THEN S = S + ListB(XList).BH
          IF KeyCode = 328 AND I > 0 THEN I = I - 1: IF I < S OR ListB(XList).BW <= 0 THEN IF ListB(XList).Col > 1 THEN S = S - ListB(XList).BH ELSE S = S - 1: I = S
          IF KeyCode = 336 AND I < ListB(XList).Count THEN
            I = I + 1
            IF I > B - 1 OR ListB(XList).BW <= 0 THEN IF ListB(XList).Col > 1 THEN S = S + ListB(XList).BH ELSE S = S + 1: I = B
          END IF
          IF ContObj = 4 THEN
            IF KeyCode = 13 THEN XComExit = 2: KeyCode = 0
            IF KeyCode = 27 THEN XComExit = 1: KeyCode = 0
          END IF
          ListB(XList).Index = I: ListB(XList).ScInx = S
          IF I > -1 THEN C.ListKeyPress RecWins, XList, KeyCode
        END IF
        RXL = XXL: XXX = 0
        FOR XL = LST TO LEND
          IF InitControl OR ContObj = -9 THEN
            PrintList XL, -1, 1, 0, -2, ListB(), ListI(), Win: IF ContObj = -9 THEN ContObj = 4
          ELSE
            X = ListB(XL).X + 2: Y = ListB(XL).Y + 2: W = (ListB(XL).BW * ListB(XL).Col) * 6 + ListB(XL).Col * 3: H = ListB(XL).BH * 14 + 1
            GotFocus XILIT, X, Y, W + 18, H, Mouse, Win
            IF RXL <> XL AND PK AND XILIT THEN ListB(XXL).RCount = -2
            IF (XILIT OR KeyCode = ListB(XL).Hotkey) AND ListB(XL).Count >= 0 AND XXX = 0 THEN
              IF (Mouse.K = 1 AND Mouse.RK = 0 OR KeyCode = ListB(XL).Hotkey) AND ContObj <> 4 THEN ContObj = 2: XList = XL
              GotFocus XLIL, X + W, Y, 18, H, Mouse, Win
              MY = Mouse.Y - (Win.Y + Y)
              MX = Mouse.X - (Win.X + X)
              IF XLIL THEN
                XSYY = -1
                XMS = ListB(XL).Count - ListB(XL).BH * ListB(XL).Col + 1
                IF XMS > 0 THEN
                  IF Mouse.K <> 1 AND Mouse.RK <> Mouse.K THEN PK = 0: MCNT = 0: NK = RNK: PR = 1:  EXIT FOR
                  IF Mouse.K = 1 AND Mouse.RK = 0 THEN
                    NK = 5: PK = 1
                    IF MY < 16 THEN NK = 2 ELSE IF MY > H - 14 THEN NK = 3
                    PR = 1: RTimeClick = TIMER: InitTime = .4
                    RNK = NK
                  END IF
                END IF
              ELSE
                IF RNK <> 0 AND Mouse.K <> 1 THEN RXL = XL: PK = 0: MCNT = 0: NK = 4: PR = 1: XSYY = -1: RNK = 0
                IF Mouse.K <> 0 AND Mouse.RK = 0 OR ContObj = 4 AND (XRMouseY <> Mouse.Y OR XRMouseX <> Mouse.X) THEN
                  IL = (MY - 1) \ 14: JL = (MX - 1) \ (ListB(XL).BW * 6 + 3)
                  IL = ListB(XL).ScInx + JL * ListB(XL).BH + IL
                  IF IL > ListB(XL).Count THEN IL = -1
                  ListB(XL).Index = IL: XRMouseY = Mouse.Y: XRMouseX = Mouse.X
                END IF
                IF Mouse.K = 1 AND Mouse.RK = 0 THEN
                  IF ContObj = 4 THEN
                    XComExit = 2
                  ELSE
                    IF Mouse.DC AND IL > -1 THEN C.ListDblClick RecWins, XL
                  END IF
                END IF
              END IF
              MCNT = 0
              IF Mouse.K = 1 AND (TIMER - RTimeClick > InitTime AND (RNK = 2 OR RNK = 3) OR RNK = 5) THEN MCNT = 1: RTimeClick = TIMER: InitTime = ListScrollSpeed / 10
              IF Mouse.K = 1 AND Mouse.RK = 0 OR MCNT THEN
                S = ListB(XL).ScInx
                IF RNK = 2 AND S > 0 THEN S = S - 1
                IF RNK = 5 THEN
                  XSYY = MY - 15
                  IF XSYY < 0 THEN XSYY = 0
                  IF XSYY <> XRY THEN PR = 1: XRY = XSYY
                END IF
                IF RNK = 3 AND S < XMS + -(ListB(XL).Col > 1) * (ListB(XL).BH - ListB(XL).Count MOD ListB(XL).BH - 1) THEN S = S + 1
                ListB(XL).ScInx = S
              END IF
              XXL = XL: XXX = 1
            ELSE
              IF RNK <> 0 THEN PK = 1
            END IF
            XPR = -1: XI = -1
            B = ListB(XL).Index <> ListB(XL).RIndex
            IF ListB(XL).Count <> ListB(XL).RCount THEN
              XPR = 4
            ELSEIF ListB(XL).ScInx <> ListB(XL).RScInx THEN
              XPR = 5
            ELSEIF B THEN
              XI = ListB(XL).RIndex
              XPR = 0
            END IF
            IF XPR > -1 THEN PrintList XL, XI, XPR, 0, -1, ListB(), ListI(), Win: A = ListB(XL).RIndex: ListB(XL).RIndex = XI: C.ListChange RecWins, XL, XPR: ListB(XL).RIndex = A
            IF B AND ListB(XL).Index > -1 THEN C.ListClick RecWins, XL
          END IF
        NEXT
        IF XXX = 0 AND PK THEN PR = 1: PK = 0: NK = RNK: XRY = -1: MCNT = 0: RNK = 0
        IF PR AND RXL <= LEND THEN
          RScInx = ListB(RXL).ScInx
          PrintList RXL, -2, NK, PK, XSYY, ListB(), ListI(), Win: PR = 0
          IF RScInx <> ListB(RXL).ScInx THEN C.ListChange RecWins, RXL, 9
        END IF
        IF XXX = 0 AND ContObj = 4 AND Mouse.K = 1 AND Mouse.RK = 0 THEN XComExit = 1
        IF XComExit AND Mouse.K = 0 THEN
          IF XComExit = 1 OR ListB(LEND).Index < 0 THEN ListB(LEND).Index = XComIndex: XComExit = 0
          IF XComExit = 2 THEN SetCombo XCombo, (ListB(LEND).Index)
          ContObj = 5: Mouse.RK = 0
          MouseHide
          PutTX Win.X + Combo(XCombo).X, XCOMY, 0
          MouseShow
          PrintCombo XCombo, 4, 0, Combo(), ComboTXT(), Win
          IF XComExit = 2 THEN C.ComboClick RecWins, XCombo
          XComExit = 0
          LST = 0: LEND = SumList
        END IF
        IF ContObj <> 4 THEN
          FOR T = 0 TO SumLabel
            IF LabelCap(T) <> LabelRCap(T) OR InitControl THEN PrintLabel T, Label(), LabelCap(), LabelRCap(), Win
          NEXT
          FOR T = 0 TO SumOptG
            FOR L = 0 TO SumOptI(T)
              IF OptB(T, L).Enabled <> OptB(T, L).REnabled OR InitControl THEN PrintOption T, L, 11, OptB(), OptBRValue(), OptBValue(), OptBCap(), Win, SumOptI()
              GotFocus I, (OptB(T, L).X), (OptB(T, L).Y), LEN(OptBCap(T, L)) * 6 + 16, 12, Mouse, Win
              IF (I AND Mouse.K = 1 AND Mouse.RK = 0 OR KeyCode = OptB(T, L).Hotkey) AND OptB(T, L).Enabled THEN
                OptBValue(T) = L
                ContObj = 1
              END IF
            NEXT
            IF OptBValue(T) <> OptBRValue(T) THEN
              PrintOption T, -1, 0, OptB(), OptBRValue(), OptBValue(), OptBCap(), Win, SumOptI()
              C.OptionClick RecWins, T, (OptBValue(T))
            END IF
          NEXT
          FOR L = 0 TO SumCheck
            IF Check(L).Enabled <> Check(L).REnabled OR InitControl THEN PrintCheck L, 11, Check(), CheckCap(), Win
            GotFocus I, (Check(L).X), (Check(L).Y), LEN(CheckCap(L)) * 6 + 16, 12, Mouse, Win
            IF (I AND Mouse.RK = 1 AND Mouse.K = 0 OR KeyCode = Check(L).Hotkey) AND Check(L).Enabled THEN
              Check(L).Value = NOT Check(L).Value
              ContObj = 6
            END IF
            IF Check(L).Value <> Check(L).RValue THEN
              PrintCheck L, 0, Check(), CheckCap(), Win
              C.CheckClick RecWins, L
            END IF
          NEXT
          FOR A = 0 TO SumFrame
            GotFocus I, (Frame(A).X), (Frame(A).Y), (Frame(A).W), (Frame(A).H), Mouse, Win
            IF I THEN
              IF Frame(A).GF = 0 THEN Frame(A).GF = -1: C.FrameMouseInOut RecWins, A, 1
              IF Mouse.X <> Mouse.RX OR Mouse.Y <> Mouse.RY OR Mouse.K <> 0 OR Mouse.RK <> Mouse.K THEN C.FrameMouseState RecWins, A, (Mouse.X - Win.X - Frame(A).X), (Mouse.Y - Win.Y - Frame(A).Y), (Mouse.K)
              IF Mouse.DC THEN
                C.FrameDblClick RecWins, A
              ELSEIF Mouse.K = 0 AND Mouse.RK <> 0 THEN
                C.FrameClick RecWins, A, (Mouse.RK)
              END IF
              'EXIT FOR
            ELSE
              IF Frame(A).GF THEN Frame(A).GF = 0: C.FrameMouseInOut RecWins, A, 0
            END IF
          NEXT
          FOR XLCOM = 0 TO SumCombo
            IF Combo(XLCOM).Enabled <> Combo(XLCOM).REnabled OR InitControl THEN PrintCombo XLCOM, 1, 0, Combo(), ComboTXT(), Win
            X = Combo(XLCOM).X: Y = Combo(XLCOM).Y: W = (Combo(XLCOM).BW) * 6
            IF Combo(XLCOM).G3D > 0 THEN A = 1 ELSE A = 0
            GotFocus I, X + A * (W + 7), Y + 1, (1 - A) * W + 23 - A * 5, 21, Mouse, Win
            IF (I AND Mouse.K = 1 AND Mouse.RK = 0 OR KeyCode = ListB(SumList + XLCOM + 1).Hotkey) AND Combo(XLCOM).Enabled THEN
              PrintCombo XCombo, 3, 0, Combo(), ComboTXT(), Win
              MouseHide
              GetTX Win.X + X, XCOMY, W + 25, H - 22, 0
              MouseShow
              PrintCombo XLCOM, 2, 1, Combo(), ComboTXT(), Win
              ContObj = -9: XCombo = XLCOM
              A = SumList + XLCOM + 1: XList = A
              ListB(A).BH = ListB(A).Count + 1: IF ListB(A).BH > 8 THEN ListB(A).BH = 8
              IF ListB(A).BH < 2 THEN ListB(A).BH = 1
              LST = A: LEND = A: XComIndex = ListB(A).Index
              H = ListB(A).BH * 14 + 2
              B = Combo(XLCOM).G3D <> 0
              XCOMY = Win.Y + Y + 18 - B
              IF XCOMY + H > 455 THEN XCOMY = XCOMY - H - 20 + B * 2
              ListB(A).BW = Combo(XCombo).BW
              ListB(A).Col = (ListB(A).Count \ ListB(A).BH) + 1
              IF ListB(A).Col > Combo(XLCOM).Col THEN ListB(A).Col = Combo(XLCOM).Col
              B = ListB(A).BW * ListB(A).Col * 6 + 20 + (ListB(A).Col - 1) * 3
              ListB(A).X = Combo(XCombo).X
              IF ListB(A).X + B + Win.X + 3 > 640 THEN ListB(A).X = 640 - B - Win.X - 3
              ListB(A).Y = XCOMY - Win.Y
              IF RContObj = 3 THEN PrintText XInpText, 3, 0, Text(), TextTXT(), Win, CutBoard, 1
              MouseHide
              DrawBackBlock Win.X + ListB(A).X, Win.Y + ListB(A).Y, B, H, 5
              MouseShow
              C.ComboClick RecWins, -XCombo - 1
            END IF
          NEXT
        END IF
      END IF
    END IF
    InitControl = 0
    IF ExitWin THEN
      IF RecWins < 0 THEN EXIT DO
      A = 0
      C.FormUnload RecWins, A
      IF A = 0 THEN
        IF Wins = RecWins THEN
          B = ASC(MID$(Win.RetWins, 1, 1))
          IF B <= 1 THEN UnLoadMe
          Wins = ASC(MID$(Win.RetWins, B, 1))
          B = B - 2
          IF B < 0 THEN B = 0
          MID$(Win.RetWins, 1, 1) = CHR$(B)
        END IF
        EXIT DO
      ELSE
        ExitWin = 0: Wins = RecWins
      END IF
    END IF
  LOOP
  MouseHide
END SUB
SUB SetCombo (Inx, InxNo)
  A = Inx + SumList + 1
  ListB(A).Index = InxNo
  IF InxNo < 0 THEN ComboTXT(Inx) = "" ELSE ComboTXT(Inx) = ListI(A, InxNo)
  Combo(Inx).REnabled = 2
END SUB

QQ截图未命名.gif (20.84 KB, 下载次数: 55)

QQ截图未命名.gif
2#
发表于 2010-4-7 13:57:25 | 只看该作者
高人啊,看不懂写的什么啊。
回复

使用道具 举报

3#
发表于 2010-4-7 14:54:35 | 只看该作者
一点看不懂。



回复

使用道具 举报

4#
发表于 2010-4-7 17:51:02 | 只看该作者
您可以去看看研究相关

QB-F9一键备份恢复-【IMAGE FOR DOS】版
http://bbs.wuyou.net/forum.php?m ... p;page=1&extra=

想拥有自己的一键恢复吗?自己编写程序!(更新 附上源代码)
http://bbs.wuyou.net/forum.php?m ... D6%B8%B4&page=1
回复

使用道具 举报

5#
发表于 2010-4-7 20:56:59 | 只看该作者
啊?楼主学会了后能不能给我些点QB呀?我想充个QQ会员玩玩!
回复

使用道具 举报

6#
 楼主| 发表于 2010-4-8 10:10:22 | 只看该作者
已经会调用GHOST批处理命令了 现在求怎么实现密码功能 不输入密码 备份就为灰色不可用状态
回复

使用道具 举报

7#
发表于 2010-5-27 09:40:00 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

8#
发表于 2010-6-5 12:30:53 | 只看该作者
这怎没弄啊!好难啊。。。。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|捐助支持|无忧启动 ( 闽ICP备05002490号-1 )

闽公网安备 35020302032614号

GMT+8, 2024-12-3 00:56

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表