Jump to content

Gui Popup


zoel
 Share

Recommended Posts

Thank you @Jos here is my code so far

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <AutoItConstants.au3>
#include <GuiEdit.au3>
#include <ScrollBarsConstants.au3>
#include <GUIToolTip.au3>
Local $aWndPos
$NetAs = GUICreate("NetAs-Network Assistant", 1096, 521, 182, 135)
Local $idFilemenu = GUICtrlCreateMenu("&File")
Local $idExititem = GUICtrlCreateMenuItem("Exit", $idFilemenu)
Local $idSaveitem = GUICtrlCreateMenuItem("Save", $idFilemenu)
Local $idInput = GUICtrlCreateEdit("", 168, 34, 921, 465)
Local $Button1 = GUICtrlCreateButton("IPconfig", 16, 56, 75, 25)
Local $Button2 = GUICtrlCreateButton("?", 96, 56, 19, 25)
GUICtrlSetTip(-1, "This button will run the IP config command", "This is a ToolTip")
Local $Button3 = GUICtrlCreateButton("FlushDNS", 16, 96, 75, 25)
Local $Button4 = GUICtrlCreateButton("?", 96, 96, 19, 25)
Local $Button5 = GUICtrlCreateButton("ConnRelease", 16, 136, 75, 25)
Local $Button6 = GUICtrlCreateButton("?", 96, 136, 19, 25)
Local $Button7 = GUICtrlCreateButton("NetStat", 16, 176, 75, 25)
Local $Button8 = GUICtrlCreateButton("?", 96, 176, 19, 25)
Local $Button9 = GUICtrlCreateButton("Route Print", 16, 216, 75, 25)
Local $Button10 = GUICtrlCreateButton("?", 96, 216, 19, 25)
Local $Button11 = GUICtrlCreateButton("ARP", 16, 256, 75, 25)
Local $Button12 = GUICtrlCreateButton("?", 96, 256, 19, 25)
Local $Button13 = GUICtrlCreateButton("NSLookup", 16, 296, 75, 25)
Local $Button14 = GUICtrlCreateButton("?", 96, 296, 19, 25)
Local $Button15 = GUICtrlCreateButton("Route Print", 16, 336, 75, 25)
Local $Button16 = GUICtrlCreateButton("?", 96, 336, 19, 25)
Local $Button17 = GUICtrlCreateButton("GetMac", 16, 376, 75, 25)
Local $Button18 = GUICtrlCreateButton("?", 96, 376, 19, 25)
Local $Button19 = GUICtrlCreateButton("Button19", 16, 416, 75, 25)
Local $Button20 = GUICtrlCreateButton("?", 96, 416, 19, 25)
Local $Button21 = GUICtrlCreateButton("Button21", 16, 456, 75, 25)
Local $Button22 = GUICtrlCreateButton("?", 96, 456, 19, 25)
Local $Button23 = GUICtrlCreateButton("Run", 656, 8, 73, 25)
Local $Input1 = GUICtrlCreateInput("", 736, 8, 345, 21)
GUISetState(@SW_SHOW)


