Jump to content

Window will not close when X button pressed

Recommended Posts


I used Koda to generate this form (this code is literally just what Koda generated, with no modifications)
Even without modifying this code at all, the window son't close if you press the X button.
It will minimize, but it won't close. Even if I press Alt-F4

Any ideas?

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=C:\Users\silverb-a.WILLIS\Box Sync\AutoITScipts\GuiDocExporter\Interface.kxf
$CaseReprinter = GUICreate("Ana-IT Case Reprinter", 501, 401, 249, 200)
GUISetOnEvent($GUI_EVENT_CLOSE, "CaseReprinterClose")
GUISetOnEvent($GUI_EVENT_MINIMIZE, "CaseReprinterMinimize")
GUISetOnEvent($GUI_EVENT_MAXIMIZE, "CaseReprinterMaximize")
GUISetOnEvent($GUI_EVENT_RESTORE, "CaseReprinterRestore")
$FilePicker = GUICtrlCreateGroup("", 8, 0, 393, 73)
GUICtrlSetBkColor($FilePicker, 0x000080)
$btnPickFile = GUICtrlCreateButton("Pick File", 16, 16, 65, 49)
GUICtrlSetFont($btnPickFile, 9, 800, 0, "MS Sans Serif")
GUICtrlSetBkColor($btnPickFile, 0xA6CAF0)
GUICtrlSetOnEvent($btnPickFile, "btnPickFileClick")
$txtFilePath = GUICtrlCreateInput("...", 88, 16, 305, 21)
GUICtrlSetFont($txtFilePath, 8, 800, 0, "MS Sans Serif")
GUICtrlSetOnEvent($txtFilePath, "txtFilePathChange")
$optCN = GUICtrlCreateRadio("Case Num", 88, 48, 81, 17)
GUICtrlSetState($optCN, $GUI_CHECKED)
GUICtrlSetFont($optCN, 8, 800, 0, "MS Sans Serif")
GUICtrlSetOnEvent($optCN, "optCNClick")
$optMRN = GUICtrlCreateRadio("MRN/Date", 184, 48, 89, 17)
GUICtrlSetFont($optMRN, 8, 800, 0, "MS Sans Serif")
GUICtrlSetOnEvent($optMRN, "optMRNClick")
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Logs = GUICtrlCreateEdit("", 8, 80, 481, 313)
GUICtrlSetData($Logs, "Logs")
GUICtrlSetOnEvent($Logs, "LogsChange")
$Run = GUICtrlCreateGroup("", 408, 0, 81, 73)
$btnRun = GUICtrlCreateButton("Run", 416, 16, 65, 49)
GUICtrlSetFont($btnRun, 9, 800, 0, "MS Sans Serif")
GUICtrlSetBkColor($btnRun, 0xA6CAF0)
GUICtrlSetState($btnRun, $GUI_DISABLE)
GUICtrlSetOnEvent($btnRun, "btnRunClick")
GUICtrlCreateGroup("", -99, -99, 1, 1)
#EndRegion ### END Koda GUI section ###

While 1

Func btnPickFileClick()

Func btnRunClick()

Func CaseReprinterClose()

Func CaseReprinterMaximize()

Func CaseReprinterMinimize()

Func CaseReprinterRestore()

Func LogsChange()

Func optCNClick()

Func optMRNClick()

Func txtFilePathChange()



Share this post

Link to post
Share on other sites

Why would it as you call a Func that doesn't do anything so simply returns and leaves the status as is.
You need to close the with GUIDelete()  in the called Func to close it.


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
Live for the present,
Dream of the future,
Learn from the past.

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


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.