Jump to content

Send msg to message loop (while loop)

Recommended Posts

Hello I need send msg to controls ( to message loop - main while loop ) like this func do. I need to send msg to hided (no display on screen) gui too.

GUICtrlSendMsg ( controlID, msg , wParam, lParam )

I could make simply run functions but I has a lot of logic in while loop like this.

So need to fire fire example (on hided gui too) $s_offOn_sio

Case $s_offOn_sio
            If _Metro_CheckboxIsChecked($s_offOn_sio) Then
                If _checkDeclared(True,True) == False Then 
                     AdlibRegister("hsio", 1900)

        Case $s_offOn_spell
            If _Metro_CheckboxIsChecked($s_offOn_sp) Then
                If _checkDeclared(True,True) == False Then 
                    AdlibRegister("caster", 3500)

        Case $r_offOn_increase
            If _Metro_CheckboxIsChecked($r_offOn_increase) Then


Edited by Miliardsto
Link to post
Share on other sites

how to run this "Cases" in message loop . Normally its fired up when button or switch is clicked. I need to simulate click on these buttons or send some function to run it.

Like I wrote I wont like to simply call funcs becouse in while loop I got all the logic before function could be fired. I wont spend 3 days rewriting code

Case $r_offOn_increase
Case $s_offOn_sio
Link to post
Share on other sites

I would suggest you make a small runable script, go as far as you can.  Then ask us for help when you hit a wall.  Because, what you are showing us is totally incomprehensible.

Link to post
Share on other sites

xD take. how to run $idButton_Add without clicking button Add , when gui is hidden too?

#include <GUIConstantsEx.au3>
#include <MsgBoxConstants.au3>


Func Example()
    Local $sMESSAGE = "The following buttons have been clicked"

    GUICreate("My GUI list") ; will create a dialog box that when displayed is centered

    Local $idButton_Add = GUICtrlCreateButton("Add", 64, 32, 75, 25)
    Local $idButton_Clear = GUICtrlCreateButton("Clear", 64, 72, 75, 25)
    Local $idMylist = GUICtrlCreateList("buttons that have been clicked", 176, 32, 121, 97)
    GUICtrlSetLimit(-1, 200) ; to limit horizontal scrolling
    GUICtrlSetData(-1, $sMESSAGE)
    Local $idButton_Close = GUICtrlCreateButton("my closing button", 64, 160, 175, 25)


    ; Loop until the user exits.
    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
            Case $idButton_Add
                GUICtrlSetData($idMylist, "You clicked button No1|")
            Case $idButton_Clear
                GUICtrlSetData($idMylist, "")
            Case $idButton_Close
                MsgBox($MB_SYSTEMMODAL, "", "the closing button has been clicked", 2)
EndFunc   ;==>Example


Link to post
Share on other sites

HotKeySet could call a function that could send a command to click the button, but you can't click a button without some way of telling it to click the button. Otherwise, what would be the point of having the buttons?

BTW, if this is somehow related to game automation, you'd better read the forum rules.

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 post
Share on other sites

OK, we are getting somewhere.  Now put (in comment at least) where you want to trigger those button pushes,  This cannot be derived on some godly wish...

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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...