พอดีผมได้สร้างหน้าต่างรันโปรแกรมขึ้นมามันก็ใช้ได้นะครับ
แต่เมื่อมันหาไฟล์ที่จะให้รันไม่เจอ ผมก๊จะปิดหน้าต่างไม่ได้เลย
สคริปประมาณนี้ครับ
จะทำยังไงดีครับ อย่างอื่นโอเคแล้ว เหลือแค่จุดนี้จุดเดียวครับ ช่วยแนะนหน่อยครับ
อยากให้ปิดได้ถึงแม้ว่าจะหาไฟลที่รันไม่เจอก็ตาม
แต่เมื่อมันหาไฟล์ที่จะให้รันไม่เจอ ผมก๊จะปิดหน้าต่างไม่ได้เลย
สคริปประมาณนี้ครับ
- Code:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Setup", 314, 171, 343, 181)
$GroupBox1 = GUICtrlCreateGroup("", 8, 1, 297, 129)
$Label1 = GUICtrlCreateLabel("ชื่อ ", 96, 16, 122, 41)
GUICtrlSetFont(-1, 24, 400, 0, "MS Sans Serif")
$Label2 = GUICtrlCreateLabel("ทดสอบ", 48, 72, 252, 28)
GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
GUICtrlSetCursor (-1, 0)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button1 = GUICtrlCreateButton("&Install", 65, 139, 75, 25)
GUICtrlSetCursor (-1, 0)
$Button2 = GUICtrlCreateButton("&Cancel", 162, 139, 75, 25)
GUICtrlSetCursor (-1, 0)
$Label3 = GUICtrlCreateLabel("V.1", 288, 152, 21, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
Run("vlc-2.2.1-win64.exe")
Case $Button2
Exit
EndSwitch
WEnd
จะทำยังไงดีครับ อย่างอื่นโอเคแล้ว เหลือแค่จุดนี้จุดเดียวครับ ช่วยแนะนหน่อยครับ
อยากให้ปิดได้ถึงแม้ว่าจะหาไฟลที่รันไม่เจอก็ตาม