Jump to content

help with putting items in a gui window


Recommended Posts

I really like this steam GUI, and want to add items and text inside the window.

http://www.autoitscript.com/forum/index.php?showtopic=95043

#cs ==============================
    PUT YOUR CONTROLS HERE
    #ce ==============================

However, I'm kinda stuck on what "controls" I put there. I'm unsure how to add items, input boxes, and just general text inside that gui window. Any help?

Link to comment
Share on other sites

I really like this steam GUI, and want to add items and text inside the window.

http://www.autoitscript.com/forum/index.php?showtopic=95043

#cs ==============================
    PUT YOUR CONTROLS HERE
    #ce ==============================

However, I'm kinda stuck on what "controls" I put there. I'm unsure how to add items, input boxes, and just general text inside that gui window. Any help?

Have you looked in the helpfile at GUICtrlCreate* functions?

Regards,

Jarvis

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Link to comment
Share on other sites

basically, what I'm trying to do is inside that gui I want a bunch of links to network shares. They need to be clickable, and when clicked would launch a window with that network share.. similar to going to start -> run -> then typing in say \\ad.domain.com\share$

I'm unsure how to make clickable items that would do that.

Link to comment
Share on other sites

basically, what I'm trying to do is inside that gui I want a bunch of links to network shares. They need to be clickable, and when clicked would launch a window with that network share.. similar to going to start -> run -> then typing in say \\ad.domain.com\share$

I'm unsure how to make clickable items that would do that.

show us the GUI code you have so far, then we can help you to "click" on it

8)

NEWHeader1.png

Link to comment
Share on other sites

heh, I have NO gui code right now. Here is the code from the gui steam.

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

__steam_window(' - Shares', 800, 600)

Func __steam_window($sWINDOW_TITLE, $iWINDOW_WIDTH, $iWINDOW_HEIGHT)
    Local $oWINDOW = GUICreate('', $iWINDOW_WIDTH, $iWINDOW_HEIGHT, -1, -1, $WS_POPUP, BitOR($WS_EX_TOOLWINDOW, $WS_EX_LAYERED))
    GUISetFont(8, 400, 0, 'Tahoma')
    GUISetBkColor(0x464646);body color
    GUICtrlCreatePic('hdr.bmp', 0, 0, $iWINDOW_WIDTH - 16, 20, $SS_NOTIFY, $GUI_WS_EX_PARENTDRAG)
    GUICtrlCreatePic('hdr.bmp', $iWINDOW_WIDTH - 16, 0, 11, 5, $SS_NOTIFY, $GUI_WS_EX_PARENTDRAG)
    GUICtrlCreatePic('hdr.bmp', $iWINDOW_WIDTH - 16, 16, 11, 4, $SS_NOTIFY, $GUI_WS_EX_PARENTDRAG)
    GUICtrlCreatePic('hdr.bmp', $iWINDOW_WIDTH - 5, 0, 5, 20, $SS_NOTIFY, $GUI_WS_EX_PARENTDRAG)
    GUICtrlCreateGraphic(0, 20, 1, $iWINDOW_HEIGHT)
    GUICtrlSetColor(-1, 0x686A65);border
    GUICtrlCreateGraphic($iWINDOW_WIDTH - 1, 20, 1, $iWINDOW_HEIGHT)
    GUICtrlSetColor(-1, 0x686A65);border
    GUICtrlCreateGraphic(0, $iWINDOW_HEIGHT - 1, $iWINDOW_WIDTH, 1)
    GUICtrlSetColor(-1, 0x686A65);border
    Local $oCLOSE = GUICtrlCreatePic('cls.bmp', $iWINDOW_WIDTH - 16, 5, 11, 11, $SS_NOTIFY, $GUI_WS_EX_PARENTDRAG)
    Local $oLABELHEADER = GUICtrlCreateLabel($sWINDOW_TITLE, 6, 0, $iWINDOW_WIDTH - 22, 20, $SS_CENTERIMAGE)
    GUICtrlSetColor(-1, 0x000000);title text color
    GUICtrlSetBkColor(-1, 0xa97a28);title bar color
    
    #cs ==============================
    PUT YOUR CONTROLS HERE
    #ce ==============================
    
    GUICtrlCreatePic('cnr.bmp', 0, 0, 1, 1, $SS_NOTIFY, $GUI_WS_EX_PARENTDRAG)
    GUICtrlCreatePic('cnr.bmp', $iWINDOW_WIDTH - 1, 0, 1, 1, $SS_NOTIFY, $GUI_WS_EX_PARENTDRAG)
    GUICtrlCreatePic('cnr.bmp', 0, $iWINDOW_HEIGHT - 1, 1, 1, $SS_NOTIFY, $GUI_WS_EX_PARENTDRAG)
    GUICtrlCreatePic('cnr.bmp', $iWINDOW_WIDTH - 1, $iWINDOW_HEIGHT - 1, 1, 1, $SS_NOTIFY, $GUI_WS_EX_PARENTDRAG)
    GUISetState(@SW_SHOW)
    While 1
        Local $eMSG = GUIGetMsg()
        Switch $eMSG
            Case $GUI_EVENT_CLOSE
                Exit
            Case $oCLOSE
                Local $iWINDOW_TRANS
                For $iWINDOW_TRANS = 255 To 0 Step -10
                    If $iWINDOW_TRANS > 0 Then WinSetTrans($oWINDOW,'',$iWINDOW_TRANS)
                    Sleep(10)
                Next
                Exit
        EndSwitch
    WEnd
