Jump to content
Sign in to follow this  
UltraFine

Make a DLL that contains icons or other pictures

Recommended Posts

UltraFine

Hi,

I want to create a dll file for all the icons a will need in my

application. Something like the "SHELL32.dll" in windows. Anybody know

where I can find some sample code to create something like that ?

Question by: emmanuel (on another Forum and i copied it because of same issue)

there was a answer (Link) http://bytes.com/forum/thread348556.html

From VB Helper (Link) http://www.vb-helper.com/howto_icon_dll.html

there is a Auto Hot Key Script (*.ahk)

ROD-Ex is a script that demonstrates automation of

* Adding resources to AutoHotkeySC.bin

* Creating a Resource only DLL from scratch

(Link) http://www.autohotkey.com/forum/topic30228.html

but i don't know how to do it because i knows only AutoIt and no solution is working for me.

Edited by L0veUK

Share this post


Link to post
Share on other sites
Andreik

Hi,

I want to create a dll file for all the icons a will need in my

application. Something like the "SHELL32.dll" in windows. Anybody know

where I can find some sample code to create something like that ?

Question posted by: emmanuel (on another Forum and i copied it because of same issue)

First, you need Visual C++ 2008 Express Edition or other software to can make a dll file.

If you have this, I`ll show you an example.


When the words fail... music speaks

Share this post


Link to post
Share on other sites
UltraFine

First, you need Visual C++ 2008 Express Edition or other software to can make a dll file.

If you have this, I`ll show you an example.

Andreik, Thanks for the quick reply!

- i don't have, do i need to install it first? any other way to do it?

Share this post


Link to post
Share on other sites
Andreik

Andreik, Thanks for the quick reply!

- i don't have, do i need to install it first? any other way to do it?

You cannot create a dll with AutoIt.

You need to install Visual C++ 2008 Express Edition or other program who can do that.


When the words fail... music speaks

Share this post


Link to post
Share on other sites
UltraFine

You cannot create a dll with AutoIt.

Why?

You need to install Visual C++ 2008 Express Edition

Downloadin... 10Kbps

or other program who can do that.

which program?

Share this post


Link to post
Share on other sites
Marlo

AutoIt doesnt have the ability ro create DLL files...it just wasnt made for that. Also why not use AutoIt3Wrappers?

do a search for "#AutoIt3Wrapper_Res_Icon_Add"

This will let you add as many icons to your compiled script as you like.

Edited by Marlo

Click here for the best AutoIt help possible.Currently Working on: Autoit RAT

Share this post


Link to post
Share on other sites
Andreik

Here is an example of dll resource file, I use that for my Yahoo! Avatar script:

// Microsoft Visual C++ generated resource script.
//
#include "resource.h"

#define APSTUDIO_READONLY_SYMBOLS

/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS

/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources


/////////////////////////////////////////////////////////////////////////////
//
// Icon
//

// Icon placed first or with lowest ID value becomes application icon

LANGUAGE 9, 1
#pragma code_page(1252)
1          ICON      "ICON1.ico"
2          ICON      "ICON2.ico"
3          ICON      "ICON3.ico"
4          ICON      "ICON4.ico"
5          ICON      "ICON5.ico"
6          ICON      "ICON6.ico"

#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//

1 TEXTINCLUDE  
BEGIN
    "resource.h\0"
    "\0"
END

2 TEXTINCLUDE  
BEGIN
    "#include ""afxres.h""\r\n"
    "\0"
END

3 TEXTINCLUDE  
BEGIN
    "\0"
END

#endif  // APSTUDIO_INVOKED

/////////////////////////////////////////////////////////////////////////////



#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//


/////////////////////////////////////////////////////////////////////////////
#endif  // not APSTUDIO_INVOKED
Edited by Andreik

When the words fail... music speaks

Share this post


Link to post
Share on other sites
AzKay

What I did when I needed to do this was, I googled for "hello world" dll examples. They usually come with source code, and a compiled dll. Then I just used resource hacker on the dll, added my icons.


# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
Share on other sites
UltraFine

yeah, i know about it. i myself tried many times but it's not working for me. i used autoit wrapper along with ResHacker but no success. i could not understand your example you uploaded there. can you give me a very simple example of adding a icon to my app?

