pub struct ShellLink { /* private fields */ }Expand description
A shell link
Implementations§
Source§impl ShellLink
impl ShellLink
Sourcepub fn header(&self) -> &ShellLinkHeader
pub fn header(&self) -> &ShellLinkHeader
returns the ShellLinkHeader structure
Sourcepub fn linktarget_id_list(&self) -> &Option<LinkTargetIdList>
pub fn linktarget_id_list(&self) -> &Option<LinkTargetIdList>
returns the LinkTargetIdList structure
Sourcepub fn string_data(&self) -> &StringData
pub fn string_data(&self) -> &StringData
returns the StringData structure
Sourcepub fn extra_data(&self) -> &ExtraData
pub fn extra_data(&self) -> &ExtraData
returns the ExtraData structure
Source§impl ShellLink
impl ShellLink
Sourcepub fn header_mut(&mut self) -> &mut ShellLinkHeader
pub fn header_mut(&mut self) -> &mut ShellLinkHeader
returns the ShellLinkHeader structure
Sourcepub fn linktarget_id_list_mut(&mut self) -> &mut Option<LinkTargetIdList>
pub fn linktarget_id_list_mut(&mut self) -> &mut Option<LinkTargetIdList>
returns the LinkTargetIdList structure
Sourcepub fn link_info_mut(&mut self) -> &mut Option<LinkInfo>
pub fn link_info_mut(&mut self) -> &mut Option<LinkInfo>
returns the LinkInfo structure
Sourcepub fn string_data_mut(&mut self) -> &mut StringData
pub fn string_data_mut(&mut self) -> &mut StringData
returns the StringData structure
Sourcepub fn extra_data_mut(&mut self) -> &mut ExtraData
pub fn extra_data_mut(&mut self) -> &mut ExtraData
returns the ExtraData structure
Source§impl ShellLink
impl ShellLink
Sourcepub fn new_simple<P: AsRef<Path>>(to: P) -> Result<Self>
pub fn new_simple<P: AsRef<Path>>(to: P) -> Result<Self>
Create a new ShellLink pointing to a location, with otherwise default settings.
Sourcepub fn with_encoding(self, encoding: &StringEncoding) -> Self
pub fn with_encoding(self, encoding: &StringEncoding) -> Self
change the encoding for this link
Sourcepub fn open<P: AsRef<Path>>(path: P, encoding: Encoding) -> Result<Self, Error>
pub fn open<P: AsRef<Path>>(path: P, encoding: Encoding) -> Result<Self, Error>
Open and parse a shell link
All string which are stored in the lnk file are encoded with either
Unicode (UTF-16LE) of any of the Windows code pages. Which of both is
being used is specified by the LinkFlags::IS_UNICODE flag. Microsoft
documents this as follows:
If this bit is set, the StringData section contains Unicode-encoded strings; otherwise, it contains strings that are encoded using the system default code page.
The system default code page is stored in
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\CodePage\ACP
Because we do not know what the system default code page was, you must
specify this using the encoding parameter (see below). If you you do
not know the system default code page either, you’re lost. There is no
way to correctly guess the used code page from the data in the lnk
file.
path- path of thelnkfile to be analyzedencoding- character encoding to be used if thelnkfile is not Unicode encoded
Sourcepub fn link_target(&self) -> Option<String>
pub fn link_target(&self) -> Option<String>
returns the full path of the link target. This information
is constructed completely from the LINK_INFO structure. So,
if the lnk file does not contain such a structure, the result
of this method will be None
Sourcepub fn set_relative_path(&mut self, relative_path: Option<String>)
pub fn set_relative_path(&mut self, relative_path: Option<String>)
Set the shell link’s relative path
Sourcepub fn set_working_dir(&mut self, working_dir: Option<String>)
pub fn set_working_dir(&mut self, working_dir: Option<String>)
Set the shell link’s working directory
Sourcepub fn set_arguments(&mut self, arguments: Option<String>)
pub fn set_arguments(&mut self, arguments: Option<String>)
Set the shell link’s arguments
Sourcepub fn set_icon_location(&mut self, icon_location: Option<String>)
pub fn set_icon_location(&mut self, icon_location: Option<String>)
Set the shell link’s icon location