EndFunc
Edited by kor
Link to comment
Share on other sites

a huge drawback to this steam gui I've noticed is that it doesn't create an option in my task bar. If I click a window into focus and it becomes on top of this steam gui there is nothing for me to click in my task bar to bring it back into focus. Is there something in the code that is causing that so I can remove it?

Link to comment
Share on other sites

@kor

Have you looked into the help manual at the GUI Creation it has an example script there that you can start with. I don't know what this "STEAM" GUI is, or where you got it, but you're not grasping the basics of GUI Creation if you're just piggy backing on work you don't understand. Try to look in the helpfile, and understand the examples there (and even use them) so that you know what you're doing. If all you're wanting is a window to provide links to other resources, then it shouldn't be that difficult, and you really shouldn't need to piggy back on someone else's code that you don't understand.

Now to answer your question. Yes there is a flag in there that makes that window not visible in the taskbar, but I challenge you to find that our yourself. The helpfile is really helpful. I understand if you're lacking direction, or don't understand something specific that may not be well explained, but it doesn't really seem you have tried much to create your own GUI. It would seem you're looking for us to provide code for you. While we donate our time to help others, we generally help those who help themselves.

Thanks,

Jarvis

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Link to comment
Share on other sites

JS, I already know its the $WS_POPUP. I'm not 5 years old... I don't need you to "challenge me".

If you're not interested in helping me solve the problem great.. help someone else. Look through my other posts on this forum and you will see as I figure out my own problems I also post the solutions for everyone else.

You're right, I am not experienced in GUI creation. Am I trying to learn? Yes... so get off your high horse please.

Edited by kor
Link to comment
Share on other sites

GUI aren't very hard... use KODA for begginers... but i prefer to make my own from scratch..

Link to comment
Share on other sites

I've looked at KODA and would prefer to learn the code myself instead of having something else generate it for me.

Not to be confused with starting with others code and building on that.. then at least I am learning coding and not plug and chug.

Link to comment
Share on other sites

As to the issue with the clickable IE not actually launching internet explorer going through the code and it looks like I need "Opt("GUIOnEventMode",1)"... however every time I add that to my steam gui function when I run it the damn thing starts maxing out my CPU at 100%.

Link to comment
Share on other sites

@kor

I wasn't trying to treat you as a 5 year old, but you didn't seem to be showing what you have tried. I'm not on a high horse, I was simply telling you that I'm not going to write it for you, and you haven't supplied any code other than that Steam code. Show what you have done, and explain in more detail why it didn't work. Did it error, crash, return something unexpected, etc...

If you know it's the $WS_POPUP, then why did you ask the question. Replacing that with the default should fix the issue then, or so it would seem to me. I was/am trying to point you in the right direction since you want to learn the code yourself.

As to your not understanding the options of running a GUI based on Events or Messages, you need to read up on that. There are advantages to both ways of doing things. You need to know which set of code is in which one in-case you need to "translate" from one type to the other.

Again when you say you have tried things...if you give us more information as to what EXACTLY you have tried, and what it returned, we could either point out a flaw, or move on to something else, or come at a different angle to the problem. I'm trying to help you solve this from a more abstract point of view. If I can obtain from you more details, I would be more than happy to provide a more detailed answer of what could help.

Regards,

Jarvis

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Link to comment
Share on other sites

Here is my code in it's current form. I will settle with that WSPOPUP issue later.

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


;Opt("GUIOnEventMode",1)

__steam_window(' - Shares', 800, 600)

