还有,在里面如何调用shellexecute这个函数来执行一个程序?
我在uses里加入shellapi,
在程序里使用  
ShellExecute(handle,'open','http://www.csdn.net',nil,nil,sw_shownormal);编译的时候提示[Error] Project1.dpr(6): Undeclared identifier: 'handle'
[Error] Project1.dpr(6): Undeclared identifier: 'sw_shownormal'如何解决?

解决方案 »

  1.   

    ShellExecute(0,'open','http://www.csdn.net',nil,nil,sw_shownormal);
    [Error] Project1.dpr(6): Undeclared identifier: 'sw_shownormal'
    错误是因为sw_shownormal没有定义
      

  2.   

    你找到sw_shownormal的值不就完了?
      

  3.   

    你有矛盾:整个包含某unit则文件太大,不包含则无法使用这个功能。
    解决办法:把那个unit中你需要的部分copy出来,放到你自己的unit之中或单独做一个自己的小的unit。
      

  4.   

    sw_shownormal在Windows.pas中定义,值为1
      

  5.   

    在Console Application程序里,不使用Forms单元,如何得到当前运行程序自身文件名?答:
    ParamStr(0)
      

  6.   

    那[Error] Project1.dpr(6): Undeclared identifier: 'handle'  呢?
      

  7.   

    把handle用0代替就可以了!sw_show=5,sw_shownormal=1。
    改称:
    shellexecute(0,'open','http://www.csdn.net',nil,nil,1);
    即可,不过这样的话,所有的URL会在同一个窗口中打开。