While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $idExititem
            Exit
        Case $Button1
            GUICtrlSetData($idInput, _CmdInfo() & @CRLF)
            _GUICtrlEdit_Scroll($idInput, $SB_SCROLLCARET)
            _GUICtrlEdit_Scroll($idInput, $SB_SCROLLCARET)
        Case $Button3
            GUICtrlSetData($idInput, _CmdInfo2() & @CRLF)
            _GUICtrlEdit_Scroll($idInput, $SB_SCROLLCARET)
            _GUICtrlEdit_Scroll($idInput, $SB_SCROLLCARET)
        Case $Button5
            GUICtrlSetData($idInput, _CmdInfo3() & @CRLF)
            _GUICtrlEdit_Scroll($idInput, $SB_SCROLLCARET)
            _GUICtrlEdit_Scroll($idInput, $SB_SCROLLCARET)
        Case $Button7
            GUICtrlSetData($idInput, _CmdInfo4() & @CRLF)
            _GUICtrlEdit_Scroll($idInput, $SB_SCROLLCARET)
            _GUICtrlEdit_Scroll($idInput, $SB_SCROLLCARET)
        Case $Button9
            GUICtrlSetData($idInput, _CmdInfo5() & @CRLF)
            _GUICtrlEdit_Scroll($idInput, $SB_SCROLLCARET)
            _GUICtrlEdit_Scroll($idInput, $SB_SCROLLCARET)
        Case $Button11
            GUICtrlSetData($idInput, _CmdInfo6() & @CRLF)
            _GUICtrlEdit_Scroll($idInput, $SB_SCROLLCARET)
            _GUICtrlEdit_Scroll($idInput, $SB_SCROLLCARET)
        Case $Button13
            GUICtrlSetData($idInput, _CmdInfo7() & @CRLF)
            _GUICtrlEdit_Scroll($idInput, $SB_SCROLLCARET)
            _GUICtrlEdit_Scroll($idInput, $SB_SCROLLCARET)
        Case $Button15
            GUICtrlSetData($idInput, _CmdInfo8() & @CRLF)
            _GUICtrlEdit_Scroll($idInput, $SB_SCROLLCARET)
            _GUICtrlEdit_Scroll($idInput, $SB_SCROLLCARET)
        Case $Button17
            GUICtrlSetData($idInput, _CmdInfo9() & @CRLF)
            _GUICtrlEdit_Scroll($idInput, $SB_SCROLLCARET)
            _GUICtrlEdit_Scroll($idInput, $SB_SCROLLCARET)
    EndSwitch
WEnd



Func _CmdInfo($_sCmdInfo = "ipconfig /all")
    Local $iPID = Run(@ComSpec & " /c " & $_sCmdInfo, "", @SW_HIDE,  BitOR($STDERR_CHILD, $STDOUT_CHILD))
    ; Wait until the process has closed using the PID returned by Run.
    ProcessWaitClose($iPID)
    ; Read the Stdout stream of the PID returned by Run. This can also be done in a while loop. Look at the example for StderrRead.
    Local $sOutput = StringReplace(StdoutRead($iPID), @CRLF & @CRLF, @CRLF)
    Local $sOutErr = StringReplace(StderrRead($iPID), @CRLF & @CRLF, @CRLF)
    Local $sReult = $sOutput <> "" ? $sOutput : $sOutErr
    Return $sReult
EndFunc
Func _CmdInfo2($_sCmdInfo2 = "IPConfig /FlushDNS")
    Local $iPID = Run(@ComSpec & " /c " & $_sCmdInfo2, "", @SW_HIDE,  BitOR($STDERR_CHILD, $STDOUT_CHILD))
    ; Wait until the process has closed using the PID returned by Run.
    ProcessWaitClose($iPID)
    ; Read the Stdout stream of the PID returned by Run. This can also be done in a while loop. Look at the example for StderrRead.
    Local $sOutput = StringReplace(StdoutRead($iPID), @CRLF & @CRLF, @CRLF)
    Local $sOutErr = StringReplace(StderrRead($iPID), @CRLF & @CRLF, @CRLF)
    Local $sReult = $sOutput <> "" ? $sOutput : $sOutErr
    Return $sReult
EndFunc
Func _CmdInfo3($_sCmdInfo3 = "IPConfig /Release")
    Local $iPID = Run(@ComSpec & " /c " & $_sCmdInfo3, "", @SW_HIDE,  BitOR($STDERR_CHILD, $STDOUT_CHILD))
    ; Wait until the process has closed using the PID returned by Run.
    ProcessWaitClose($iPID)
    ; Read the Stdout stream of the PID returned by Run. This can also be done in a while loop. Look at the example for StderrRead.
    Local $sOutput = StringReplace(StdoutRead($iPID), @CRLF & @CRLF, @CRLF)
    Local $sOutErr = StringReplace(StderrRead($iPID), @CRLF & @CRLF, @CRLF)
    Local $sReult = $sOutput <> "" ? $sOutput : $sOutErr
    Return $sReult
