帮忙看看代码:实现 记事本激活时我自定义窗口显示,记事本非激活时自定义窗口隐藏
帮忙看看代码错在哪里? 目的:实现 记事本激活时我自定义窗口显示,记事本非激活时自定义窗口隐藏我写的如下代码,但是不能实现功能:#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate(" ", @DesktopWidth / 3 -100, @DesktopHeight / 7 - 45, 14, 216,$DS_MODALFRAME);$WS_BORDER)
$Input1 = GUICtrlCreateInput("", 8, 8, 241, 24)
GUICtrlSetFont(-1, 12, 400, 0, "宋体")
$Button1 = GUICtrlCreateButton("确定", 256, 8, 81, 25)
GUISetState(@SW_HIDE)
#EndRegion ### END Koda GUI section ###
While 1>0
if WinWaitActive("") Then
GUISetState(@SW_SHOW)
$msg = 0
While $msg <> $GUI_EVENT_CLOSE
$msg = GUIGetMsg()
Select
;~ Case $msg =$Input1
;~ ;MsgBox(4096, "drag drop file", GUICtrlRead($Input1))
Case $msg =$Button1
;MsgBox(4096, "drag drop file", "ok")
If GUICtrlRead($Input1)<>"" Then
If StringIsDigit (GUICtrlRead($Input1))Then
MsgBox(4096, "drag drop file", "数字")
Else
MsgBox(4096, "drag drop file", "汉子")
EndIf
EndIf
EndSelect
If WinWaitActive("")=0 Then GUISetState(@SW_HIDE)
WEnd
If$msg <> $GUI_EVENT_CLOSE Then ExitLoop
Else
MsgBox(4096, "drag drop file", "4545")
GUISetState(@SW_HIDE)
EndIf
WEnd
; MsgBox(4096, "drag drop file", "ex")
Exit目前状况是首次激活能后显示自定义窗口,再次激活自定义窗口不能显示。 #include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Global $Form1,$Input1,$Button1
;MsgBox(0,"",@DesktopHeight / 7 - 45)
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate(" ", @DesktopWidth / 3 -100, @DesktopHeight / 7 - 45, 14, 216,$DS_MODALFRAME);$WS_BORDER)
$Input1 = GUICtrlCreateInput("", 8, 8, 241, 24)
GUICtrlSetFont(-1, 12, 400, 0, "宋体")
$Button1 = GUICtrlCreateButton("确定", 256, 8, 81, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1>0
if WinWaitActive("") Then
GUISetState(@SW_SHOW)
$msg = 0
While $msg <> $GUI_EVENT_CLOSE
$msg = GUIGetMsg()
Select
;~ Case $msg =$Input1
;~ ;MsgBox(4096, "drag drop file", GUICtrlRead($Input1))
Case $msg =$Button1
;MsgBox(4096, "drag drop file", "ok")
If GUICtrlRead($Input1)<>"" Then
If StringIsDigit (GUICtrlRead($Input1))Then
MsgBox(4096, "drag drop file", "数字")
Else
MsgBox(4096, "drag drop file", "汉子")
EndIf
EndIf
EndSelect
If WinWaitActive("")=0 Then GUISetState(@SW_HIDE)
WEnd
If$msg <> $GUI_EVENT_CLOSE Then ExitLoop
Else
MsgBox(4096, "drag drop file", "4545")
GUISetState(@SW_HIDE)
EndIf
WEnd
; MsgBox(4096, "drag drop file", "ex")
Exit
页:
[1]