如何调用外部程序,并把外部程序的界面放到我的界面上

 所属目录:Java   |   类型:技术问答   |   时间:2007-05-21
 问题:

首先打开外部程序,例如记事本.  
  并把外部程序的界面放到我的界面的某一区域,例如某个panel上.

· 网友精彩回答:

发表者:copyfree

 
  [dllimport("user32.dll",   entrypoint="findwindow")]  
  public   static   extern   int   findwindow(string   lpclassname,   string   lpwindowname);  
   
  [dllimport("user32.dll",   entrypoint="setparent")]  
  public   static   extern   int   setparent(int   hwndchild,   int   hwndnewparent);  
   
  private   void   button1_click(object   sender,   system.eventargs   e)  
  {  
  int   hwnd   =   0;  
  hwnd   =   findwindow("notepad",   "无标题   -   记事本");  
   
  if   (hwnd   >   0)  
  {  
  setparent(hwnd,   this.handle.toint32());  
  }  
  else  
  {  
  messagebox.show("handle   is   null!");  
  }  
  }  
 

.
处理 SSI 文件时出错
© 2006-2008 All Rights Reserved