Jump to content
timmalos

Pin my program to Windows 8 TaskBar

Recommended Posts

timmalos

Hello guys.

I have a little issue and I can't find any answer sadly so I'm opening this post.

I created a tool with AutoIt, but sadly on Windows 8.1 I can't pin it to my taskbar, I have no idea why. If I take any other program for example Firefox, when it's started and I do a right click on the icon in the taskbar I can have a nice menu and just below "Exit window" I have an option "Pin this program to the TaskBar" (or Unpin if already clicked), but with my AutoIt script (compiled) I have only the Exit button.

Do you know if there is a Windows option to add to GuiCtrlCreateGui() or anything I can do to be able to pin my program to the  windows 8.1 taskbar?

Thank you very much,

Tim

Edited by timmalos

Share this post


Link to post
Share on other sites
jchd

So the title needs fixing: Ping --> Pin
Please edit it else noone will get what you're talking about.

I don't have anything relevant to say on W8.1


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites
ViciousXUSMC

Right Clicking a .exe or a shortcut (.lnk) should give you pin options.

If its still a .au3 that is probably why you do not see any options. 

Share this post


Link to post
Share on other sites
timmalos

Fixed title sorry for the typo.

It's not an au3 file since it's compiled. I'm speaking of my .exe executable program.

Included a screenshot so that you can see I don't have any Pin option, only the Exit button. Am I the only one to have this issue on WIndows 8.1?

 

 

Sans titre.png

Edited by timmalos
Image

Share this post


Link to post
Share on other sites
BrewManNH

You can right click the .exe file and pin it to the task bar, you can't do it using the program's icon on the task bar.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites
timmalos

I may have found my issue, maybe not related to AutoIt I have to do more tests.

This program is located on a network drive R:\. If I copy it to my Desktop for example I can see the Pin option. So might be a Windows related issue with network drives. I'll try to find another way.

Anyway thanks guys for your help.

Edited by timmalos

Share this post


Link to post
Share on other sites
BrewManNH

You can not pin programs that are on network drives or removable storage.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites
Chimaera

It can be done like this on 8.1

#include-once
#include <WinAPI.au3>
#include <Constants.au3>

_PinToMenu('C:\Program Files (x86)\Internet Explorer\iexplore.exe', 'Task') ; Pin Item
;~ _PinToMenu('C:\Program Files\CCleaner\CCleaner.exe', 'Task', 0) ; Unpin Item

Func _PinToMenu($File, $Bar = 'Task', $Pin = True)
    If @OSBuild < 7600 Then Return SetError(1) ; Windows 7 only
    If Not FileExists($File) Then Return SetError(2)
    Local $sFolder = StringRegExpReplace($File, "(^.*\\)(.*)", "$1")
    Local $sFile = StringRegExpReplace($File, "^.*\\", '')
    $ObjShell = ObjCreate("Shell.Application")
    $objFolder = $ObjShell.Namespace($sFolder)
    $objFolderItem = $objFolder.ParseName($sFile)
    For $Val In $objFolderItem.Verbs()
        Select
            Case StringInStr($Bar, 'Task')
                If StringInStr($val(), "Tas&kBar") Then
                    $Val.DoIt()
                    Return
                EndIf
            Case StringInStr($Bar, 'Start')
                If StringInStr($val(), "Start Men&u") Then
                    $Val.DoIt()
                    Return
                EndIf
        EndSelect
    Next
EndFunc   ;==>_PinToMenu

Creds goto original poster, but i cant remember who it was

It will pin to start menu as well like this

_PinToMenu(@WindowsDir & '\notepad.exe', 'Start')

 

Edited by Chimaera

Share this post


Link to post
Share on other sites
Rockerfeller

The code above this does not work for me for apps on usb or network drive.

Share this post


Link to post
Share on other sites
Chimaera

its for a local machine and i use it for programs not apps ;)

you can access install folders for apps like this

http://www.wikihow.com/Access-Metro-Style-Apps-Installation-Folder-in-Windows-8

dunno if it helps though

Edited by Chimaera

Share this post


Link to post
Share on other sites
BrewManNH

The code above this does not work for me for apps on usb or network drive.

You can not pin programs that are on networked drives, UNC paths, or on removable storage to the taskbar.

Just about the ONLY way to do it is to pin some other random program to the taskbar and then modify the shortcut to point to the networked location. It would be stupid to pin a program on removable storage to the taskbar, because if the drive isn't there, there's no program to run. Or if the drive letter changes it also won't run.

  • Like 1

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites
timmalos

You can not pin programs that are on networked drives, UNC paths, or on removable storage to the taskbar.

Just about the ONLY way to do it is to pin some other random program to the taskbar and then modify the shortcut to point to the networked location. It would be stupid to pin a program on removable storage to the taskbar, because if the drive isn't there, there's no program to run. Or if the drive letter changes it also won't run.

