Jump to content
Sign in to follow this  
Mat

Create a nice autoit icon on the desktop

Recommended Posts

Mat

this is basically a script that creates a CLSID and puts it on the desktop, the CLSID has it's own context menu consisting of:

* Helpfile

* Compile script

* window info

It works mostly with the registry, so for those of you who are not confident deleting keys, it even writes a delete script for you, and unless you want to go hunting in the registry, I suggest you keep it, as the CLSID location is not a constant...if that makes any sense...in simpler terms, it finds an un-used CLSID space to stop collision with others, which can get very dirty, but it does mean that you can't find from the source where the what number the CLSID is...

the idea is from herby, and I've been playing around with this for a while... I am writing a script to make these easily, but then I thought more about using scripts rather than .reg files, and came up with this.

For some reason it doesn't work when compiled, still can't work out why. I was also going to put links to the forum and homepage, but computer didn't like that, giving me an access is denied box.

ta to authenticity for the random string thing @ StringRegExpReplace(@AutoItExe, '(?m)(^\[[^\]]*+\]|(?<!\\)(\\)(?![\\\r]))', '\1\2')

came in very useful!

AutoitIcon.au3

edit: changing the icon is also quite easy, simply look for the line that $icon = and put the directory in place of @Autoitexe. leave the string replace, it is necessary.

edit2: updated script, silly error duplicating the helpfile context item.

Edited by mdiesel

Share this post


Link to post
Share on other sites
corgano

i am running windows xp and it didnt do anything. you could see the icon in the corner but there was nothing special about it. what is it supposed to do?


0x616e2069646561206973206c696b652061206d616e20776974686f7574206120626f64792c20746f206669676874206f6e6520697320746f206e657665722077696e2e2e2e2e

Share this post


Link to post
Share on other sites
Mat

i am running windows xp and it didnt do anything. you could see the icon in the corner but there was nothing special about it. what is it supposed to do?

double click should load the helpfile, right click will bring up a menu as said in post #1. I have not tested on other computers, so I'm not sure - it worked when I first did a similar thing on my comp... and I don't recall having to do anything.

It is essentially a normal shortcut, just a bit more functionality.

I presume from the amount of downloads and lack of replies, everyone else is fine? don't know about other os's, as said - it should work on all.

also, I noticed envupdate isn't having the desired effect, I still have to refresh the desktop...

Edited by mdiesel

Share this post


Link to post
Share on other sites
corgano

double click should load the helpfile, right click will bring up a menu as said in post #1. I have not tested on other computers, so I'm not sure - it worked when I first did a similar thing on my comp... and I don't recall having to do anything.

It is essentially a normal shortcut, just a bit more functionality.

I presume from the amount of downloads and lack of replies, everyone else is fine? don't know about other os's, as said - it should work on all.

also, I noticed envupdate isn't having the desired effect, I still have to refresh the desktop...

still nothing. if you have another computer handy try it on that


0x616e2069646561206973206c696b652061206d616e20776974686f7574206120626f64792c20746f206669676874206f6e6520697320746f206e657665722077696e2e2e2e2e

Share this post


Link to post
Share on other sites
Mat

still nothing. if you have another computer handy try it on that

so what happens? does it just not do anything when you click the buttons, or are non of the graphic stuff working either?

Run this script and send the result to me... (it copys the result to clipboard)

script must be saved in the same directory as the remove.au3 created by running the script, or it will not work.

#Include <Clipboard.au3>

_ClipBoard_SetData (StringTrimRight (RegRead (StringTrimRight (StringTrimLeft (FileReadLine (@Scriptdir & "\remove.au3", 1), 12), 2) & "\Shell\00\Command", ""), 15) & @CRLF & StringTrimRight (@Autoitexe, 11))

basically, this checks the directory that the program is running from and where it should be running from.

if the graphic stuff isn't working either then I don't know whats happening. I'm testing it on another computer hopefully within the next hour or so bear with me.

if you want to, you can do the above code manually, just open regedit and find the key for the autoit CLSID. any of the command lines will do for that

Sorry, I'm having problems testing as the exe doesn't work properly, and I don't have any computers with autoit except mine. Ideally could some one else try it out and see what happens?

Edited by mdiesel

Share this post


Link to post
Share on other sites
Christina

What kind of fucking thing is that? where is the icon? >_< Little Obsured..xD...be careful before Posing..

Share this post


Link to post
Share on other sites
ResNullius

@All,

Change the 2nd line of code in mdiesel's original script

From:

$C = _RegKey ("5400")

to

$C = _RegKey (5400) ;<<<---- pass parameter as a number instead of a string

When passed as a string, the IsNumber function run later on in the _Reg() function fails and the script just goes into an infinite loop.

The script should run and exit very quickly.

Then refresh your desktop and you should see a new AutoIt icon.

Right-click on it to see the special context menu items.

Share this post


Link to post
Share on other sites
smashly

Hi, thank you for sharing.

Even though I haven't tried your code and I don't understand how a CLSID works, I was intrested in what you said about the using an unused CLSID.

You can generate a unique number for a CLSID by using rpcrt4.dll (Native windows dll) and calling UuidCreate.

Info about UuidCreate at MSDN

#Include <WinAPI.au3>

$sCLSID = _UuidCreat()
ConsoleWrite($sCLSID & @LF)

Func _UuidCreat()
    Local $tGUID, $pGUID
    $tGUID = DllStructCreate($tagGUID)
    $pGUID = DllStructGetPtr($tGUID)
    DllCall("rpcrt4.dll", "int", "UuidCreate", "ptr", $pGUID)
    If Not @error Then Return _WinAPI_StringFromGUID($pGUID)
EndFunc

Share this post


Link to post
Share on other sites
Mat

Thanks to both Res and Smashly, I will edit the script now... I wrote this a while ago just to test the theory, so its not high on my list of things to do (currently reading through 2500 unread threads from the past few weeks, having been in the middle of nowhere!). I never got the infinite loop... no idea why. As for the UuidCreate, I have never seen that before, so thanks!!

Also, I can't update the download due to problems with my file host...

MDiesel

Share this post


Link to post
Share on other sites
ResNullius

I never got the infinite loop... no idea why.

Maybe the Reg key existed already on your machine from earlier manual creation when you were following the instructions in the article you linked?

IIRC when the key is already there your script as it is "appears" to work fine.

Share this post


Link to post
Share on other sites
corgano

I looked through the code. This is simple enough it could be quite useful!

You could make a program that could create and remove custom icons.

EDIT

how big of a range do you have? you used the value 4500, but how high can one go before messing stuff up?

Edited by corgano

0x616e2069646561206973206c696b652061206d616e20776974686f7574206120626f64792c20746f206669676874206f6e6520697320746f206e657665722077696e2e2e2e2e

Share this post


Link to post
Share on other sites
ResNullius

I looked through the code. This is simple enough it could be quite useful!

You could make a program that could create and remove custom icons.

EDIT

how big of a range do you have? you used the value 4500, but how high can one go before messing stuff up?

I was thinking the same thing about making a program to make more.

Looks like if you use smashly's _UuidCreat( ) posted earlier here, you don't need to worry about the values used.

Share this post


Link to post
Share on other sites
Mat

I wrote a program (or started :D ) to do just that, I will dig out the remains of the code if you want it, I remember doing that project... I learnt how to make child windows... I was struggling for a long time on that!!

Maybe i'll finish it...

MDiesel

Edit: Did you know... Clicking and dragging of these icons means that... You can add them to a rocketdock!! I'm not sure about other types of docks (Object dock etc) but this is pretty good... and extends the capabilities of this far and wide :D

Edited by mdiesel

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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.