Jump to content
Sign in to follow this  
HiNoTora

another exe in my GUI

Recommended Posts

HiNoTora

Is there a way to add another program to runn inside my gui windows?

In my script, theres emty area at right side, id like to but another exe in there.

can i do this?

#include <GUIConstantsEx.au3>
#include <EditConstants.au3>
#include <GUIEdit.au3>
#include <ScrollBarConstants.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Opt("GUICloseOnESC", 1)
Opt("GUIOnEventMode", 1)


Global $hGUI = GUICreate("Forex AutoTrade by HiNoTora", 650, 400, -1, -1, -1, $WS_EX_TOPMOST)

Global $hEdit = GUICtrlCreateEdit("", 0, 0, 350, 350, BitOR($ES_READONLY, $ES_AUTOVSCROLL))
GUICtrlSetBkColor($hEdit, 0xFFe737)
GUICtrlCreatePic('f:\Image files\Backgrounds\Untitled.jpg', 350, 0, 664, 438)


Global $hButton = GUICtrlCreateButton("Start", 0, 350, 175, 50)
GUICtrlSetOnEvent($hButton, "_StartProgram")
Global $hButton2 = GUICtrlCreateButton("Pause", 175, 350, 175, 50)
GUICtrlSetOnEvent($hButton2, "_PauseProgram")

GUISetOnEvent($GUI_EVENT_CLOSE, "Terminate")
GUISetState(@SW_SHOW, $hGUI)

Global $start = 0, $wait = 1

_WriteToEditBox("Console")

While 1
    If $start = 1 Then _MainProgram()
    Sleep(100)
wend

Func _StartProgram()
      _WriteToEditBox("Starting program")
    $wait = 1
    $start = 1
EndFunc   ;==>_StartProgram

Func _PauseProgram()
    _WriteToEditBox("Pausing program")
    $start = 0
EndFunc   ;==>_Pauserogram

Func _MainProgram()
   
    If $wait=1 Then _WriteToEditBox("Wait till positive position")
    $coord = PixelSearch(17, 753, 37, 765, 0x90F393); wait till positive position
    If Not @error Then
        $wait=1
         _WriteToEditBox("Closing position")
        MouseClick("left", 1265, 738, 1); closing position
        _WriteToEditBox("Waiting for sale mark")
        Sleep(3000)
        $coord = PixelSearch(214, 124, 249, 182, 0xFF6060); waiting for sale mark
        If Not @error Then
            MouseClick("left", 306, 148, 1); opening new position
            _WriteToEditBox("Opening new position")
        EndIf
    Else
        $wait=0
        Sleep(100)
    EndIf
EndFunc   ;==>_MainProgram

Func _WriteToEditBox($sText)
    $iEnd = StringLen(GUICtrlRead($hEdit))
    _GUICtrlEdit_SetSel($hEdit, $iEnd, $iEnd)
    _GUICtrlEdit_Scroll($hEdit, $SB_SCROLLCARET)
    If $iEnd = 0 Then
        GUICtrlSetData($hEdit, @HOUR & ":" & @MIN & ":" & @SEC & " :-: " & $sText, 1)
    Else
        GUICtrlSetData($hEdit, @CRLF & @HOUR & ":" & @MIN & ":" & @SEC & " :-: " & $sText, 1)
    EndIf
 EndFunc   ;==>_WriteToEditBox
 

Func Terminate()
    Exit
EndFunc   ;==>Terminate

Share this post


Link to post
Share on other sites
water

You mean you want to display the output of the second program inside your GUI?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
HiNoTora

You mean you want to display the output of the second program inside your GUI?

yes, metatrader4.exe

Share this post


Link to post
Share on other sites
water

I assume this program has its own GUI which you want to include in your GUI?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
HiNoTora

I assume this program has its own GUI which you want to include in your GUI?

yes,

one more thing, can u help out with console font, i need lighter font colour and bit higher text size

Share this post


Link to post
Share on other sites
water

A possible solution can be found >here.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
water

can u help out with console font, i need lighter font colour and bit higher text size

What exactly do you mean by "console font"? Can you post an example/screenshot?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
HiNoTora

A possible solution can be found >here.

 

What exactly do you mean by "console font"? Can you post an example/screenshot?

2549268.png?t=3

And that sample wsnt really for me, i want to make 2 programs into 1.my GUI and the another program.

Share this post


Link to post
Share on other sites
water

That's exactly what the example does. It creates a GUI, runs notepad and moves the notepad window to a location in the first GUI.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

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  

×