Jump to content

GUI Icon, Msgbox Image, Icon & Hotlink?


DasFox
 Share

Recommended Posts

If the hyperlink isn't working, remove http://

using http:// works for me with Firefox as default browser

It works until I change the code like this: ( I didn't want the word Website hotlinked)

GUICtrlCreateLabel("Program Launcher v1.0", 65, 12, 125, 20)
    GUICtrlCreateLabel("Author:", 65, 40, 100, 20)
    GUICtrlCreateLabel("Email: ", 65, 55, 100, 20)
    GUICtrlCreateLabel("Website:", 65, 70, 135, 20)
    $Label1 = GUICtrlCreateLabel("www.hotlink.com", 120, 70, 135, 20)
Link to comment
Share on other sites

It works until I change the code like this: ( I didn't want the word Website hotlinked)

GUICtrlCreateLabel("Program Launcher v1.0", 65, 12, 125, 20)
    GUICtrlCreateLabel("Author:", 65, 40, 100, 20)
    GUICtrlCreateLabel("Email: ", 65, 55, 100, 20)
    GUICtrlCreateLabel("Website:", 65, 70, 135, 20)
    $Label1 = GUICtrlCreateLabel("www.hotlink.com", 120, 70, 135, 20)
your 'website' label is too long, have to watch those dimensions.

if your using the SciTE editor, have a look at Koda

Edit damn didn't read all of your message prior to my previous code post, we made the same change to the colour :)

if that is not your url, you have to resize the about box, a bit of stating the obvious. >_<

GUICtrlCreateLabel("Program Launcher v1.0", 66, 12, 125, 20)
    GUICtrlCreateLabel("Author:", 66, 40, 100, 20)
    GUICtrlCreateLabel("Email: ", 66, 55, 100, 20)
    GUICtrlCreateLabel("Website:", 66, 70, 45, 20)
    $Label1 = GUICtrlCreateLabel("www.hotlink.com", 110, 70, 135, 20)
Edited by rover

I see fascists...

Link to comment
Share on other sites

Ahh well I widened the About GUI so I thought the dimensions would be ok, hmmm

OK for the icon embed I see what you mentioned:

;set both gui and tray icon to internal custom icon au3.ico index -5 or icon group 201
GUISetIcon(@AutoItExe, 201, $hGui); using icon group name number
TraySetIcon(@AutoItExe, -5)    ; using negative 1 based index number

BUT remember I'm still sucking Mama's milk, LOL...

I see the code you made: (But it still Greek at this point, not sure what I'd do for the TraySetIcon... I mean I take it from what you made the GUISetIcon in the code below is all done, now if I want to add in as you mentioned a TraySetIcon I'd need to code that next, and I don't know....

SORRY for being such a Noob.... LOL... :)

If @Compiled Then
        GUISetIcon(@AutoItExe, -5, $hGUIAbout)
    Else
        GUISetIcon("C:\Program Files\AutoIt3\Icons\au3.ico", -5, $hGUIAbout)
    EndIf

    If @Compiled Then
        GUICtrlCreateIcon(@AutoItExe, -5, 12, 12, 32, 32); for compiled
Link to comment
Share on other sites

Ahh well I widened the About GUI so I thought the dimensions would be ok, hmmm

OK for the icon embed I see what you mentioned:

;set both gui and tray icon to internal custom icon au3.ico index -5 or icon group 201
GUISetIcon(@AutoItExe, 201, $hGui); using icon group name number
TraySetIcon(@AutoItExe, -5)   ; using negative 1 based index number

BUT remember I'm still sucking Mama's milk, LOL...

I see the code you made: (But it still Greek at this point, not sure what I'd do for the TraySetIcon... I mean I take it from what you made the GUISetIcon in the code below is all done, now if I want to add in as you mentioned a TraySetIcon I'd need to code that next, and I don't know....

SORRY for being such a Noob.... LOL... :)

If @Compiled Then
        GUISetIcon(@AutoItExe, -5, $hGUIAbout)
    Else
        GUISetIcon("C:\Program Files\AutoIt3\Icons\au3.ico", -5, $hGUIAbout)
    EndIf

    If @Compiled Then
        GUICtrlCreateIcon(@AutoItExe, -5, 12, 12, 32, 32); for compiled
OK I fixed the code in post #19

all changes are there.

thanks for pointing out the variable name change for the icons, I went with Rasims renaming of the gui var and forgot to change the icons.

you now have the same icon for the main gui, tray icon and two icons on the about box, just change the path and filename in the compiler directive at the top of the script and your good to go.

even this nighthawk gets tired, I'm about to sign off.

hope this helps.

I see fascists...

Link to comment
Share on other sites

THANKS man this is GREAT!!!

One last one, how can I make the main GUI icon compiled in?

$n = GUICtrlCreatePic(@WindowsDir & "\Help\Tours\htmlTour\Admin.jpg", 600, 10, 70, 100)

Oh $n I don't think I need that in the code there?

Also in the Global at the top I have some of the same as you have in Local, so do I need both sections, both a Global in one place and a Local in another, and should I just make them both Global?

THANKS so much man, once I get this thing working, then I can learn what's going on here, LOL...

Man it must be nice to know what the hell you're doing.... LOL

Edited by DasFox
Link to comment
Share on other sites

THANKS man this is GREAT!!!

One last one, how can I make the main GUI icon compiled in?

$n = GUICtrlCreatePic(@WindowsDir & "\Help\Tours\htmlTour\Admin.jpg", 600, 10, 70, 100)

THANKS so much man, once I get this thing working, then I can learn what's going on here, LOL...

Man it most be nice to know what the hell you're doing.... LOL

no problem

I don't always spend this much time helping out with someones script

but every now and then out of the blue...

your jpg file (not icon) has to be handled differently

that's where Zednas Resource UDF comes in

you need Reshacker installed for that

but you could just fileinstall it

just a minute

I see fascists...

Link to comment
Share on other sites

no problem

I don't always spend this much time helping out with someones script

but every now and then out of the blue...

your jpg file (not icon) has to be handled differently

that's where Zednas Resource UDF comes in

you need Reshacker installed for that

but you could just fileinstall it

just a minute

THANKS man, must be my lucky night!!! :)

Let me see about converting it too...

ONE SEC... brb...

Edited by DasFox
Link to comment
Share on other sites

Nope I can't convert it with the program I have IrfanView, makes sucky copies...

Guess I need to leave it as a jpg to keep the quality, unless someone knows a killer app that will covert it and keep the same size too?

We need a mega icon here, hehe...

Edited by DasFox
Link to comment
Share on other sites

Thanks Rasim

got hit by the 3am (EST) forum server downtime glitch pretty bad

I hit Add Reply only once but this time got 4 duplicate posts.

@DasFox

FileInstalling the jpg should be fine, the resource UDF is a bit more complicated

and involved to setup.

I see fascists...

Link to comment
Share on other sites

Thanks Rasim

got hit by the 3am (EST) forum server downtime glitch pretty bad

I hit Add Reply only once but this time got 4 duplicate posts.

@DasFox

FileInstalling the jpg should be fine, the resource UDF is a bit more complicated

and involved to setup.

3am downtime, hehe... kick those servers... :)

