Имя пользователя:
Пароль:  
Помощь | Регистрация | Забыли пароль?  

Показать сообщение отдельно

Аватара для proxy

Старожил


Сообщения: 460
Благодарности: 152

Профиль | Отправить PM | Цитировать


Код: Выделить весь код
#region: - Include
    #include <GUIConstantsEx.au3>
    #Include <GuiEdit.au3>
    #include <WindowsConstants.au3>
#endregion

#region: - Option
    Opt('GUIOnEventMode',       1)
    Opt('MustDeclareVars',      1)
    Opt('TrayIconDebug',        1)
    Opt('TrayIconHide',         0)
#endregion

#region: - Global
    Global  $hWinMain, $Input_1, $Input_2
#endregion

#region: GUI
    $hWinMain = GUICreate('Test', 400, 400, -1, -1)
        GUISetOnEvent($GUI_EVENT_CLOSE,     '_Exit_pro')

    $Input_2 = GUICtrlCreateInput('Введите любой текст', 20, 70+40, 185, 21)

    $Input_1 = GUICtrlCreateInput('Введите любой текст', 20, 40, 185, 21)

#endregion

#region: - После создания всех GUI
    GUIRegisterMsg($WM_COMMAND, 'WM_COMMAND')
    GUISetState(@SW_SHOW, $hWinMain)
#endregion

#region: - Sleep, Exit
While 1
    Sleep(10)
WEnd

Func _Exit_pro()
    Exit
EndFunc
#endregion

Func WM_COMMAND($hWnd, $iMsg, $iwParam, $ilParam)
    #forceref $hWnd, $iMsg
    Local $hWndFrom, $iIDFrom, $iCode, $hWndEdit
    If Not IsHWnd($Input_1) Then $hWndEdit = GUICtrlGetHandle($Input_1)
    $hWndFrom = $ilParam
    $iIDFrom = _WinAPI_LoWord($iwParam)
    $iCode = _WinAPI_HiWord($iwParam)
    Switch $hWndFrom
        Case $Input_1, $hWndEdit
            Switch $iCode
                Case $EN_ALIGN_LTR_EC ; Sent when the user has changed the edit control direction to left-to-right
                    _DebugPrint("$EN_ALIGN_LTR_EC" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
                            "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
                            "-->Code:" & @TAB & $iCode)
                    ; no return value
                Case $EN_ALIGN_RTL_EC ; Sent when the user has changed the edit control direction to right-to-left
                    _DebugPrint("$EN_ALIGN_RTL_EC" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
                            "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
                            "-->Code:" & @TAB & $iCode)
                    ; no return value
                Case $EN_CHANGE ; Sent when the user has taken an action that may have altered text in an edit control
                    _DebugPrint("$EN_CHANGE" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
                            "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
                            "-->Code:" & @TAB & $iCode)
                    ; no return value
                Case $EN_ERRSPACE ; Sent when an edit control cannot allocate enough memory to meet a specific request
                    _DebugPrint("$EN_ERRSPACE" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
                            "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
                            "-->Code:" & @TAB & $iCode)
                    ; no return value
                Case $EN_HSCROLL ; Sent when the user clicks an edit control's horizontal scroll bar
                    _DebugPrint("$EN_HSCROLL" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
                            "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
                            "-->Code:" & @TAB & $iCode)
                    ; no return value
                Case $EN_KILLFOCUS ; Sent when an edit control loses the keyboard focus
                    _DebugPrint("$EN_KILLFOCUS" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
                            "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
                            "-->Code:" & @TAB & $iCode)
                    ; no return value
                Case $EN_MAXTEXT ; Sent when the current text insertion has exceeded the specified number of characters for the edit control
                    _DebugPrint("$EN_MAXTEXT" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
                            "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
                            "-->Code:" & @TAB & $iCode)
                    ; This message is also sent when an edit control does not have the $ES_AUTOHSCROLL style and the number of characters to be
                    ; inserted would exceed the width of the edit control.
                    ; This message is also sent when an edit control does not have the $ES_AUTOVSCROLL style and the total number of lines resulting
                    ; from a text insertion would exceed the height of the edit control

                    ; no return value
                Case $EN_SETFOCUS ; Sent when an edit control receives the keyboard focus
                    _DebugPrint("$EN_SETFOCUS" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
                            "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
                            "-->Code:" & @TAB & $iCode)
                    GUICtrlSetData($Input_1, '')
                    ; no return value
                Case $EN_UPDATE ; Sent when an edit control is about to redraw itself
                    _DebugPrint("$EN_UPDATE" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
                            "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
                            "-->Code:" & @TAB & $iCode)
                    ; no return value
                Case $EN_VSCROLL ; Sent when the user clicks an edit control's vertical scroll bar or when the user scrolls the mouse wheel over the edit control
                    _DebugPrint("$EN_VSCROLL" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
                            "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
                            "-->Code:" & @TAB & $iCode)
                    ; no return value
                Case Else
                    _DebugPrint("Else" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
                            "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
                            "-->Code:" & @TAB & $iCode)
            EndSwitch
    EndSwitch
    Return $GUI_RUNDEFMSG
EndFunc   ;==>WM_COMMAND
Func _DebugPrint($s_text, $line = @ScriptLineNumber)
    ConsoleWrite( _
            "!===========================================================" & @LF & _
            "+======================================================" & @LF & _
            "-->Line(" & StringFormat("%04d", $line) & "):" & @TAB & $s_text & @LF & _
            "+======================================================" & @LF)
EndFunc   ;==>_DebugPrint

-------
Мысли-читатель сломался, может подробней расскажите?
А где исходный код? Или мы стихи обсуждаем?! )) Настройки темы > Решено ?


Отправлено: 19:01, 05-04-2009 | #2