﻿id	summary	reporter	owner	description	type	status	milestone	component	version	severity	resolution	keywords	cc
538	GUICtrlCreateGraphic - working on last GUI created	enaiman		"Hi,

I'm not sure if this is an intended behaviour or a bug. 
GUICtrlCreateGraphic since it doesn't use a window handle it creates the grapthic on the last GUI created; if that GUI was deleted GUICtrlCreateGraphic will fail.

Here is a sample script; it might not be the best example but it shows the above behaviour. Once the last GUI was deleted GUICtrlCreateGraphic will always return 0. 

Maybe a future release might consider using a window handle in GUICtrlCreateGraphic call?

Thank you 

{{{#include <GUIConstantsEx.au3>

GUICreate(""1"", 200, 200, 100)
$but2 = GUICtrlCreateButton(""Create Gr Success"", 20, 170, 160, 25)
GUISetState()
GUICreate (""2"", 200, 200, 310)
GUISetState()
$but = GUICtrlCreateButton(""Create Gr Fail"", 20, 170, 160, 25)
$gg = GUICreate (""3"", 200, 200, 520)
GUISetState()

Do
	$msg = GUIGetMsg()

	If $msg = $but Then
		GUIDelete($gg)
		
		$a = GUICtrlCreateGraphic(20, 50, 100, 100)
		GUICtrlSetBkColor(-1, 0xffffff)
		GUICtrlSetColor(-1, 0)

		GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0xff0000, 0xff0000)
		GUICtrlSetGraphic(-1, $GUI_GR_PIE, 50, 50, 40, 30, 270)

		GUICtrlSetState(-1, $GUI_SHOW)
		MsgBox(0, ""return"", ""Return code GUICtrlCreateGraphic ""&$a, 2)
	EndIf
	If $msg = $but2 Then
		$b = GUICtrlCreateGraphic(20, 50, 100, 100)
		GUICtrlSetBkColor(-1, 0xffffff)
		GUICtrlSetColor(-1, 0)

		GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0xff0000, 0xff0000)
		GUICtrlSetGraphic(-1, $GUI_GR_PIE, 50, 50, 40, 30, 270)

		GUICtrlSetState(-1, $GUI_SHOW)
		MsgBox(0, ""return"", ""Return code GUICtrlCreateGraphic ""&$b, 2)
	EndIf
Until $msg = $GUI_EVENT_CLOSE
}}}"	Bug	closed		AutoIt	3.2.12.0	None	No Bug		
