frmDragTrash.frm
资源名称:IE_VB.rar [点击查看]
上传用户:davilee3
上传日期:2015-04-22
资源大小:986k
文件大小:6k
源码类别:
浏览器
开发平台:
Visual Basic
- VERSION 5.00
- Begin VB.Form frmDragTrash
- BorderStyle = 3 'Fixed Dialog
- ClientHeight = 3900
- ClientLeft = 45
- ClientTop = 45
- ClientWidth = 3375
- ControlBox = 0 'False
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- NegotiateMenus = 0 'False
- OLEDropMode = 1 'Manual
- ScaleHeight = 3900
- ScaleWidth = 3375
- ShowInTaskbar = 0 'False
- StartUpPosition = 3 'Windows Default
- Begin VB.Image imgBig
- BorderStyle = 1 'Fixed Single
- Enabled = 0 'False
- Height = 780
- Left = 1680
- Picture = "frmDragTrash.frx":0000
- Top = 840
- Width = 780
- End
- Begin VB.Image imgSmall
- BorderStyle = 1 'Fixed Single
- Enabled = 0 'False
- Height = 540
- Left = 480
- Picture = "frmDragTrash.frx":065D
- Top = 1200
- Width = 540
- End
- Begin VB.Menu mnuMainPop
- Caption = "MainPop"
- Visible = 0 'False
- Begin VB.Menu mnuSetup
- Caption = "设置"
- End
- Begin VB.Menu mnuBigIcon
- Caption = "大图标"
- End
- Begin VB.Menu mnuHide
- Caption = "隐藏"
- End
- End
- Begin VB.Menu mnuTextPop
- Caption = "TextPop"
- Visible = 0 'False
- Begin VB.Menu mnuNewTab
- Caption = "新窗口"
- End
- Begin VB.Menu mnuCloBord
- Caption = "收集板"
- End
- End
- Begin VB.Menu mnuFilePop
- Caption = "FilePop"
- Visible = 0 'False
- Begin VB.Menu mnuSave
- Caption = "保存"
- End
- Begin VB.Menu mnuSaveas
- Caption = "另存..."
- End
- End
- End
- Attribute VB_Name = "frmDragTrash"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Option Explicit
- Dim bX As Single, bY As Single
- Dim dragButton As Integer
- Private Sub Form_Load()
- Call Redraw(False)
- Me.Left = Screen.Width * 0.8
- Me.Top = Screen.Height * 0.2
- End Sub
- Private Sub Form_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
- bX = x: bY = y
- End Sub
- Private Sub Form_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
- If Button = vbLeftButton Then
- Me.Move Me.Left + x - bX, Me.Top + y - bY
- End If
- End Sub
- Private Sub Form_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
- If Button = vbRightButton Then Me.PopupMenu mnuMainPop
- End Sub
- Private Sub Form_OLEDragDrop(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, x As Single, y As Single)
- Dim dataFormat As Integer
- If Data.GetFormat(vbCFFiles) Then
- dataFormat = 1
- ElseIf Data.GetFormat(vbCFText) Then
- dataFormat = 2
- Else
- dataFormat = 0
- End If
- If dragButton = vbRightButton Or (dragButton = vbLeftButton And Shift = vbShiftMask) Then
- If dataFormat = 1 Then
- Me.PopupMenu mnuFilePop
- ElseIf dataFormat = 2 Then
- Me.PopupMenu mnuTextPop
- End If
- ElseIf dragButton = vbLeftButton Then
- If dataFormat = 1 Then
- Call SaveDragFile(Data.Files(1))
- ElseIf dataFormat = 2 Then
- If Shift = 0 Then
- MDIFrmMain.NewWebbrowser Data.GetData(vbCFText)
- ElseIf Shift = vbCtrlMask Then
- Clipboard.SetText Data.GetData(vbCFText)
- End If
- End If
- End If
- End Sub
- Private Sub Form_OLEDragOver(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, x As Single, y As Single, State As Integer)
- dragButton = Button
- End Sub
- Private Sub mnuBigIcon_Click()
- mnuBigIcon.Checked = Not mnuBigIcon.Checked
- Call Redraw(mnuBigIcon.Checked)
- End Sub
- Private Sub mnuHide_Click()
- Me.Hide
- End Sub
- Private Sub SaveDragFile(nFile As String)
- Dim nfs As New nFileSysObj
- Dim tPath As String
- Dim tFN As String
- Dim ggPos As Integer
- Dim destF As String
- If Not nfs.nFolderExists(DragDropSaveImageFolder) Then
- Call BrowseForFolder(tPath, "请选择保存路径", Me.hwnd)
- End If
- If tPath <> "" Then DragDropSaveImageFolder = tPath
- If nfs.nFolderExists(DragDropSaveImageFolder) Then
- If nfs.nFileExists(nFile) Then
- ggPos = InStrRev(nFile, "")
- tFN = Mid(nFile, ggPos + 1)
- destF = DragDropSaveImageFolder & "" & tFN
- While nfs.nFileExists(destF)
- tFN = "1_" & tFN
- destF = DragDropSaveImageFolder & "" & tFN
- Wend
- Call FileCopy(nFile, destF)
- Else
- MsgBox "源文件" & Chr(13) & nFile & Chr(13) & _
- "不存在,本次操作取消", vbOKOnly + vbInformation
- End If
- Else
- MsgBox "选择的路径" & Chr(13) & DragDropSaveImageFolder & Chr(13) & _
- "有问题,本次操作取消", vbOKOnly + vbInformation
- End If
- End Sub
- Private Sub mnuSetup_Click()
- frmOption.Show vbModal, Me
- End Sub
- Private Sub Redraw(big As Boolean)
- Dim hideImg As Image, showImg As Image
- If big Then
- Set hideImg = imgSmall
- Set showImg = imgBig
- Else
- Set hideImg = imgBig
- Set showImg = imgSmall
- End If
- hideImg.Visible = False
- showImg.Visible = True
- showImg.Left = 0
- showImg.Top = 0
- Me.Width = Me.Width - Me.ScaleWidth + showImg.Width
- Me.Height = Me.Height - Me.ScaleHeight + showImg.Height
- End Sub