name22

Console: StdoutRead OEM to ANSI/Char

Jul 16th, 2013
127
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $iPID = Run(@ComSpec & " /c ping 127.0.0.1",  @ScriptDir, @SW_HIDE, 0x2)
  2.  
  3. While True
  4.     $sOUT = StdoutRead($iPID)
  5.     If @error Then ExitLoop
  6.     If @extended Then
  7.         $sANSI = _OemToChar($sOUT)
  8.         ConsoleWrite($sANSI)
  9.     EndIf
  10. WEnd
  11.  
  12. Func _OemToChar($sOEM_Str)
  13.     $aRet = DllCall("user32.dll", "bool", "OemToChar", "str", $sOEM_Str, "str", "")
  14.  
  15.     If Not @error Then Return $aRet[2]
  16.     Return 0
  17. EndFunc
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×