Func __steam_window($sWINDOW_TITLE, $iWINDOW_WIDTH, $iWINDOW_HEIGHT)
    Local $oWINDOW = GUICreate('', $iWINDOW_WIDTH, $iWINDOW_HEIGHT, -1, -1, $WS_POPUP, BitOR($WS_EX_TOOLWINDOW, $WS_EX_LAYERED))
    GUISetFont(8, 400, 0, 'Tahoma')
    GUISetBkColor(0x535353);body color
    GUICtrlCreatePic('hdr.bmp', 0, 0, $iWINDOW_WIDTH - 16, 20, $SS_NOTIFY, $GUI_WS_EX_PARENTDRAG)
    GUICtrlCreatePic('hdr.bmp', $iWINDOW_WIDTH - 16, 0, 11, 5, $SS_NOTIFY, $GUI_WS_EX_PARENTDRAG)
    GUICtrlCreatePic('hdr.bmp', $iWINDOW_WIDTH - 16, 16, 11, 4, $SS_NOTIFY, $GUI_WS_EX_PARENTDRAG)
    GUICtrlCreatePic('hdr.bmp', $iWINDOW_WIDTH - 5, 0, 5, 20, $SS_NOTIFY, $GUI_WS_EX_PARENTDRAG)
    GUICtrlCreateGraphic(0, 20, 1, $iWINDOW_HEIGHT)
    GUICtrlSetColor(-1, 0x686A65);border
    GUICtrlCreateGraphic($iWINDOW_WIDTH - 1, 20, 1, $iWINDOW_HEIGHT)
    GUICtrlSetColor(-1, 0x686A65);border
    GUICtrlCreateGraphic(0, $iWINDOW_HEIGHT - 1, $iWINDOW_WIDTH, 1)
    GUICtrlSetColor(-1, 0x686A65);border
    Local $oCLOSE = GUICtrlCreatePic('cls.bmp', $iWINDOW_WIDTH - 16, 5, 11, 11, $SS_NOTIFY, $GUI_WS_EX_PARENTDRAG)
    Local $oLABELHEADER = GUICtrlCreateLabel($sWINDOW_TITLE, 6, 0, $iWINDOW_WIDTH - 22, 20, $SS_CENTERIMAGE)
    GUICtrlSetColor(-1, 0x000000);title text color
    GUICtrlSetBkColor(-1, 0x959594);title bar color
    
    
    $chpLabel = GUICtrlCreateLabel("test", 25, 40, 100, 20)
    GUICtrlSetFont($chpLabel, 11, 600, 4)
    GUICtrlSetColor($chpLabel, 0xADADAD)
    
    $chpal = GUICtrlCreateLabel ("test",30,65,125,15)
    GuiCtrlSetFont($chpal, 9, -1); underlined
    GuiCtrlSetColor($chpal,0xADADAD)
    GuiCtrlSetCursor($chpal,0)
    GUICtrlSetOnEvent($chpal, "OnWWW")
    
    
    #cs ==============================
    PUT YOUR CONTROLS HERE
    #ce ==============================
    
    GUICtrlCreatePic('cnr.bmp', 0, 0, 1, 1, $SS_NOTIFY, $GUI_WS_EX_PARENTDRAG)
    GUICtrlCreatePic('cnr.bmp', $iWINDOW_WIDTH - 1, 0, 1, 1, $SS_NOTIFY, $GUI_WS_EX_PARENTDRAG)
    GUICtrlCreatePic('cnr.bmp', 0, $iWINDOW_HEIGHT - 1, 1, 1, $SS_NOTIFY, $GUI_WS_EX_PARENTDRAG)
    GUICtrlCreatePic('cnr.bmp', $iWINDOW_WIDTH - 1, $iWINDOW_HEIGHT - 1, 1, 1, $SS_NOTIFY, $GUI_WS_EX_PARENTDRAG)
    GUISetState(@SW_SHOW)
    While 1
        Local $eMSG = GUIGetMsg()
        Switch $eMSG
            Case $GUI_EVENT_CLOSE
                Exit
            Case $oCLOSE
        ;   Local $iWINDOW_TRANS
        ;   For $iWINDOW_TRANS = 255 To 0 Step -10
        ;       If $iWINDOW_TRANS > 0 Then WinSetTrans($oWINDOW,'',$iWINDOW_TRANS)
        ;       Sleep(10)
        ;   Next
                Exit
        EndSwitch
    WEnd
EndFunc

Func OnWWW()
    ShellExecute('\\ad.domain.com\share$')
;Run(@ComSpec & " /c start \\ad.domain.com\share$", "", @SW_HIDE)
EndFunc
Link to comment
Share on other sites

Ofcource it maxes your cpu, you have to put a Sleep() somewhere and remove the GuiGetMsg(). It is bad to try to mix MessageLoop and OnEvent.

You sound like a smart person, I recommend you open the helpfile and browse to "GUI Reference". It will show you the basics of creating a GUI.

Link to comment
Share on other sites

Ofcource it maxes your cpu, you have to put a Sleep() somewhere and remove the GuiGetMsg(). It is bad to try to mix MessageLoop and OnEvent.

You sound like a smart person, I recommend you open the helpfile and browse to "GUI Reference". It will show you the basics of creating a GUI.

I agree with him,

But do look at my update for the steam window, added sample controls and sys_menu

http://www.autoitscript.com/forum/index.php?showtopic=95043

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...