Ok I understand you're talking about the Zednas Resource UDF, but what's FileInstalling, did I miss something you said before about this?

THANKS

Link to comment
Share on other sites

3am downtime, hehe... kick those servers... :)

Ok I understand you're talking about the Zednas Resource UDF, but what's FileInstalling, did I miss something you said before about this?

THANKS

the updated code in post 19 has a Fileinstall() line that loads the jpg into the EXE at compile time

and copies it to the system temp directory at runtime.

the GuiCtrlCreatePic function loads that temporary jpg file

then on program exit its deleted from the system

no external files are required at runtime of the compiled exe file.

I see fascists...

Link to comment
Share on other sites

@all

Completed ProgAndy's example with E-mail function.

When reading the MSDN on Syslink control, it accepts E-mail Address functions too.

#include <WinAPI.au3>
#include <WindowsConstants.au3>
Global Const $WC_LINK = "SysLink"
Global Const $WC_LINKA = $WC_LINK
Global Const $WC_LINKW = $WC_LINK

$Parent = GUICreate("SysLink demo")

$g_hLink = _WinAPI_CreateWindowEx(0,$WC_LINK, _ 
        'For more information, <A HREF="http://www.microsoft.com" ID="LInkIDURL+ID">click here</A> or ' & _
                                '<A href="http://www.microsoft.com">here</a> or ' & _
                                '<A href="mailto:xxx.yyyy@mycompany.com&subject=Syslink Demo&body=%0A%0AFrom AutoIT%0A%0A&cc=cc@address.com&bcc=bcc@address.com">E-mail Me</a> or, ' & _
                                '<A ID="idInfo">here</A>. And at last <a>here</a>', _
        BitOR($WS_VISIBLE , $WS_CHILD , $WS_TABSTOP), _
        10,10, 350,60, $Parent)
