网站推广,网站提供网站推广、免费网络推广、网络推广研究、网络推广、免费网站推广、网络推广培训、网络推广软件、网络推广工具、交换连接、行业网站推广、地域网站推广,提供功能强大的免费推广服务.

如何实现在桌面上添加程序的快捷方式?

 假如程序为c:\program files\myprog\prog.exe,需加参数/para
   新键一个项目,添加命令按钮和标签各一个,把下面的代码加上去,一运行,你将如愿以偿!

option explicit
private sub command1_click()
  creategroup "myprog", "", "", 2, true
  creategroup "myprog", "c:\programfiles\myprog\prog.exe/para", _
   "para", 3, true
end sub
sub creategroup(byval strgroup as string, byval strcmd as string, byval _
strtitle as string, byval intdde as integer, byval flog as boolean)
  const strcomma$ = ","
  const strrestore$ = ", 1)]"
  const stractivate$ = ", 5)]"
  const strendcmd$ = ")]"
  const strshowgrp$ = "[showgroup("
  const straddgrp$ = "[creategroup("
  const strreplitem$ = "[replaceitem("
  const stradditem$ = "[additem("

  dim i as integer
  dim sourcefile as string, destinationfile as string

  form1.label1.linkmode = 0
  for i% = 1 to 20
    on error resume next
    form1.label1.linktopic = "progman|progman" '设置发送端应用程序和主题
    if err = 0 then exit for

    doevents
  next
  form1.label1.linkmode = 2 '采用手动方式建立连接
  for i% = 1 to 10
    doevents
  next
  form1.label1.linktimeout = 100 '设置等待 dde 响应消息的时间。

  if err = 0 then
    select case intdde
     case 1 '建立程序项
       form1.label1.linkexecute straddgrp & strgroup & strendcmd
       form1.label1.linkexecute stradditem & strcmd & strcomma & _
        strtitle & string$(3, strcomma) & strendcmd
     case 2 '建立程序组
       form1.label1.linkexecute straddgrp & strgroup & strendcmd
       form1.label1.linkexecute strshowgrp & strgroup & strrestore
     case 3 '建立程序项,并复制一份添加到桌面
       form1.label1.linkexecute straddgrp & strgroup & strendcmd
       form1.label1.linkexecute stradditem & strcmd & strcomma & _
        strtitle & string$(3, strcomma) & strendcmd
       sourcefile = "c:\windows\start menu\programs\" & strgroup & _
        "\" & strtitle & ".lnk" ' 指定源文件名。
       destinationfile = "c:\windows\desktop\" & strtitle & ".lnk"
                 '指定目的文件名。
       filecopy sourcefile, destinationfile
    end select
  end if

  '断开dde联接
  form1.label1.linkmode = 0
  form1.label1.linktopic = ""
end sub