B4J Library jShortcut

Discussion in 'B4J Libraries & Classes' started by DonManfred, Jan 16, 2016.

  1. DonManfred

    DonManfred Expert Licensed User

    This is a wrapper for this Github project. The jni involved is included in the lib download. Copy the content to the b4j additional libs folder.

    The aim of the library is to create shelllinks on windows.

    jShortcut
    Author:
    DonManfred (wrapper)
    Version: 1
    • ShellLink
      Methods:
      • Initialize (destpath As String, linkName As String, target As String)
      • Initialize2 (destpath As String, linkName As String, target As String, cmdArgs As String, desciption As String)
      • Initialize3
      • IsInitialized As Boolean
      • getSystemDirecory (dirtype As String) As String
        Get the Pat of a Systemdirectory.
        Possible values for dirtype are:
        - "desktop"
        - "programs"
        - "program_files"
        - "common_programs"
        - "common_desktopdirectory"
        - "personal"
      • save
        Save the Shelllink
      Properties:
      • Arguments As String [write only]
        Defined the commandline-args for the shelllink.
      • Description As String [write only]
        Set the description for the shelllink
      • DestinationPath As String [write only]
        Set the path where the link will be created
      • IconIndex As Int [write only]
        Set the Iconindex in the iconlib defined with
        setIconLocation.
      • IconLocation As String [write only]
        Define the Iconlib location.
        For example "%SystemRoot%\\system32\\SHELL32.dll"
        Use setIconIndex to set a Icon from this iconlib
      • Name As String [write only]
        Set the name for the shelllink
      • Target As String [write only]
        Set the Target for the shelllink
        Usually it is the Path to an program. Or an url
      • WorkingDirectory As String [write only]
        Set the workingdiectory for the target to be executed in

    Code:
    Private msLinks As ShellLink
        msLinks.Initialize3
        msLinks.IconLocation = 
    "%SystemRoot%\system32\SHELL32.dll"
        msLinks.IconIndex = 
    21
        msLinks.WorkingDirectory = 
    "G:\"
        msLinks.Arguments = 
    "--help --option1=x"
        msLinks.Description = 
    "Description bla bla bla"
        msLinks.DestinationPath = msLinks.getSystemDirecory(
    "desktop")
        msLinks.Name = 
    "B4J Shelllink"
        msLinks.Target = 
    "https://www.b4x.com/android/forum/threads/create-windows-shortcut.62377/" '"G:\32527-116921.pdf"
        msLinks.save
    If you want to donate for my work building the wrapper you can do it here: [​IMG]

    Attached:
    - Example
    - Library files for b4j
    - Java source of the wrapper
     

    Attached Files:

    Last edited: Jan 16, 2016
  2. Peter Simpson

    Peter Simpson Expert Licensed User

    Now this sounds Interesting @DonManfred, I will be giving this a blast later :cool:
     
    aidymp likes this.
  3. wonder

    wonder Expert Licensed User

    @The Don, Anywhere Software should totally hire you!! Well done! :)
     
    lemonisdead, DonManfred and aidymp like this.
  4. aidymp

    aidymp Active Member Licensed User

    Tested and WOW! exactly what I wanted! Donating NOW!

    Thanks

    Aidy
     
    DonManfred likes this.
  5. giga

    giga Well-Known Member Licensed User

    Nice work!!
     
    DonManfred likes this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice