Option Strict Off
Option Explicit On
Friend Class Form1
	Inherits System.Windows.Forms.Form
#Region "Windows Form Designer generated code "
	Public Sub New()
		MyBase.New()
		If m_vb6FormDefInstance Is Nothing Then
			If m_InitializingDefInstance Then
				m_vb6FormDefInstance = Me
			Else
				Try 
					'For the start-up form, the first instance created is the default instance.
					If System.Reflection.Assembly.GetExecutingAssembly.EntryPoint.DeclaringType Is Me.GetType Then
						m_vb6FormDefInstance = Me
					End If
				Catch
				End Try
			End If
		End If
		'This call is required by the Windows Form Designer.
		InitializeComponent()
	End Sub
	'Form overrides dispose to clean up the component list.
	Protected Overloads Overrides Sub Dispose(ByVal Disposing As Boolean)
		If Disposing Then
			If Not components Is Nothing Then
				components.Dispose()
			End If
		End If
		MyBase.Dispose(Disposing)
	End Sub
	'Required by the Windows Form Designer
	Private components As System.ComponentModel.IContainer
	Public ToolTip1 As System.Windows.Forms.ToolTip
	Public WithEvents Command3 As System.Windows.Forms.Button
	Public WithEvents Command2 As System.Windows.Forms.Button
	Public WithEvents Command1 As System.Windows.Forms.Button
	'NOTE: The following procedure is required by the Windows Form Designer
	'It can be modified using the Windows Form Designer.
	'Do not modify it using the code editor.
	<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
		Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(Form1))
		Me.components = New System.ComponentModel.Container()
		Me.ToolTip1 = New System.Windows.Forms.ToolTip(components)
		Me.ToolTip1.Active = True
		Me.Command3 = New System.Windows.Forms.Button
		Me.Command2 = New System.Windows.Forms.Button
		Me.Command1 = New System.Windows.Forms.Button
		Me.Text = "Test"
		Me.ClientSize = New System.Drawing.Size(226, 213)
		Me.Location = New System.Drawing.Point(4, 23)
		Me.StartPosition = System.Windows.Forms.FormStartPosition.WindowsDefaultLocation
		Me.Font = New System.Drawing.Font("Arial", 8!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
		Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
		Me.BackColor = System.Drawing.SystemColors.Control
		Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Sizable
		Me.ControlBox = True
		Me.Enabled = True
		Me.KeyPreview = False
		Me.MaximizeBox = True
		Me.MinimizeBox = True
		Me.Cursor = System.Windows.Forms.Cursors.Default
		Me.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.ShowInTaskbar = True
		Me.HelpButton = False
		Me.WindowState = System.Windows.Forms.FormWindowState.Normal
		Me.Name = "Form1"
		Me.Command3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
		Me.Command3.Text = "Status"
		Me.Command3.Size = New System.Drawing.Size(185, 49)
		Me.Command3.Location = New System.Drawing.Point(16, 72)
		Me.Command3.TabIndex = 2
		Me.Command3.Font = New System.Drawing.Font("Arial", 8!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
		Me.Command3.BackColor = System.Drawing.SystemColors.Control
		Me.Command3.CausesValidation = True
		Me.Command3.Enabled = True
		Me.Command3.ForeColor = System.Drawing.SystemColors.ControlText
		Me.Command3.Cursor = System.Windows.Forms.Cursors.Default
		Me.Command3.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Command3.TabStop = True
		Me.Command3.Name = "Command3"
		Me.Command2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
		Me.Command2.Text = "Zatrzymanie obsługi"
		Me.Command2.Size = New System.Drawing.Size(185, 49)
		Me.Command2.Location = New System.Drawing.Point(16, 128)
		Me.Command2.TabIndex = 1
		Me.Command2.Font = New System.Drawing.Font("Arial", 8!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
		Me.Command2.BackColor = System.Drawing.SystemColors.Control
		Me.Command2.CausesValidation = True
		Me.Command2.Enabled = True
		Me.Command2.ForeColor = System.Drawing.SystemColors.ControlText
		Me.Command2.Cursor = System.Windows.Forms.Cursors.Default
		Me.Command2.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Command2.TabStop = True
		Me.Command2.Name = "Command2"
		Me.Command1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
		Me.Command1.Text = "Uruchomienie obsługi"
		Me.Command1.Size = New System.Drawing.Size(185, 49)
		Me.Command1.Location = New System.Drawing.Point(16, 16)
		Me.Command1.TabIndex = 0
		Me.Command1.Font = New System.Drawing.Font("Arial", 8!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
		Me.Command1.BackColor = System.Drawing.SystemColors.Control
		Me.Command1.CausesValidation = True
		Me.Command1.Enabled = True
		Me.Command1.ForeColor = System.Drawing.SystemColors.ControlText
		Me.Command1.Cursor = System.Windows.Forms.Cursors.Default
		Me.Command1.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Command1.TabStop = True
		Me.Command1.Name = "Command1"
		Me.Controls.Add(Command3)
		Me.Controls.Add(Command2)
		Me.Controls.Add(Command1)
	End Sub
#End Region 
#Region "Upgrade Support "
	Private Shared m_vb6FormDefInstance As Form1
	Private Shared m_InitializingDefInstance As Boolean
	Public Shared Property DefInstance() As Form1
		Get
			If m_vb6FormDefInstance Is Nothing OrElse m_vb6FormDefInstance.IsDisposed Then
				m_InitializingDefInstance = True
				m_vb6FormDefInstance = New Form1()
				m_InitializingDefInstance = False
			End If
			DefInstance = m_vb6FormDefInstance
		End Get
		Set
			m_vb6FormDefInstance = Value
		End Set
	End Property
#End Region 
	
    Private Declare Function UruchomionoObslugeSprawdzarek Lib "spr_lan_vb.dll" (ByRef NrBledu As Integer, ByVal OpisBledu As String, ByVal ObslugaBarkodow As ObslugaSprawdzarekClass.XFunkcjaObslugiBarkodow, ByVal ObslugaStatusow As ObslugaSprawdzarekClass.XFunkcjaObslugiStatusow, ByVal ObslugaBledow As ObslugaSprawdzarekClass.XFunkcjaObslugiBledow) As Boolean
	Private Declare Sub ZatrzymanieObslugiSprawdzarek Lib "spr_lan_vb.dll" ()
	Private Declare Sub OdczytajStatus Lib "spr_lan_vb.dll" (ByVal AdresIP As String)
	Private Declare Sub WpiszTekstStaly Lib "spr_lan_vb.dll" (ByVal AdresIP As String, ByVal NrTekstu As Byte, ByVal TekstNaWyswietlacz As String, ByVal CzasWyswietlania As Byte)
	Private Declare Sub WpiszTekstReklamowy Lib "spr_lan_vb.dll" (ByVal AdresIP As String, ByVal NrTekstu As Integer, ByVal TekstNaWyswietlacz As String, ByVal CzasWyswietlania As Integer, ByVal SposobWyswietlania As Integer)
	Private Structure MojString
		<VBFixedArray(256)> Dim T() As Byte
		
		'UPGRADE_TODO: "Initialize" must be called to initialize instances of this structure. Click for more: 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1026"'
		Public Sub Initialize()
			'UPGRADE_WARNING: Lower bound of array T was changed from 1 to 0. Click for more: 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1033"'
			ReDim T(256)
		End Sub
	End Structure
	'UPGRADE_WARNING: Structure MojString may require marshalling attributes to be passed as an argument in this Declare statement. Click for more: 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1050"'
	Private Declare Function ZwrocString Lib "spr_lan_vb.dll" (ByRef AuthorName As MojString) As Integer
	Dim CzyUruchomionoObsluge As Boolean
	
	Private Sub Command1_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Command1.Click
		Dim NumerBledu As Integer
		Dim OpisBledu As String
        Dim Spr As New ObslugaSprawdzarekClass


		OpisBledu = "                                                                 "
		'UPGRADE_WARNING: Add a delegate for AddressOf FunkcjaObslugiBledow Click for more: 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1048"'
		'UPGRADE_WARNING: Add a delegate for AddressOf FunkcjaObslugiStatusow Click for more: 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1048"'
		'UPGRADE_WARNING: Add a delegate for AddressOf FunkcjaObslugiBarkodow Click for more: 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1048"'
        CzyUruchomionoObsluge = UruchomionoObslugeSprawdzarek(NumerBledu, OpisBledu, AddressOf Spr.FunkcjaObslugiBarkodow, AddressOf Spr.FunkcjaObslugiStatusow, AddressOf Spr.FunkcjaObslugiBledow)
	End Sub
	
	Private Sub Command2_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Command2.Click
		ZatrzymanieObslugiSprawdzarek()
		CzyUruchomionoObsluge = False
		
	End Sub
	
	Private Sub Command3_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Command3.Click
		
		If CzyUruchomionoObsluge Then
            Call OdczytajStatus("192.168.1.103")
			'Call WpiszTekstReklamowy("192.168.1.110", 0, "TEKST REKLAMOWY" & Chr$(10) & "NA WYSWIETLACZ" & Chr$(10), 5, 0)
		Else
			MsgBox("Nie uruchomiono obsługi sprawdzarek")
		End If
		
	End Sub
	'UPGRADE_WARNING: Form event Form1.Unload has a new behavior. Click for more: 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup2065"'
	Private Sub Form1_Closed(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Closed
		ZatrzymanieObslugiSprawdzarek()
		CzyUruchomionoObsluge = False
	End Sub
End Class