Topic: Add_Pin  (Read 6948 times)

Add_Pin
« on: October 15, 2010, 06:48:09 AM »

Lancelot

  • Moderator, Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 10350
Syntax only for NT6x (ex: Win10PESE, Win8PESE Win8.1SE, Win7PESE) project plugins.

Pin Adding is a feature of "Windows Explorer Shell" ,
 It has a complex nature to understand,
  read all current page or check google for special pin feature,
   If you can not figure out, do not worry, you can live without pins on PE,
      Shortcuts are more popular and more solid than pins.  :wink:


Full Syntax:
Add_Pin,Type,Order(0,1,2,..,8,9),(path\)FileName,Title,Work Folder,Parameters,(path\)IconFile#$cIconIndex,StartMode=(1,2,3)#$cHotKey,ToolTipText

Pin Parameters
Type:
StartMenu
TaskBar
RecentPrograms (look end of document)

Tip: If no Type written, It is set to StartMenu

Order:
A number between 0 and 9
If NO value given, than first available place Automatically found --> Adviced
Also Auto value can be used to find first available pace  Automatically (-->helps to write plugin writing easier in some cases)

Order Warning:
If a plugin overwrite previously Type with same Order, than you will get a warning in log.

(path\)FileName:
1)
you can use target path of a file,
example: #$pSystemRoot#$p\calc.exe
2)
You can use .lnk files in user profile
examples:
$Start_Menu\Programs\Network\PENetwork.lnk
$Quick_Launch\PENetwork.lnk
$Desktop\My Computer.lnk

Shortcut (some) Parameters
StartMode=(1,2,3)
Value to set how the window of the launched program should be.
1 = Show (Default)
2 = Show_Minimized (program will start minimized)
3 = Show_Maximized (program will start maximized)

HotKey
hotkeys written splitted with + without using space
for full list check hotkey list attached.
example:
CTRL+ALT+A

Examples:
Add_Pin
Add_Pin,StartMenu
Add_Pin,Taskbar
Add_Pin,Taskbar,,#$pSystemRoot#$p\calc.exe
Add_Pin,StartMenu,,"$Desktop\My Computer.lnk"
Add_Pin,StartMenu,,%PE_Programs%\%ProgramFolder%\MyTool_To_Pin.exe,"My Pinned Tool"
Add_Pin,RecentPrograms,,$Start_Menu\Programs\Accessories\Notepad.lnk

'Taskbar and StartMenu' Pin Features:
1) Not all files can be pinned
a) links (Shortcuts) (.lnk) pointing to .cpl files cannot be pinned
b) Files located on removable devices (CD UFD  (USB Stick) etc.) cannot be pinned.
 (Workaround --> Pin StartMenu Shortcut of a file on CD / USB )
2) The name of pin is automatically set based on the Shortcut ( .lnk ) name or program name.
 (Tip -->Pin .lnk (Shortcut) is flexible and used more widely than the direct file)
3) maximum 10 per type items can be pinned. (10+10=20)

4) pin from a network drive :
It seems normally not work even with links (Shortcuts) (.lnk) pointing to files
With Start10 one can pin a program to the Start Menu from a network drive But not for the taskbar.
Thanks to Bob.Omb and ChrisR Reply 602 http://TheOven.org/index.php?topic=2488.msg31212#msg31212

Add_Pin,RecentPrograms

** RecentPrograms do not have 'Taskbar and StartMenu' Pin Features (restrictions)  :thumbsup:**
so to pin items at cd etc. one can easly use Add_Pin,RecentPrograms
Also:
For now Recent programs only have 1 parameter support, typical examples:

Add_Pin,RecentPrograms,,$Start_Menu\Programs\Accessories\Notepad.lnk
Add_Pin,RecentPrograms,,$Desktop\Notepad.lnk

And for now it supports $Start_Menu and $Desktop

Reason behind: Pin adding technique (by 2aCD) used for RecentPrograms is totally different from
pin adding of StartMenu and Taskbar

