Click here to Skip to main content
15,902,842 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: making and recording call Pin
Dave Kreskowiak7-May-07 4:12
mveDave Kreskowiak7-May-07 4:12 
QuestionHow to detect if "My documents" or "Internet explorer" is dropped... Pin
re infecta5-May-07 23:47
re infecta5-May-07 23:47 
QuestionC to VB6 Pin
Alex_735-May-07 22:13
Alex_735-May-07 22:13 
AnswerRe: C to VB6 Pin
Christian Graus6-May-07 11:36
protectorChristian Graus6-May-07 11:36 
QuestionRe: C to VB6 Pin
Alex_736-May-07 21:02
Alex_736-May-07 21:02 
AnswerRe: C to VB6 Pin
Christian Graus7-May-07 1:08
protectorChristian Graus7-May-07 1:08 
General[Solved]Re: C to VB6 Pin
Alex_738-May-07 6:11
Alex_738-May-07 6:11 
QuestionLooping Problem - ArgumentOutOfRange - Processes Pin
InfectiousX5-May-07 20:55
InfectiousX5-May-07 20:55 
Hey guys,

Got a little problem...I created the program ConvertXBatch. (A batch utility for ConvertXtoDVD as it doesnt have its own batch functions.) Anyway, when you are converting a movie, it will display something like this in the title bar of ConvertXtoDVD.

"ConvertXtoDVD - 1.5%

Now I have written this stuff below, which is supposed to loop through all the processes till it finds the ConvertXtoDVD one..so..

1. Loop through processes searching for ConvertXtoDVD in the title..
2. When found store the ProcessID, set found to True.
3. Then parse the title so all I have left is the digit before the decimal point.
4. Update the progress bar.

Now, this is currently set at every 5 seconds because it uses alot of CPU every time it cycles through that loop. Now the only problem is when Found gets set to true, when a new instance starts of ConvertXtoDVD, it might (most likely) get a different processID, which then returns an ArgumentOutofRange Exception.

I did have the Found variable in the declaration part so that it only looped once on the first round...but that caused problems too..

Does anyone have any suggestions?


    Public Sub getPercent()
    Dim found As Boolean
    Dim id As Integer
    Dim temp As String = ""
    Dim percent As String = ""
    Dim proc2 As Process
    Dim progPercent As String = ""
    While Not found
        For Each proc2 In Process.GetProcesses
            If proc2.MainWindowTitle.Contains("ConvertXtoDVD") Then
                found = True
                id = proc2.Id
            End If
        Next
    End While
    If found Then
        proc2 = Process.GetProcessById(id)
        temp = ""
        temp = proc2.MainWindowTitle.Remove(0, 16)
        percent = temp.Remove(temp.Length - 1, 1)
        progPercent = percent.Remove(percent.Length - 2, 2)
        fileProgress.Value = progPercent
        Label1.Text = progPercent
    End If
End Sub



Basically, I would like it too loop once to find the processID, then next time it gets the percent it doesnt have to loop, it can use the processID.
This is on Windows Vista (UAC turned Off), Visual Studio 2005.
AnswerRe: Looping Problem - ArgumentOutOfRange - Processes Pin
Dave Kreskowiak6-May-07 5:06
mveDave Kreskowiak6-May-07 5:06 
QuestionMySql Login Pin
LegionFX5-May-07 11:59
LegionFX5-May-07 11:59 
AnswerRe: MySql Login Pin
Paul Conrad5-May-07 12:45
professionalPaul Conrad5-May-07 12:45 
GeneralRe: MySql Login Pin
LegionFX5-May-07 12:51
LegionFX5-May-07 12:51 
GeneralRe: MySql Login Pin
Paul Conrad5-May-07 13:22
professionalPaul Conrad5-May-07 13:22 
GeneralRe: MySql Login Pin
LegionFX6-May-07 0:42
LegionFX6-May-07 0:42 
GeneralRe: MySql Login Pin
Paul Conrad6-May-07 4:05
professionalPaul Conrad6-May-07 4:05 
AnswerRe: MySql Login Pin
P P Vilsad6-May-07 4:51
P P Vilsad6-May-07 4:51 
GeneralRe: MySql Login Pin
LegionFX6-May-07 9:17
LegionFX6-May-07 9:17 
GeneralRe: MySql Login Pin
LegionFX6-May-07 9:30
LegionFX6-May-07 9:30 
GeneralRe: MySql Login Pin
Paul Conrad6-May-07 16:50
professionalPaul Conrad6-May-07 16:50 
GeneralRe: MySql Login Pin
P P Vilsad7-May-07 0:44
P P Vilsad7-May-07 0:44 
Questionsearching about for mcpd exams(WINDOWs application) vb2005 Pin
saad badr5-May-07 10:56
saad badr5-May-07 10:56 
AnswerRe: searching about for mcpd exams(WINDOWs application) vb2005 Pin
Dave Kreskowiak6-May-07 4:41
mveDave Kreskowiak6-May-07 4:41 
AnswerRe: searching about for mcpd exams(WINDOWs application) vb2005 Pin
saad badr8-May-07 7:02
saad badr8-May-07 7:02 
GeneralRe: searching about for mcpd exams(WINDOWs application) vb2005 Pin
Dave Kreskowiak8-May-07 17:23
mveDave Kreskowiak8-May-07 17:23 
AnswerRe: searching about for mcpd exams(WINDOWs application) vb2005 Pin
Christian Graus6-May-07 11:38
protectorChristian Graus6-May-07 11:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.