This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X

# Get Console Process

8 replies to this topic

### #1 netegg

netegg

Prodigy

• Active Members
• 159 posts

Posted 28 December 2011 - 04:27 AM

how can I get the progress in console ----- the number of the points ?
sorry for title

Edited by netegg, 28 December 2011 - 05:44 AM.

### #2 Beege

Beege

Universalist

• MVPs
• 895 posts

Posted 28 December 2011 - 06:40 AM

To get any info from a console you would need to be reading the stdout stream of it. Use StdoutRead().

UDF's

|

Programs

"Only those who have the patience to do simple things perfectly will acquire the skill to do difficult things easily" - Johann von Schiller

### #3 netegg

netegg

Prodigy

• Active Members
• 159 posts

Posted 28 December 2011 - 07:51 AM

i got it!
Plain Text
```Func _Console_ReadConsoleOutputCharacter(\$hConsoleOutput, \$nNumberOfCharsToRead, \$iX, \$iY, \$fUnicode = Default, \$hDll = -1)
Local \$tCoord, \$tBuffer, \$aResult,
If \$fUnicode = Default Then \$fUnicode = \$__gfUnicode
If \$hDll = -1 Then \$hDll = DllOpen("kernel32.dll")
If \$hConsoleOutput = -1 Then \$hConsoleOutput = _Console_GetStdHandle(\$STD_OUTPUT_HANDLE, \$hDll)
\$tCoord = BitShift(\$iY, -16) + \$iX
If \$fUnicode Then
\$tBuffer = DllStructCreate("wchar[" & (\$nNumberOfCharsToRead + 1) & "]")
\$aResult = DllCall(\$hDll, "bool", "ReadConsoleOutputCharacterW", _
"handle", \$hConsoleOutput, _
"ptr", DllStructGetPtr(\$tBuffer), _
"dword", \$tCoord, _
"dword*", 0)
Else
\$tBuffer = DllStructCreate("char[" & (\$nNumberOfCharsToRead + 1) & "]")
\$aResult = DllCall(\$hDll, "bool", "ReadConsoleOutputCharacterA", _
"handle", \$hConsoleOutput, _
"ptr", DllStructGetPtr(\$tBuffer), _
"dword", \$tCoord, _
"dword*", 0)
EndIf
If @error Or (Not \$aResult[0]) Then Return SetError(@error, @extended, "")
Return SetExtended(\$aResult[4], DllStructGetData(\$tBuffer, 1))

Edited by netegg, 28 December 2011 - 07:53 AM.

### #4 Beege

Beege

Universalist

• MVPs
• 895 posts

Posted 28 December 2011 - 08:07 AM

Wasn't expecting that. Nice function

UDF's

|

Programs

"Only those who have the patience to do simple things perfectly will acquire the skill to do difficult things easily" - Johann von Schiller

### #5 guinness

guinness

all-consuming swarm in inconspicuous disguise

• Developers
• 17,683 posts

Posted 28 December 2011 - 08:14 AM

netegg,

Next time when you post code please post a link to where you got it from because you're going to cause problems in the future, for example 'netegg why doesn't the code work and where can I find the variable \$__gfUnicode?'

_Console_ReadConsoleOutputCharacter by Mat and you need his Console.au3 UDF.

### #6 netegg

netegg

Prodigy

• Active Members
• 159 posts

Posted 28 December 2011 - 08:20 AM

netegg,

Next time when you post code please post a link to where you got it from because you're going to cause problems in the future, for example 'netegg why doesn't the code work and where can I find the variable \$__gfUnicode?'

_Console_ReadConsoleOutputCharacter by Mat and you need his Console.au3 UDF.

Sorry! I remember!

### #7 guinness

guinness

all-consuming swarm in inconspicuous disguise

• Developers
• 17,683 posts

Posted 28 December 2011 - 08:21 AM

OK, thanks.

### #8 Beege

Beege

Universalist

• MVPs
• 895 posts

Posted 28 December 2011 - 08:24 AM

Thought that was strange..

Nice function Mat.

UDF's

|

Programs

"Only those who have the patience to do simple things perfectly will acquire the skill to do difficult things easily" - Johann von Schiller

Seeker

• Active Members
• 21 posts

Posted 06 March 2012 - 10:58 PM

@netegg

can you post your solution for DISM?

#### 0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users