نمایش نتایج 1 تا 3 از 3

نام تاپیک: ساختن ShortCut

  1. #1

    ساختن ShortCut

    سلام

    می خواستم بدونم کسی از داخل فاکس پرو بلده Shortcut بساز یعنی با دستورات؟
    ____________________________
    همه چیز را همگان دانند و همگان هنوز از مادر زاده نشده اند. (بزرگمهر حکیم)

  2. #2
    راه اول

    ---------------------------------------------------------------------------------------
    * DCC - This program assumes that you have passed a correct Target Path and Short cut name.
    * DCC - This program is merely for demonstration purposes. There are no guarantees that this code is bug free and
    * DCC - it should be treated as such.

    * DCC - Sample call DO CreateShortCut WITH "Notepad.lnk", "notepad.exe"
    * DCC - Sample call DO CreateShortCut WITH "Microsoft Web Site.URL", "http://www.microsoft.com"

    LPARAMETERS tcShortCutName, tcTargetPath
    LOCAL lcxDirectory, loWshShell, loShortCut, llNormalShortCut

    * DCC - Save current directory.
    lcxDirectory = SET("Directory")

    * DCC - Get extension. Determine if this is a URL shortcut or a normal (lnk) shortcut.
    lcExt = UPPER( ALLTRIM( JUSTEXT( tcShortCutName ) ) )
    llNormalShortCut = ( lcExt == "LNK" )

    * DCC - Create your windows scripting host (WSH) shell to enable a move to the desk top directory
    loWshShell = CreateObject( "WScript.Shell" )
    SET DIRECTORY TO (loWshShell.SpecialFolders("Desktop"))

    * DCC - Use your WSH object to create your shortcut.
    loShortCut = loWshShell.CreateShortcut( tcShortCutName )
    * DCC - Set your properties and save the shortcut
    loShortCut.TargetPath = tcTargetPath

    * DCC - The following properties are only available for normal short cuts.
    IF llNormalShortCut

    * DCC - Below are other properties and examples of setting them.
    loShortCut.IconLocation = "notepad.exe, 0"
    loShortCut.Description = "Currently running script."
    loShortCut.Hotkey = "ALT+CTRL+F"
    loShortCut.WindowStyle = 7 && minimized
    loShortCut.WorkingDirectory = "c:\"

    * DCC - Display full path of the executable
    ?loShortCut.Fullname

    ENDIF

    * DCC - Must save the short cut. The short cut saves in the current directory, which is why we moved to the directory
    * DCC - prior to creating the shortcut.
    loShortCut.Save

    * DCC - Now move back to your starting directory
    SET DIRECTORY TO (lcxDirectory)
    ---------------------------------------------------------------------------------------
    راه دوم
    --------------------------------------------------------------------------------------

    *!* CreateStartupShortcut.PRG
    *!*
    *!* Adapted from Microsoft Knowledgebase Article Q244677
    *!* http://support.microsoft.com/default...;EN-US;q244677
    *!*
    *!* For using the Windows Script Host, please read the excellent series
    *!* by George Tasker and Ed Rauh that is available at http://www.vfug.org.
    *!* The series started September, 2000.
    *!*
    *!* Nancy Folsom
    *!* Pixel Dust Industries
    *!* http://www.pixeldustindustries.com
    *!*
    *!* 2002.03.07
    *!*
    #DEFINE SC_MAXIMIZED 3
    #DEFINE SC_MINIMIZED 7
    #DEFINE SC_NORMAL 4

    #IF VERSION() = "Visual FoxPro 06.00.8961.00 for Windows"
    LOCAL ;
    loWsh, ;
    lcFolder, ;
    loShortCut, ;
    lcAppPath
    #ELSE
    LOCAL ;
    loWsh AS Wscript.SHELL, ;
    lcFolder, ;
    loShortCut, ;
    lcAppPath
    #ENDIF

    *!* Create the Windows Script Host
    loWsh = CREATEOBJECT("Wscript.shell")

    *!* Locate the user's start up folder
    lcFolder = loWsh.SpecialFolders("StartUp")

    *!* Create a shortcut object
    loShortCut= loWsh.CreateShortcut(lcFolder + "\POS.lnk")

    *!* Set the properties of the shortcut. Note that no error occurs if
    *!* one of the parameters is wrong. The shortcut just won't be saved.
    *!* Also, if the shortcut already exists, it will be overwritten w/o
    *!* warning.
    *!*
    lcAppPath = FULLPATH(CURDIR()) && For example
    lcAppName = "MyApp.EXE" && For example

    loShortCut.WorkingDirectory = lcAppPath
    loShortCut.TargetPath = '"' + lcAppPath + lcAppName + '"'
    loShortCut.IconLocation = loShortCut.TargetPath && Assumes built-in ICO
    loShortCut.WindowStyle = SC_MAXIMIZED

    loShortCut.HOTKEY = "ALT+CTRL+P" && For example

    *!* Save the shortcut
    loShortCut.SAVE()
    --------------------------------------------------------------------------------------

    آخرین ویرایش به وسیله rezaTavak : چهارشنبه 23 خرداد 1386 در 09:57 صبح
    در تندیس های تخت جمشید هیچ کس در حال تعظیم نیست ، هیچ کس عصبانی نیست ، هیچ کس سرافکنده و شکست خورده نیست ، هیچ کس سوار بر اسب نیست ، هیچ قومی بر قوم دیگر برتر نیست ، هیچ کس برده نیست و هیچ تصویر خشنی دیده نمیشود.
    ************************************************** ******************************************
    اندیشه کن , آنگاه سخن گو تا از لغزش بر کنار باشی

  3. #3
    سلام

    ممنون. :)
    ____________________________
    همه چیز را همگان دانند و همگان هنوز از مادر زاده نشده اند. (بزرگمهر حکیم)

تاپیک های مشابه

  1. shortcut برنامه درست کار نمی کنه
    نوشته شده توسط newdesign در بخش برنامه نویسی در Delphi
    پاسخ: 4
    آخرین پست: شنبه 28 آبان 1384, 12:08 عصر
  2. یک مشکل ساده با Shortcut های منو
    نوشته شده توسط Chabok در بخش VB.NET
    پاسخ: 0
    آخرین پست: شنبه 11 تیر 1384, 19:21 عصر
  3. کسی Dll را دارد که بتوان با آن از فایل Shortcut درست کرد
    نوشته شده توسط hedi در بخش برنامه نویسی در 6 VB
    پاسخ: 3
    آخرین پست: یک شنبه 29 خرداد 1384, 08:20 صبح
  4. SHORTCUT در تمام پروژه
    نوشته شده توسط SADAF در بخش مباحث عمومی دلفی و پاسکال
    پاسخ: 4
    آخرین پست: دوشنبه 16 تیر 1382, 11:12 صبح

قوانین ایجاد تاپیک در تالار

  • شما نمی توانید تاپیک جدید ایجاد کنید
  • شما نمی توانید به تاپیک ها پاسخ دهید
  • شما نمی توانید ضمیمه ارسال کنید
  • شما نمی توانید پاسخ هایتان را ویرایش کنید
  •