GUICtrlCreateButton("hi",10,80,80,30)
GUISetState()
GUIRegisterMsg($WM_NOTIFY,"MY_LINK_NOTIFY")


While GUIGetMsg() <> -3
    Sleep(1)
WEnd
        
;~ // g_hLink is the handle of the SysLink control.
Func MY_LINK_NOTIFY($hWnd, $Msg, $wParam, $lParam)
    Local Const $tagNMLINK = $tagNMHDR & ";" & "UINT mask; int iLink; UINT state; UINT stateMask; WCHAR szID[48]; WCHAR szUrl[2083];"
    Local $NMHDR = DllStructCreate($tagNMHDR,$lParam)
    Local $hwndFrom = DllStructGetData($NMHDR,"hwndFrom");
    Switch $hwndFrom
        Case $g_hLink
        switch DllStructGetData($NMHDR,"code")
            case $NM_CLICK
                ContinueCase
            case $NM_RETURN
                $NMHDR = DllStructCreate($tagNMLINK,$lParam)
                Local $iLink = DllStructGetData($NMHDR,"iLink")
                Local $szURL = DllStructGetData($NMHDR,"szURL")
                Local $szID = DllStructGetData($NMHDR,"szID")
                
                if $szURL <> "" Then
                    Local $ShouldOpen = MsgBox(4, 'Open URL?',"Should the URL be opened? "& @CRLF & $szURL & _
                        @CRLF & "If available, the Next Line Contains szID:" &@CRLF & $szID )
                    If $ShouldOpen = 6 Then ShellExecute($szURL, "", "", "open",@SW_SHOW);
                ElseIf $szID <> "" Then
                    MsgBox(0, 'Link Clicked',"The Link has no URL, but the following szID: " & @CRLF & $szID)
                Else
                    MsgBox(0, 'Link Clicked',"The Link has no URL, and no szID: " & @CRLF & $szID)
                EndIf
        EndSwitch
    EndSwitch
EndFunc

Nice script ProgAndy,

I was working on this Systlink too. So now I don't have to finish it.

Thanks for sharing.

regards,

ptrex

Link to comment
Share on other sites

Well, it accepts the <a> tag with HREF and ID, it doesn't care, what's the content of them :)

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

  • 10 months later...

Hi

I too have a similar problem

I would like to execute an msc file as an admin, by using shellexecute

shellExecute("C:\Program Files\ab.msc")will open the file but it will run as the user, is there a way a variable for username and pw can be passed along with the shellExecute.

I have tried RunWait and RunAs but it does not work

Appreciate your help on this.

pgv

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...