windows-ce - Windows CE 上的 isatty

标签 windows-ce

Windows CE 上是否有与 isatty() 等效的函数?换句话说,有没有办法在代码中检测 stdin/stdout/stderr 是否已重定向?

最佳答案

您可以调用 GetStdIoPath(它在 coredll.dll 中 - MSDN 中没有记录它,我不确定它是否在任何 SDK header 中,但您始终可以手动将其声明为 extern,链接器会找到它)。

这是我的 C# 版本 - 如果需要,您可以轻松地将其移植回 C:

[DllImport("coredll.dll", SetLastError = true)]
public static extern int GetStdioPath(StdIoStream id, StringBuilder pwszBuf, int lpdwLength);

public enum StdIoStream
{
    Input = 0,
    Output = 1,
    ErrorOutput = 2
}

关于windows-ce - Windows CE 上的 isatty,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/926865/

相关文章:

c# - 在wince上用c#静默运行命令行程序

c# - CE 6.0/.NET CF 3.5 应用程序遇到严重错误 (MC3100)

c++ - WinCE 6.0 : Customizing Control Panel (cplmain)

installation - Windows CE 6.0 - 将 SQL Server CE 3.5 安装到运行时镜像中

.NET 与 Honeywell D6X00 Platform SDK 集成(用于个人数字助理 - Dolphin 6500 移动数据终端应用程序开发)

winapi - 什么是 alphablend,它使用了哪些功能?

c++ - 如何选择音频输入设备并在 directshow 中捕获音频

python - 无法通过 ERROR_INVALID_HANDLE 关闭套接字句柄 (6)

c - 如何使窗口不透明?

javascript - ActiveX html 控件不调用代码