试试:
ShellExecute(
    HWND hwnd, 
    "open",
    "javac.exe", 
    "test.java", 
    "",
    SW_HIDE
);

解决方案 »

  1.   

    ShellExecute... ?
    不好意思,这个怎么用?好象不是WinAPI呀...
      

  2.   

    用WinExec("javac test.java",SW_HIDE).函数原型如下:
    UINT WinExec(
      LPCSTR lpCmdLine,  // command line
      UINT uCmdShow      // window style
    );
      

  3.   

    好象用WinExec也不行,还是出来那个讨厌的黑色控制台... :(