-1

So i am working on a project to create a screenlocker for a company using belgian eID. I am using a second program without interface to check wether someone has closed it and the program will restart when it did. The problem right now is that i can't seem to shut the 2nd program down when i put the eID in(i'm using the eID wrapper from jdt from github)

i looked it up but so far found 0 answers to my problem. The 2nd program uses a timer and checks every so often if the eID is still plugged in.

Now when i plug my eID in the main form (the screenlock) should shutdown but it doesnt it will close down and all but after a few seconds when the timer from the 2nd program is checking it starts it up again even though i wrote some code that shuts down the timer and exits the application.

I can provide code if someone needs it. It would mean the world if someone could help me with this as this has been a persistent problem for a few days now. Thanks in advance

1 Answers1

0

Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles tmrProcess.Tick teller += 1

    If teller Mod 75 = 0 Then
        data = wrapper.GetCardData()
        If Not data.FirstCard Is Nothing Then
            tmrProcess.Stop()
            Application.Exit()
            tmrProcess.Enabled = False


        End If
    End If
    Me.Hide()
    If teller Mod 10 = 0 Then

        Dim p() As Process
        p = Process.GetProcessesByName("zScreenLocker")
        If p.Count > 0 Then
            lstHowBoDah.Items.Add("Process is running")

        Else
            lstHowBoDah.Items.Add("Process is not running")
            Process.Start("\\secr14fs\Users$\fabian.lagaeysse\Documents\Visual Studio 2015\Projects\zScreenLocker\zScreenLocker\bin\Debug\zScreenLocker.exe")
            Me.Close()


        End If
    End If
End Sub

this is what i currently use. The reason i used both process.stop and timer.enable = false is because none of them work. I tried everything yet the timer keeps going and reopening the program. It's getting frustrating