Well, I kinda disagree with you on the "stupid thing" since at work most of us have a networked drive they use to access shared storage with some programs etc... Yes the drive letter can change (and yet I'm more subject to have my local disk dead than losing this networked drive on a SAN) and in this case it won't run, but you can delete a program in your local C:\ drive and it won't run either :) I don't see why Windows set this limitation. Anyway thanks for the tip with a random program, makes the work for me !

 

Share this post


Link to post
Share on other sites
BrewManNH

I never said pinning a network program was stupid, I said pinning a program on a removable drive was. I frequently pin programs that are on UNC/Networked drives, I'd never do it for a program on removable storage

Perhaps "stupid" was too harsh a word, but at the very least it makes no sense to do it.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Content

    • Errious
      By Errious
      Hello,
       
      is it possible to use an autoit script to show a live preview from a minimized program?
      I searched for this and found many different little tools but none of them offered this Option so far.
      You may ask why someone should use this, for me it should be a live preview from different clients of a game, when minimized the game itself is not using much resources but with multiple clients running its to heavy for my rig so i try to find a way to still observe what is happening ingame on this minimized clients.
      Would be nice if somebody leads me into the right direction where i can / should begin with, cause i am not sure how this script should look like but maybe someone already tried this (my forum search was not successfull)?
       
      Regards
    • littleboy62
      By littleboy62
      Hello everyone.
      First, sorry for mistakes, I'm french. ^^
      =====
      I've tried (and I try always) to pin a shortcut (lnk) to startmenu (on Windows 10).

      Look this subject (in forum FR autoit) : http://www.autoitscript.fr/forum/viewtopic.php?f=21&t=12031
      The script I wrote, doesn't work, despithe the display of "Épingler à l'écran de démarrage" by a consolewrite.
      This is the script :
      #RequireAdmin $path = @DesktopDir & "\vlc.lnk" PinToTaskBand($path) Func PinToTaskBand($path) $objShell = ObjCreate("shell.application") $objFSO = ObjCreate("Scripting.FileSystemObject") $strFolder = $objFSO.GetParentFolderName($path) $strFile = $objFSO.GetFileName($path) $objFolder = $objShell.Namespace($strFolder) $objFolderItem = $objFolder.ParseName($strFile) $colVerbs = $objFolderItem.Verbs For $itemVerb In $objFolderItem.Verbs ;~ MsgBox(0,"", $itemVerb.name) $var = StringReplace($itemVerb.name, "&", "") ConsoleWrite($var & " | ") If $var = "Pin to startmenu" Or $var="Épingler à l’écran de démarrage" Then MsgBox(0, "", 1) $itemVerb.DoIt EndIf Next EndFunc ;==>PinToTaskBand Func UnpinToTaskBand($path) $objShell = ObjCreate("shell.application") $objFSO = ObjCreate("Scripting.FileSystemObject") $strFolder = $objFSO.GetParentFolderName($path) $strFile = $objFSO.GetFileName($path) $objFolder = $objShell.Namespace($strFolder) $objFolderItem = $objFolder.ParseName($strFile) $colVerbs = $objFolderItem.Verbs For $itemVerb In $objFolderItem.Verbs ConsoleWrite($itemVerb.name & " | ") If StringReplace($itemVerb.name, "&", "") == "Unpin from Taskbar" Or StringReplace($itemVerb.name, "&", "") == "Détacher de la barre des tâches" Then $itemVerb.DoIt Next EndFunc ;==>UnpinToTaskBand If StringInStr($var, "Pin to startmenu") Or StringInStr($var, "Épingler à l’écran de démarrage") Then MsgBox(0, "", 1) $itemVerb.DoIt EndIf  
      It shows 1 (msgbox) correctly.
      But $itemVerb.DoIt doesn't work.

      Someone would he know how to do ?
      If i do mistakes, where are it ? Please.
      Else, is there another way to pin a shortcut to startmenu (on windows 10)?
      Thanks by advance.
      Cheers.
      Good day guys:D
    • Danyfirex
      By Danyfirex
      HI. I was needing to add a program to Tarkbar(an easy way without using objectcreateinterface )   so I found this. So then I deduced how to add to the StartMenu while I see the shell32 in hex editor search for taskbarunpin|taskbarpin string. I found another two interesting string (startpin|startunpin) So I try out and they work too but to add to StartMenu.
      This is not an official way to do this, however it works.
      $sFileLnk parameter must be Link(.lnk) to our program.
      ;~ Success: True. ;~ Failure: False. Func DeleteFromTaskBar($sFileLnk) Return _WinAPI_ShellExecute($sFileLnk,"","", "taskbarunpin") EndFunc Func AddToTaskBar($sFileLnk) Return _WinAPI_ShellExecute($sFileLnk,"","", "taskbarpin") EndFunc Func AddToStartMenu($sFileLnk) Return _WinAPI_ShellExecute($sFileLnk,"","", "startpin") EndFunc Func DeleteFromStartMenu($sFileLnk) Return _WinAPI_ShellExecute($sFileLnk,"","", "startunpin") EndFunc  
      Saludos
    • RichE
      By RichE
      Hi All,
      I wrote an app a few years ago and have revisited it to improve it, one thing I can't sort it to not show it on the taskbar, but show it in the system tray, the point of the app is to allow users easy access to info that tech support may ask, like username, pc name & IP address.
      I've searched the forums but not found a answer, can anyone point me in the right direction.
      Thanks in advance#
      RichE
    • kcvinu
      By kcvinu
      Hi all, I need to get the list of windows which are resting in taskar. That means, windows which i can toggle through ALT TAB. I use "WinList" function. But it gives me all the windows. Then i tried to filter it like this; Local $lst = WinList() Local $Row = 0 For $i = 1 To $lst[0][0] If $lst[$i][0] = "" And Not BitAND(WinGetState($lst[$i][1]), 1) Then _ArrayDelete($lst,$Row) EndIf $Row +=1 Next _ArrayDisplay($lst) But this code doesn't delete the 2nd column. I have read the help file and saw an example which deletes an entire row from a 2 dimensional array. I have used the same method but please look this image. This is what i have got.

×