mPub.bas
资源名称:IE_VB.rar [点击查看]
上传用户:davilee3
上传日期:2015-04-22
资源大小:986k
文件大小:3k
源码类别:
浏览器
开发平台:
Visual Basic
- Attribute VB_Name = "mPub"
- '---------------------------------------------------------------------------------------
- ' Module : mPub
- ' DateTime : 2005-8-19 15:06
- ' Author : Lingll
- ' Purpose :
- '---------------------------------------------------------------------------------------
- Option Explicit
- Public Declare Function GetWindowRect Lib "user32.dll" (ByVal hwnd As Long, ByRef lpRect As RECT) As Long
- Public Type RECT
- Left As Long
- Top As Long
- Right As Long
- Bottom As Long
- End Type
- Public Declare Function ScreenToClient Lib "user32.dll" (ByVal hwnd As Long, ByRef lpPoint As POINTAPI) As Long
- Public Type POINTAPI
- X As Long
- Y As Long
- End Type
- Public gLEInfo As ILEInfo
- Public Type TypeRssInfo
- Title As String
- Link As String
- ' Description As String
- End Type
- Public Type TypeRssGroup
- Title As String
- Count As Long
- Rssz() As TypeRssInfo '1 base
- End Type
- Public RssGroups() As TypeRssGroup '1 base
- Public RssGCnt As Long
- Public Function Mid2(nStr$, Optional Start& = 1, Optional Length&, Optional nEnd$) As String
- Dim tmpStr As String
- Dim tEndLen As Long
- 'Dim rtn$
- tmpStr = StrConv(nStr, vbFromUnicode)
- tEndLen = LenB(StrConv(nEnd, vbFromUnicode))
- If LenB(tmpStr) > Length + tEndLen Then
- Mid2 = Replace(StrConv(LeftB$(tmpStr, Length), vbUnicode), Chr(0), "") & nEnd
- Else
- Mid2 = nStr
- End If
- End Function
- '---------------------------------------------------------------------------------------
- ' Procedure : GetDefaultGroupIniPath
- ' DateTime : 2005-6-13 12:45
- ' Author : Lingll
- ' Purpose :
- '---------------------------------------------------------------------------------------
- Public Function GetDefaultGroupIniPath() As String
- Dim sResult As String
- sResult = App.Path
- If Right(sResult, 1) <> "" Then
- sResult = sResult & ""
- End If
- GetDefaultGroupIniPath = sResult & "RssGps.ini"
- End Function
- '---------------------------------------------------------------------------------------
- ' Procedure : AddEmptyGroup
- ' DateTime : 2005-6-13 21:24
- ' Author : Lingll
- ' Purpose : 添加空白组
- '---------------------------------------------------------------------------------------
- Public Sub AddEmptyGroup(gpName$)
- RssGCnt = RssGCnt + 1
- ReDim Preserve RssGroups(0 To RssGCnt)
- RssGroups(RssGCnt).Title = gpName
- End Sub
- '---------------------------------------------------------------------------------------
- ' Procedure : SaveGroup
- ' DateTime : 2005-6-13 12:43
- ' Author : Lingll
- ' Purpose :
- '---------------------------------------------------------------------------------------
- Public Sub SaveGroup(index&, Optional SaveTotalCount As Boolean = False)
- Dim tIni As cINIFile
- Dim i&
- Dim tSecName$
- If index > 0 And index <= RssGCnt Then
- Set tIni = New cINIFile
- tIni.IniFile = GetDefaultGroupIniPath
- If SaveTotalCount Then
- tIni.WriteKey "info", "count", Trim(Str(RssGCnt))
- End If
- tSecName = "Group_" & LTrim(Str(index))
- tIni.DeleteSection tSecName
- tIni.WriteKey tSecName, "GTitle", RssGroups(index).Title
- tIni.WriteKey tSecName, "Count", Trim(Str(RssGroups(index).Count))
- For i = 1 To RssGroups(index).Count
- tIni.WriteKey tSecName, "Title_" & LTrim(Str(i)), RssGroups(index).Rssz(i).Title
- tIni.WriteKey tSecName, "Url_" & LTrim(Str(i)), RssGroups(index).Rssz(i).Link
- Next i
- End If
- End Sub