Jump to content

Recommended Posts

Posted

I have a question.

How to get a exe file's icon?

In this script, when create a program daemon, I want to use the same icon as the program, how to do this?

Thanks a lot

Robie

Posted

@robiezhou, just tried your script. Very interesting. There are a lot of possiblities with it.

Regarding your question of how to get the icon from an exe I will have to look into I know that people in this forum have created such things but I will have to do a little back track research..

Cheers.. B)

Posted (edited)

Hi robiezhou,

I believe you want to get the default icon for the program you have selected to keep running? If so, see the following code:

#include <GUIConstants.au3>

$Form1 = GUICreate("AForm1", 622, 448, 192, 125)
$Icon1 = GUICtrlCreateIcon("C:\Program Files\Microsoft Office\Office10\OUTLOOK.EXE", 0, 16, 16)
GUISetState(@SW_SHOW)
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case Else
    ;;;;;;;
    EndSelect
WEnd
Exit

As you can see, this part ("C:\Program Files\Microsoft Office\Office10\OUTLOOK.EXE", 0) contains the filename of the program and the default icon index to load.

Hope this helps

Edited by sandyd
----[ SandyD ]---
Posted

Thank you all above. :P

@dabus

Yes, it's a good tool. It can be used to convert a file to icon file.

@sandyd

I want to get an icon file, and use this icon file to convert .au3 file to .exe file. :lmao:

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
×
×
  • Create New...