you can use my code for example.

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$Icon_Path = "E:\Icons\iCandy\Cd.ico"
$Form1 = GUICreate("Different sizes of icons", 254, 117, Default, Default)
$Icon1 = GUICtrlCreateIcon($Icon_Path, 0, 8, 8, 64, 64)
$Icon2 = GUICtrlCreateIcon($Icon_Path, 0, 80, 16, 48, 48)
$Icon3 = GUICtrlCreateIcon($Icon_Path, 0, 144, 24, 32, 32)
$Icon4 = GUICtrlCreateIcon($Icon_Path, 0, 192, 24, 24, 24)
$Label1 = GUICtrlCreateLabel("64x64        48x48    32x32   24x24", 16, 88, 220, 20)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFF0000)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

Thanks

Share this post


Link to post
Share on other sites
oMBRa

He said french, lol

Share this post


Link to post
Share on other sites
Zedna

yeah, i know about it. i myself tried many times but it's not working for me. i used autoit wrapper along with ResHacker but no success. i could not understand your example you uploaded there. can you give me a very simple example of adding a icon to my app?

you can use my code for example.

Thanks

For embedding icons you don't need my resource UDF.

Just use #AutoIt3Wrapper_Res_Icon_Add= as somebody said:

#AutoIt3Wrapper_Res_Icon_Add=E:\Icons\iCandy\Cd.ico

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Different sizes of icons", 254, 117, Default, Default)
$Icon1 = GUICtrlCreateIcon('', 0, 8, 8, 64, 64)
GUICtrlSetImage(-1,@ScriptFullPath, -5)
$Icon2 = GUICtrlCreateIcon('', 0, 80, 16, 48, 48)
GUICtrlSetImage(-1,@ScriptFullPath, -5)
$Icon3 = GUICtrlCreateIcon('', 0, 144, 24, 32, 32)
GUICtrlSetImage(-1,@ScriptFullPath, -5)
$Icon4 = GUICtrlCreateIcon('', 0, 192, 24, 24, 24)
GUICtrlSetImage(-1,@ScriptFullPath, -5)
$Label1 = GUICtrlCreateLabel("64x64        48x48    32x32   24x24", 16, 88, 220, 20)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFF0000)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd
Edited by Zedna

Share this post


Link to post
Share on other sites
UltraFine

For embedding icons you don't need my resource UDF.

Just use #AutoIt3Wrapper_Res_Icon_Add= as somebody said:

#AutoIt3Wrapper_Res_Icon_Add=E:\Icons\iCandy\Cd.ico

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Different sizes of icons", 254, 117, Default, Default)
$Icon1 = GUICtrlCreateIcon('', 0, 8, 8, 64, 64)
GUICtrlSetImage(-1,@ScriptFullPath, -5)
$Icon2 = GUICtrlCreateIcon('', 0, 80, 16, 48, 48)
GUICtrlSetImage(-1,@ScriptFullPath, -5)
$Icon3 = GUICtrlCreateIcon('', 0, 144, 24, 32, 32)
GUICtrlSetImage(-1,@ScriptFullPath, -5)
$Icon4 = GUICtrlCreateIcon('', 0, 192, 24, 24, 24)
GUICtrlSetImage(-1,@ScriptFullPath, -5)
$Label1 = GUICtrlCreateLabel("64x64        48x48    32x32   24x24", 16, 88, 220, 20)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFF0000)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd
but i also want to add some images like bmp,jpg,gif,etc in the resources to use in my application. i can not use fileInstall. thanks

Share this post


Link to post
Share on other sites
Zedna

but i also want to add some images like bmp,jpg,gif,etc in the resources to use in my application. i can not use fileInstall. thanks

Then use my resource UDF.

Read whole my UDF topic carefully first!

Share this post


Link to post
Share on other sites
Tlem

Also, you can take a look here : Resource Dll Generator

I just release this 1st version (hope that it can help someone).

The code can probably be optimized or simplified, but the idea is there. :mellow:

I know that it is easier to have the resources of a highly-rated and the code of the other one.

It avoids the heaviness of resources files.

Edited by Tlem

Best Regards.Thierry

Share this post


Link to post
Share on other sites
martin

Also, you can take a look here : Resource Dll Generator

I just release this 1st version (hope that it can help someone).

The code can probably be optimized or simplified, but the idea is there. :mellow:

I know that it is easier to have the resources of a highly-rated and the code of the other one.

It avoids the heaviness of resources files.

Merci bien Thierry.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites
Tlem

I have updated my code to make only one exe that support English and French language. :)

For those who want to add other languages, it is with pleasure that I would add them (edit the file RDG_Lang.au3 to add your language and send it to me).

The source files can be downloaded from here.

The compiled script with sources included in resource can be downloaded from here.

Edited by Tlem

Best Regards.Thierry

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  

×