home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / MThreadVB_882945292002.psc / Demo / Vote.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2002-05-30  |  2.8 KB  |  81 lines

  1. VERSION 5.00
  2. Begin VB.Form VDialog 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "Thanks for appreciating this code...."
  5.    ClientHeight    =   2385
  6.    ClientLeft      =   45
  7.    ClientTop       =   330
  8.    ClientWidth     =   4650
  9.    LinkTopic       =   "Form2"
  10.    MaxButton       =   0   'False
  11.    MinButton       =   0   'False
  12.    ScaleHeight     =   2385
  13.    ScaleWidth      =   4650
  14.    ShowInTaskbar   =   0   'False
  15.    StartUpPosition =   2  'CenterScreen
  16.    Begin VB.CommandButton Ok 
  17.       Caption         =   "&Go to Article Page"
  18.       Default         =   -1  'True
  19.       Height          =   390
  20.       Left            =   2625
  21.       TabIndex        =   0
  22.       Top             =   1245
  23.       Width           =   1950
  24.    End
  25.    Begin VB.Label Label2 
  26.       Caption         =   $"Vote.frx":0000
  27.       Height          =   810
  28.       Left            =   150
  29.       TabIndex        =   2
  30.       Top             =   300
  31.       Width           =   4365
  32.    End
  33.    Begin VB.Label Label1 
  34.       Caption         =   $"Vote.frx":00AA
  35.       Height          =   660
  36.       Left            =   30
  37.       TabIndex        =   1
  38.       Top             =   1680
  39.       Width           =   4635
  40.    End
  41. Attribute VB_Name = "VDialog"
  42. Attribute VB_GlobalNameSpace = False
  43. Attribute VB_Creatable = False
  44. Attribute VB_PredeclaredId = True
  45. Attribute VB_Exposed = False
  46. Private 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
  47. Private Declare Function FindExecutable Lib "shell32.dll" Alias "FindExecutableA" (ByVal lpFile As String, ByVal lpDirectory As String, ByVal lpResult As String) As Long
  48. Private Declare Function GetCurrentProcessId Lib "kernel32" () As Long
  49. Const SW_SHOWNORMAL = 1
  50. Const CodeID = 26900
  51. Private Sub Form_Load()
  52. Form1.ShowModalForm.Enabled = False
  53. Form1.ShowForm.Enabled = False
  54. End Sub
  55. Private Sub Form_Unload(Cancel As Integer)
  56. Form1.ShowModalForm.Enabled = True
  57. Form1.ShowForm.Enabled = True
  58. End Sub
  59. Private Sub Ok_Click()
  60.     GotoURL ("http://www.pscode.com/vb/scripts/ShowCode.asp?txtCodeId=26900&lngWId=1")
  61. End Sub
  62. Sub GotoURL(URL As String)
  63.     Dim Res As Long
  64.     Dim TFile As String, Browser As String, Dum As String
  65.     TFile = App.Path + "\test.htm"
  66.     Open TFile For Output As #1
  67.     Close
  68.     Browser = String(255, " ")
  69.     Res = FindExecutable(TFile, Dum, Browser)
  70.     Browser = Trim$(Browser)
  71.     If Len(Browser) = 0 Then
  72.         MsgBox "Cannot find browser"
  73.         Exit Sub
  74.     End If
  75.     Res = ShellExecute(Me.hwnd, "open", Browser, URL, Dum, SW_SHOWNORMAL)
  76.     If Res <= 32 Then
  77.         MsgBox "Cannot open web page"
  78.         Exit Sub
  79.     End If
  80. End Sub
  81.