Note: There are no RecentPrograms shortcuts created if the Apps is already Pinned to StartMenu or even Taskbar only.



1 – Pins Plugin
SE projects have Finals\1 – Pins available to easer creating pins.
Inside box you must write ”Full Path to Program inside WinPE”
This is wrong, it is not Full Path:
\Programs\GoogleChrome\Application\chrome.exe

This is wrong, it is 1-not Full Path 2-not even correct
Add_Pin,Taskbar,, \Programs\GoogleChrome\Application\chrome.exe

This is mostly wrong:
%systemdrive%\Programs\GoogleChrome\Application\chrome.exe
,  on SE projects as default \Programs\ folder is not at %systemdrive%

Correct::
 See Examples box inside “1 – Pins” Plugin
 Advice: Use Full Path for shortcuts (.lnk files): ex:  $Start_Menu\Programs\Network\Mozilla Firefox.lnk
Also READ :
 'Taskbar and StartMenu' Pin Features:
And
 Add Pin,RecentPrograms:







Story:
Windows Pin features
NT5x=Pin Exists with 1) StartMenu 2) StartMenuRecentPrograms
 -> Gena project have a  \Components\Tweaks Explorer\”Start Menu Pin” plugin
Nt6x(w7)=Pin Exists with 1) StartMenu* 2) StartMenuRecentPrograms 3) TaskBar*
 -> Win10PESE, Win8PESE Win8.1SE, Win7PESE have  \Finals\”1 Pins” plugin
      AND Add_Plugin command created for individiual plugins.
         Tip: You can disable \Finals\”1 Pins” plugin during build, still pins are added by standalone plugins.  :thumbsup:

Mostly pinning shortcuts (.lnk) preferred since one can change properties of shortcut.

(* os difference on method and/or behaviour)


On NT6x (Win7, Win8, Win8.1, Win10....)
Internally, When Windows Pins, Windows creates a shortcut to control properties of pins in following locations (I guess)
..\Config\Systemprofile\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar
..\Config\Systemprofile\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\StartMenu
or
..\Users\Default\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar
..\Users\Default\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\StartMenu

For Add_Pin command; Add_Pin,Type,Order(0,1,2,..,8,9),(path\)FileName
is naturally enough to create a pin, which is enough for Winapi.
Rest of Add_Pin command parameters provides full shortcut properties,
so instead of creating a .lnk first than adding pin to this .lnk, with single api both tasks can be done.
It is up to loader/tool of the project to support shortcut (#4 ... #9) parameters or not. Add_Pin command would suit both type of design.


Additional About Recent Programs:
Add Recent Programs Magic key by 2aCD (to get recent program list not deleted at bootup.)
RegWrite,HKLM,0x4,Tmp_Default\Software\Microsoft\Windows\CurrentVersion\Explorer\UserAssist\{F4E57C4B-2036-45F0-A9AB-443BCFE33D9F},Version,0x5



References:
Add Pin Syntax Home Page: http://theoven.org/index.php?topic=37.0
Au3 Pin Topic: http://www.autoitscript.com/forum/index.php?showtopic=116641
Au3 Shortcut: http://www.autoitscript.com/autoit3/docs/functions/FileCreateShortcut.htm
Au3 Send: http://www.autoitscript.com/autoit3/docs/functions/Send.htm
Rot13: http://en.wikipedia.org/wiki/ROT13
Pinable Or Not: http://msdn.microsoft.com/en-us/library/windows/desktop/hh127439(v=VS.85).aspx
Some words about Limitation: http://theoven.org/index.php?topic=2389

Credits:
Thanks to Rui Paz giving idea of Add_Api command and its design in Macro Library
Thanks to Max_Real QNX & JFX providing informations of creating pin.
Thanks to Galapo and BlueLife for improving codes and testing.
Thanks to 2aCD for Add_Pin,RecentPrograms.
« Last Edit: January 29, 2019, 06:23:23 PM by Lancelot »

 

Powered by EzPortal