Jump to content

Recommended Posts

Posted (edited)

Hello guys,

i am not very good at autoit but i used it here and there to help me with small things.

I am now standing at an essential problem with GUIOnEventMode 1. I cant pick up clicks on the menuitems?

What am i doing wrong?

 

Thanks in advance

Francesco

ttttetstt.au3Fetching info...

Edited by sommahe
  • Moderators
Posted

sommahe,

Welcome to the AutoIt forums.

You are using:

GUISetOnEvent(-1, "_Close_main")

But for controls you need GUICtrlSetOnEvent.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

  Reveal hidden contents

 

Posted

Hello Thanks. That was an oversight on my part. The problem with the mainmenuclickevents not being reported / noticed still exists.

 

 

Posted
#include <GUIConstantsEx.au3>
#include <GUIConstants.au3>
#include <WindowsConstants.au3>

Opt("GUIOnEventMode", 1)
$Form1 = GUICreate("Testform", 521, 358, 320, 188)
GUISetOnEvent($GUI_EVENT_CLOSE, "_Close_main")
$Mainmenu = GUICtrlCreateMenu("Main")
$M_setwindowpos = GUICtrlCreateMenuItem("Set window Pos", $Mainmenu)
GUICtrlSetOnEvent(-1, "M_setwindowpos")
$M_close = GUICtrlCreateMenuItem("Quit", $Mainmenu)
GUIctrlSetOnEvent(-1, "_Close_main")
GUISetState(@SW_SHOW)
While 1
   Sleep(200)
WEnd

func M_setwindowpos()
MsgBox(4096, "Why am i not showing?", "test")
EndFunc

func _Close_main()
    MsgBox(4096, "Why am i not showing?", "test")
   Exit
 EndFunc

Thanks for the help i am being silly...

  • Developers
Posted
  On 2/28/2021 at 10:30 AM, sommahe said:

Thanks for the help i am being silly...

Expand  

Is there still an issue as this posted script seems to work fine for me?

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

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