EndFunc
Func _CmdInfo4($_sCmdInfo4 = "NetStat")
    Local $iPID = Run(@ComSpec & " /c " & $_sCmdInfo4, "", @SW_HIDE,  BitOR($STDERR_CHILD, $STDOUT_CHILD))
    ; Wait until the process has closed using the PID returned by Run.
    ProcessWaitClose($iPID)
    ; Read the Stdout stream of the PID returned by Run. This can also be done in a while loop. Look at the example for StderrRead.
    Local $sOutput = StringReplace(StdoutRead($iPID), @CRLF & @CRLF, @CRLF)
    Local $sOutErr = StringReplace(StderrRead($iPID), @CRLF & @CRLF, @CRLF)
    Local $sReult = $sOutput <> "" ? $sOutput : $sOutErr
    Return $sReult
EndFunc
Func _CmdInfo5($_sCmdInfo5 = " Route Print")
    Local $iPID = Run(@ComSpec & " /c " & $_sCmdInfo5, "", @SW_HIDE,  BitOR($STDERR_CHILD, $STDOUT_CHILD))
    ; Wait until the process has closed using the PID returned by Run.
    ProcessWaitClose($iPID)
    ; Read the Stdout stream of the PID returned by Run. This can also be done in a while loop. Look at the example for StderrRead.
    Local $sOutput = StringReplace(StdoutRead($iPID), @CRLF & @CRLF, @CRLF)
    Local $sOutErr = StringReplace(StderrRead($iPID), @CRLF & @CRLF, @CRLF)
    Local $sReult = $sOutput <> "" ? $sOutput : $sOutErr
    Return $sReult
EndFunc
Func _CmdInfo6($_sCmdInfo6 = "ARP -a")
    Local $iPID = Run(@ComSpec & " /c " & $_sCmdInfo6, "", @SW_HIDE,  BitOR($STDERR_CHILD, $STDOUT_CHILD))
    ; Wait until the process has closed using the PID returned by Run.
    ProcessWaitClose($iPID)
    ; Read the Stdout stream of the PID returned by Run. This can also be done in a while loop. Look at the example for StderrRead.
    Local $sOutput = StringReplace(StdoutRead($iPID), @CRLF & @CRLF, @CRLF)
    Local $sOutErr = StringReplace(StderrRead($iPID), @CRLF & @CRLF, @CRLF)
    Local $sReult = $sOutput <> "" ? $sOutput : $sOutErr
    Return $sReult
EndFunc
Func _CmdInfo7($_sCmdInfo7 = "NSLookup")
    Local $iPID = Run(@ComSpec & " /c " & $_sCmdInfo7, "", @SW_HIDE,  BitOR($STDERR_CHILD, $STDOUT_CHILD))
    ; Wait until the process has closed using the PID returned by Run.
    ProcessWaitClose($iPID)
    ; Read the Stdout stream of the PID returned by Run. This can also be done in a while loop. Look at the example for StderrRead.
    Local $sOutput = StringReplace(StdoutRead($iPID), @CRLF & @CRLF, @CRLF)
    Local $sOutErr = StringReplace(StderrRead($iPID), @CRLF & @CRLF, @CRLF)
    Local $sReult = $sOutput <> "" ? $sOutput : $sOutErr
    Return $sReult
EndFunc
Func _CmdInfo8($_sCmdInfo8 = "Route Print")
    Local $iPID = Run(@ComSpec & " /c " & $_sCmdInfo8, "", @SW_HIDE,  BitOR($STDERR_CHILD, $STDOUT_CHILD))
    ; Wait until the process has closed using the PID returned by Run.
    ProcessWaitClose($iPID)
    ; Read the Stdout stream of the PID returned by Run. This can also be done in a while loop. Look at the example for StderrRead.
    Local $sOutput = StringReplace(StdoutRead($iPID), @CRLF & @CRLF, @CRLF)
    Local $sOutErr = StringReplace(StderrRead($iPID), @CRLF & @CRLF, @CRLF)
    Local $sReult = $sOutput <> "" ? $sOutput : $sOutErr
    Return $sReult
