Sign in to follow this  
Followers 0
LeHuynhNam

Autoitwrapper: How can i add my picture to my gui(Newbie)

11 posts in this topic

#1 ·  Posted (edited)

Hello I'm beginner of Autoit and i have some problems! Please Help me!

I'm have some beautiful icons and picture, and i added them to my gui but when i compiled it to .exe and the URL of this icons + picture changed, All the icons + pics disappear! what should i do? Help me! :) i don't know how to use Autoitwraperr_gui.exe Somebody can teach me to use it? thx so much!

Edited by LeHuynhNam

I'm Learner Of English so my words can have many mistake! I'll try my best to improve it

Share this post


Link to post
Share on other sites



hi, Welcome to the AutoIt forums. (A great place to learn and share)

1- search the forum (this question is many times asked)

2- use the FileInstall() to paste your resources to @TempDir and then use them in your GUI.

3- seach the 'example scripts' for Zedna's Resources UDF.

bye


Unresolved topics:1- Please help me in Editing or replacing a page in FireFox and IE.Please have a look at them.

Share this post


Link to post
Share on other sites

Is there also a possibility to click on the image so it will take you to a website?

FLX

Share this post


Link to post
Share on other sites

Is there also a possibility to click on the image so it will take you to a website?

FLX

Yes.

#include <GuiConstants.au3>
#include <StaticConstants.au3>

GUICreate("My GUI picture", 350, 300, -1, -1, $WS_SIZEBOX + $WS_SYSMENU)
$pic = GUICtrlCreatePic(@SystemDir & "\oobe\images\mslogo.jpg", 50, 50, 200, 50)
GUISetState()

While 1
 $msg = GUIGetMsg()
 If $msg = $GUI_EVENT_CLOSE Then ExitLoop
 If $msg = $pic Then Run(@ComSpec & " /c " & 'start www.autoitscript.com/forum/', "", @SW_HIDE)
WEnd

Share this post


Link to post
Share on other sites

I thought the example in the SciTE4AutoIt3 helpfile was pretty explicit (after updating to the correct include file .. :)

#AutoIt3Wrapper_Res_Icon_Add=C:\Program Files\AutoIt3\Icons\au3.ico
#AutoIt3Wrapper_Res_Icon_Add=C:\Program Files\AutoIt3\Icons\filetype1.ico
#AutoIt3Wrapper_Res_Icon_Add=C:\Program Files\AutoIt3\Icons\filetype2.ico
#AutoIt3Wrapper_Res_Icon_Add=C:\Program Files\AutoIt3\Icons\filetype3.ico
#AutoIt3Wrapper_Res_Icon_Add=C:\Program Files\AutoIt3\Icons\filetype-blank.ico
#include <ButtonConstants.au3>
GUICreate("Demo resource ICO's")
$h_Button1 = GUICtrlCreateButton("my picture button", 10, 20, 40, 40, $BS_ICON)
GUISetState()
For $x = 0 To 7
    $rc = TraySetIcon(@ScriptFullPath, -$x)
    $rc2 = GUICtrlSetImage($h_Button1, @ScriptFullPath, -$x)
    If $x < 3 Then
        TrayTip("Default ico:" & $x, "TraySetIcon rc:" & $rc & @LF & "GUICtrlSetImage rc:" & $rc2, 3)
    Else
        TrayTip("New ico:" & $x, "TraySetIcon rc:" & $rc & @LF & "GUICtrlSetImage rc:" & $rc2, 3)
    EndIf
    Sleep(2000)
Next
GUIDelete()

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Yes.

#include <GuiConstants.au3>
#include <StaticConstants.au3>

GUICreate("My GUI picture", 350, 300, -1, -1, $WS_SIZEBOX + $WS_SYSMENU)
$pic = GUICtrlCreatePic(@SystemDir & "\oobe\images\mslogo.jpg", 50, 50, 200, 50)
GUISetState()

While 1
 $msg = GUIGetMsg()
 If $msg = $GUI_EVENT_CLOSE Then ExitLoop
 If $msg = $pic Then Run(@ComSpec & " /c " & 'start www.autoitscript.com/forum/', "", @SW_HIDE)
WEnd
Thanks a lot Zedna! Now I understand what I did wrong :)

I got it working now, thanks again.

Regards,

Dennis

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Thx for helping but i've still wondered

Yes.

#include <GuiConstants.au3>
#include <StaticConstants.au3>

GUICreate("My GUI picture", 350, 300, -1, -1, $WS_SIZEBOX + $WS_SYSMENU)
$pic = GUICtrlCreatePic(@SystemDir & "\oobe\images\mslogo.jpg", 50, 50, 200, 50)
GUISetState()

While 1
 $msg = GUIGetMsg()
 If $msg = $GUI_EVENT_CLOSE Then ExitLoop
 If $msg = $pic Then Run(@ComSpec & " /c " & 'start www.autoitscript.com/forum/', "", @SW_HIDE)
WEnd
Well, when u compiled this code to *.exe, and the URL of "@SystemDir & "\oobe\images\mslogo.jpg" changed, the picture disappeared. So the problem i want to ask here is how can i add my picture to gui when i compile the *.au3 to *.exe and i can use it any PC. I also want to know how to use AutoitWrapper_gui.exe! Please help me! thx

I also see the topic "how to work with AutoIt3Wrapper" but i want to know the real code with extra file such as *.jpg not an icon.

Sorry for my silly questions! but i'm beginner of autoit and i'm also English learner! forgive me if i ask some silly question

Edited by LeHuynhNam

I'm Learner Of English so my words can have many mistake! I'll try my best to improve it

Share this post


Link to post
Share on other sites

Thx for helping but i've still wondered

Well, when u compiled this code to *.exe, and the URL of "@SystemDir & "\oobe\images\mslogo.jpg" changed, the picture disappeared.

Example:

#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>

FileInstall("C:\Windows\System32\oobe\images\mslogo.jpg", @TempDir & "\mslogo.jpg")

Dim $sURL = "www.autoitscript.com/forum"

GUICreate("My GUI picture", 350, 300, -1, -1, BitOR($WS_SIZEBOX, $WS_SYSMENU))

$pic = GUICtrlCreatePic(@TempDir & "\mslogo.jpg", 50, 50, 200, 50)
GUICtrlSetCursor(-1, 0)

GUISetState()

While 1
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    If $msg = $pic Then ShellExecute($sURL)
WEnd

FileDelete(@TempDir & "\mslogo.jpg")

Share this post


Link to post
Share on other sites

Example:

#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>

FileInstall("C:\Windows\System32\oobe\images\mslogo.jpg", @TempDir & "\mslogo.jpg")

Dim $sURL = "www.autoitscript.com/forum"

GUICreate("My GUI picture", 350, 300, -1, -1, BitOR($WS_SIZEBOX, $WS_SYSMENU))

$pic = GUICtrlCreatePic(@TempDir & "\mslogo.jpg", 50, 50, 200, 50)
GUICtrlSetCursor(-1, 0)

GUISetState()

While 1
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    If $msg = $pic Then ShellExecute($sURL)
WEnd

FileDelete(@TempDir & "\mslogo.jpg")
thanks, I understood!

I'm Learner Of English so my words can have many mistake! I'll try my best to improve it

Share this post


Link to post
Share on other sites

oh, Can i use "FileInstall()" instead of Autoitwrapper...:-/


I'm Learner Of English so my words can have many mistake! I'll try my best to improve it

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  
Followers 0