Jump to content
Danyfirex

Add Program to TarkBar and StartMenu

Recommended Posts

Danyfirex

HI. I was needing to add a program to Tarkbar(an easy way without using objectcreateinterface :wub:)   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

  • Like 1

Share this post


Link to post
Share on other sites
wakillon

You can use ShellExecute for avoid to use WinAPIShellEx.au3 as done here.


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites
Danyfirex

You can use ShellExecute for avoid to use WinAPIShellEx.au3 as done here.

I know. But if you pass a file path to ShellExecute instead of a .lnk will show an MessageBox.

 

Saludos

Share this post


Link to post
Share on other sites
wakillon

I know. But if you pass a file path to ShellExecute instead of a .lnk will show an MessageBox.

 

Saludos

In that case why do you specify : "$sFileLnk parameter must be Link(.lnk) to our program.;)

  • Like 1

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

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

    • nacerbaaziz
      By nacerbaaziz
      Hello
      i have searched a lot about how to run external programs with the administrator privileges without the script running with administrator privileges using autoit
      But all my attempts failed
      Finally, today I found the VBS function doing this task
      I immediately transferred it to our beloved language (autoit) and i decided to share it with you
      i hope you like it
      This is a simple example about how to use the function

      runAsAdmin("cmd.exe", "/c @echo off & cls & echo test & pause", "c:\", @sw_show)
      this is the function

      func runAsAdmin($program, $parameters = "", $workingDir = @workingDir, $show = "") local $oShell = OBJCreate("Shell.Application") if isOBJ($oShell) then local $result = $oShell.ShellExecute($program, $parameters, $workingDir, "runas", $show) else $result = false endIf return $result endFunc
       
    • 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
    • leomoon
      By leomoon
      Hello,
      I'm trying to write a hotkey program and I know exactly how to do it but it will be hard coded and the user won't be able to edit it.
      HotKeySet("{ESC}", "HotKeyPressed") HotKeySet("^!d", "HotKeyPressed") HotKeySet("^+x", "HotKeyPressed") While 1 Sleep(500) WEnd Func HotKeyPressed() Switch @HotKeyPressed Case "{ESC}" Exit Case "^!d" ShellExecute("D:\Docs") Case "^+x" ShellExecute("D:\Docs\My Portables\Burner\AnyBurn\AnyBurn.exe") EndSwitch EndFunc I want the program to read a file that has hotkeys on odd lines and paths on even lines but I don't see how the program will load into itself.
      Is it even possible?
      Thanks.
    • FrancescoDiMuro
      By FrancescoDiMuro
      Good morning
      I'm working on a little project, and I was wondering if there's a way ( sure there is ) to insert data to a ComboBox control everytime the user insert some text in the ComboBox which is not in the ComboBox data. I'll try to explain with an example:
      - Form with some data ( ComboBox is empty );
      - User prompt something in the ComboBox: if what the user prompts is not in the ComboBox values ( at the moment empty ), then insert the value in the ComboBox values, in order to have, next time the user prompts the form, the value that he entered.
      More pratical example:
      - First call of the form, ComboBox empty;
      - I prompt "A" in the ComboBox;
      - Second call, in the ComboBox I should see "A";
      - I prompt "B" in the ComboBox;
      - Third call, I should see "A"
                                                 "B";
      - And so on...
      Everytime the form is called, I re-create it, so I think I can't use _GUICtrlComboBox_AddStrings().
      I tried with
      Global $strCboStrings = "" ; When the user prompt the form, the code below is executed. ; I.E. : User prompt "A", after the if I should have "A"; ; In the second call, If I write "B", I should see "A" ; "B"; ; If I write "A" again, in the combobox values should not be any changes. If Not StringInStr($strCboStrings, GUICtrlRead($cboVoiceCategory)) <> 0 Then $strCboStrings &= $strCboStrings & "|" & GUICtrlRead($cboVoiceCategory) EndIf Any suggestion?
      Thanks
    • nacerbaaziz
      By nacerbaaziz
      Hi guys
      I have an inquiry please
      I want an example of how to add an icon file to the compiled autoit file and how to use it in GUICtrlCreateIcon
      Preferably in a separate list within the resourceFor example myIcons
      I hope my request is clear and I hope you will help me solve this problem
      Because I found an example in the help files but I did not understand the method well
×