Jump to content

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


Photo

Get Console Process


  • Please log in to reply
8 replies to this topic

#1 netegg

netegg

    Prodigy

  • Active Members
  • PipPipPip
  • 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().

#3 netegg

netegg

    Prodigy

  • Active Members
  • PipPipPip
  • 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", $nNumberOfCharsToRead, _                 "dword", $tCoord, _                 "dword*", 0)     Else         $tBuffer = DllStructCreate("char[" & ($nNumberOfCharsToRead + 1) & "]")         $aResult = DllCall($hDll, "bool", "ReadConsoleOutputCharacterA", _                 "handle", $hConsoleOutput, _                 "ptr", DllStructGetPtr($tBuffer), _                 "dword", $nNumberOfCharsToRead, _                 "dword", $tCoord, _                 "dword*", 0)     EndIf     If @error Or (Not $aResult[0]) Then Return SetError(@error, @extended, "")     Return SetExtended($aResult[4], DllStructGetData($tBuffer, 1)) EndFunc   ;==>_Console_ReadConsoleOutputCharacter

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 :)

#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.

Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()LockFile()Mapping CtrlIDsParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...
Updated: 26/09/2014


#6 netegg

netegg

    Prodigy

  • Active Members
  • PipPipPip
  • 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.

Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()LockFile()Mapping CtrlIDsParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...
Updated: 26/09/2014


#8 Beege

Beege

    Universalist

  • MVPs
  • 895 posts

Posted 28 December 2011 - 08:24 AM

Thought that was strange.. :)

Nice function Mat.

#9 bladem2003

bladem2003

    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