EndFunc
Func _CmdInfo9($_sCmdInfo9 = "getmac")
    Local $iPID = Run(@ComSpec & " /c " & $_sCmdInfo9, "", @SW_HIDE,  BitOR($STDERR_CHILD, $STDOUT_CHILD))
    ; Wait until the process has closed using the PID returned by Run.
    ProcessWaitClose($iPID)
    ; Read the Stdout stream of the PID returned by Run. This can also be done in a while loop. Look at the example for StderrRead.
    Local $sOutput = StringReplace(StdoutRead($iPID), @CRLF & @CRLF, @CRLF)
    Local $sOutErr = StringReplace(StderrRead($iPID), @CRLF & @CRLF, @CRLF)
    Local $sReult = $sOutput <> "" ? $sOutput : $sOutErr
    Return $sReult
EndFunc

 

Link to comment
Share on other sites

  • Developers

I don't need to see your previously posted script without any GuiToolTip function! post something small where you have played with the GuiToolTip functions that isn't working as you want.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

These are the parameters from the help file, but nothing says  how to make a tooltip stay open for a longer time. I'm not very clever I need some example.

  • $hTool Handle to the ToolTip control (returned by _GUIToolTip_Create.)
    $hWnd Handle of the window that contains the tool, or 0
    $sText Text for the ToolTip control. See remark.
    $iID [optional] Identifier of the tool, or Window handle of the control the tool is to be assigned to
    $iLeft [optional] X coordinate of the upper left corner of the rectangle
    $iTop [optional] Y coordinate of the upper left corner of the rectangle
    $iRight [optional] X coordinate of the lower right corner of the rectangle
    $iBottom [optional] Y coordinate of the lower right corner of the rectangle
    $iFlags [optional] Flags that control the ToolTip display:
    $TTF_IDISHWND - Indicates that $iID is a window or control handle, instead of the ID of the tool
    $TTF_CENTERTIP - Centers the tooltip below the control specified by $iID
    $TTF_RTLREADING - Indicates that text will be displayed in the opposite direction of the parent window (see remarks)
    $TTF_SUBCLASS - Indicates that the control should subclass the tool's window
    $TTF_TRACK    - Positions the tooltip window next to the tool to which it corresponds
    $TTF_ABSOLUTE - Positions the window at the same coordinates provided by TTM_TRACKPOSITION. (see remarks)
    $TTF_TRANSPARENT- Causes the control to forward mouse messages to the parent window
    $TTF_PARSELINKS - Indicates that links in the control text should be displayed as links
    Default = BitOr($TTF_SUBCLASS, $TTF_IDISHWND)
    $iParam [optional] Application-defined value that is associated with the tool
Link to comment
Share on other sites

Of course not, that's not where you set the delay, you need to use _GUIToolTip_SetDelayTime to do that. Look at the examples in the help file.

Using the GUIToolTip UDF isn't as simple as a one liner tooltip entry, it takes researching what it does and how to get it to do what you want it to. A lot like programming in general.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

OK I get it now but the problem is that _GUIToolTip_SetDelayTime cant be open  more than 30 seconds, I want a popup that stays open for longer time ie until a user clicks elsewhere on the Gui, Any hints people

 

Thank you

Link to comment
Share on other sites

 Why do you need it for longer than 30 seconds, you can't possibly have a tooltip that is so long that it takes longer than that to read it.

A tooltip is designed to be used as an informational popup it's not a message box, it's meant for telling someone something, then getting out of the way.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

Hi people, I need to open additional Gui windows from my main Gui, i.e I have a main menu with some items like about, help etc. and  I want when a user clicks on them to open a window with a lot of text. Can you guide me!

Thank you!!

 

Edited by zoel
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...