Sign in to follow this  
Followers 0
yqf0215

How to capture the Return event of the Input Control

14 posts in this topic

#1 ·  Posted (edited)

I am used GUICtrlCreateInput method to create a input control named $inISBN , I want than when I pressed the RETURN key , then do something, but the WM_NOTIFY and WM_COMMAND is seemed not process then RETURN event.

the code as Below:

#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GuiStatusBar.au3>
#include <ListViewConstants.au3>
#include <TreeViewConstants.au3>
#include <WindowsConstants.au3>

Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=d:\ghostxp\isbn\marc\mainform.kxf
$mainForm = GUICreate("编目助理", 711, 423, 209, 169, BitOR($WS_MAXIMIZEBOX,$WS_MINIMIZEBOX,$WS_SIZEBOX,$WS_THICKFRAME,$WS_SYSMENU,$WS_CAPTION,$WS_OVERLAPPEDWINDOW,$WS_TILEDWINDOW,$WS_POPUP,$WS_POPUPWINDOW,$WS_GROUP,$WS_TABSTOP,$WS_BORDER,$WS_CLIPSIBLINGS))
GUISetOnEvent($GUI_EVENT_CLOSE, "mainFormClose")
$lvMarc = GUICtrlCreateListView("010a编目", 144, 0, 561, 337, BitOR($LVS_REPORT,$LVS_EDITLABELS,$LVS_SINGLESEL,$LVS_SHOWSELALWAYS,$WS_VSCROLL,$WS_BORDER))
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 70)
GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKRIGHT+$GUI_DOCKTOP+$GUI_DOCKBOTTOM+$GUI_DOCKWIDTH)
GUICtrlSetOnEvent(-1, "lvMarcClick")




;I am Create the input here
;
;
;
$inISBN = GUICtrlCreateInput("在此输入isbn...", 154, 344, 217, 21)

GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM+$GUI_DOCKHEIGHT)
$btSaveISBN = GUICtrlCreateButton("保存", 383, 344, 73, 25, 0)
GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
GUICtrlSetOnEvent(-1, "ClickBtSaveISBN")
$btDelISBN = GUICtrlCreateButton("删除", 494, 344, 65, 25, 0)
GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
GUICtrlSetOnEvent(-1, "ClickBtDelISBN")
$StatusBar = _GUICtrlStatusBar_Create($mainForm, -1, "", -1, $WS_EX_STATICEDGE)
Dim $StatusBar_PartsWidth[3] = [150, 300, 350]
_GUICtrlStatusBar_SetParts($StatusBar, $StatusBar_PartsWidth)
_GUICtrlStatusBar_SetText($StatusBar, "当前进度", 0)
_GUICtrlStatusBar_SetText($StatusBar, "ISBN总条数:", 1)
_GUICtrlStatusBar_SetText($StatusBar, "操作记录:", 2)
$tvGroupISBN = GUICtrlCreateTreeView(0, 0, 145, 337, BitOR($TVS_HASBUTTONS,$TVS_HASLINES,$TVS_LINESATROOT,$TVS_DISABLEDRAGDROP,$TVS_SHOWSELALWAYS,$WS_GROUP), $WS_EX_CLIENTEDGE)
GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKRIGHT+$GUI_DOCKTOP+$GUI_DOCKBOTTOM+$GUI_DOCKHEIGHT)
$cbMainName = GUICtrlCreateCombo("批次", 0, 344, 145, 25)
GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM+$GUI_DOCKHEIGHT)
$menuFile = GUICtrlCreateMenu("文件(&Z)")
$muOpenISBN = GUICtrlCreateMenuItem("打开ISBN文件(&O)", $menuFile)
GUICtrlSetOnEvent(-1, "muOpenISBNClick")
$MenuItem2 = GUICtrlCreateMenu("&ISBN")
$muImportISB = GUICtrlCreateMenuItem("导入待ISBN", $MenuItem2)
GUICtrlSetOnEvent(-1, "muImportISBClick")
$muShowISBN = GUICtrlCreateMenuItem("查看I&SBN", $MenuItem2)
GUICtrlSetOnEvent(-1, "muShowISBNClick")
$muDelSelectISBN = GUICtrlCreateMenuItem("删除选中的ISBN(&D)", $MenuItem2)
GUICtrlSetOnEvent(-1, "muDelSelectISBNClick")
$muSearchMarc = GUICtrlCreateMenuItem("检索MARC信息", $MenuItem2)
GUICtrlSetOnEvent(-1, "muSearchMarcClick")
$MenuItem1 = GUICtrlCreateMenu("&MARC")
$muShowMarc = GUICtrlCreateMenuItem("查看MARC信息", $MenuItem1)
GUICtrlSetOnEvent(-1, "muShowMarcClick")
$muDelSelectMarc = GUICtrlCreateMenuItem("删除选中的MARC信息", $MenuItem1)
GUICtrlSetOnEvent(-1, "muDelSelectMarcClick")
$muDelAllMarc = GUICtrlCreateMenuItem("删除所有的MARC信息", $MenuItem1)
GUICtrlSetOnEvent(-1, "muDelAllMarcClick")
$muExportMarc = GUICtrlCreateMenuItem("导出MARC数据", $MenuItem1)
GUICtrlSetOnEvent(-1, "muExportMarcClick")
$muHelp = GUICtrlCreateMenu("帮助(&Y)")
$lvMarccontext = GUICtrlCreateContextMenu($lvMarc)
$cmCheckByISBN = GUICtrlCreateMenuItem("检索选中的ISBN", $lvMarccontext)
GUICtrlSetOnEvent(-1, "cmCheckByISBNClick")
$cmDelSelectMarc = GUICtrlCreateMenuItem("删除选中的ISBN", $lvMarccontext)
GUICtrlSetOnEvent(-1, "cmDelSelectMarcClick")
$cmExportMarc = GUICtrlCreateMenuItem("导出MARC", $lvMarccontext)
GUICtrlSetOnEvent(-1, "cmExportMarcClick")
$tvGroupISBNcontext = GUICtrlCreateContextMenu($tvGroupISBN)
$cbShowByName = GUICtrlCreateMenuItem("查看", $tvGroupISBNcontext)
GUICtrlSetOnEvent(-1, "cbShowByNameClick")
$cbDelByName = GUICtrlCreateMenuItem("删除", $tvGroupISBNcontext)
GUICtrlSetState(-1, $GUI_DISABLE)
GUICtrlSetOnEvent(-1, "cbDelByNameClick")
$cbSearchByCheck = GUICtrlCreateMenuItem("未检索的ISBN检索MARC", $tvGroupISBNcontext)
GUICtrlSetOnEvent(-1, "cbSearchByCheckClick")
$cbExportByName = GUICtrlCreateMenuItem("导出", $tvGroupISBNcontext)
GUICtrlSetOnEvent(-1, "cbExportByNameClick")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###


    GUIRegisterMsg($WM_NOTIFY , "WM_MY_NOTIFY")


While 1
Sleep(100)
WEnd


Func WM_MY_NOTIFY($hWnd, $Msg, $wParam, $lParam)
    Local $hWndTreeView, $tNMHDR, $hWndFrom, $iCode,$hWndListView,$hWndInput
    $hWndTreeView = $tvGroupISBN
    $hListView = $lvMarc
    $hWndInput=$inISBN
    If Not IsHWnd($hWndTreeView) Then $hWndTreeView = GUICtrlGetHandle($tvGroupISBN)
    If Not IsHWnd($hWndListView) Then $hWndListView = GUICtrlGetHandle($lvMarc)
    If Not IsHWnd($hWndInput) Then $hWndInput = GUICtrlGetHandle($inISBN)
    $tNMHDR = DllStructCreate($tagNMHDR, $lParam)
    $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
    $iCode = DllStructGetData($tNMHDR, "Code")

    Switch $hWndFrom
        Case $hWndTreeView
            Switch $iCode
                Case $NM_RCLICK
                    MsgBox(0,"Right Click","I Right Clicked on the tree View")
                Case  $NM_DBLCLK
                    MsgBox(0,"Double Click","I Duoble Clicked on the tree View")
                EndSwitch
        Case $hWndListView
            Switch $iCode
            Case $NM_RCLICK
                MsgBox(0,"Right Click","I Right Clicked on the list View")          
            EndSwitch   

;capture the return event here, but it dosn't work
;
;
;
        Case $hWndInput
            Switch $iCode
            Case $NM_RETURN
          ;this dosn't work,some one help me
                MsgBox(0,"RETURN EVENT","I pressed Return in the $inISBN")
            EndSwitch
    EndSwitch

    Return $GUI_RUNDEFMSG
EndFunc;==>WM_NOTIFY

Func cbDelByNameClick()

EndFunc
Func cbExportByNameClick()

EndFunc
Func cbSearchByCheckClick()

EndFunc
Func cbShowByNameClick()

EndFunc
Func ClickBtDelISBN()

EndFunc
Func ClickBtSaveISBN()

EndFunc
Func cmCheckByISBNClick()

EndFunc
Func cmDelSelectMarcClick()

EndFunc
Func cmExportMarcClick()

EndFunc
Func lvMarcClick()

EndFunc
Func mainFormClose()

EndFunc
Func muDelAllMarcClick()

EndFunc
Func muDelSelectISBNClick()

EndFunc
Func muDelSelectMarcClick()

EndFunc
Func muExportMarcClick()

EndFunc
Func muImportISBClick()

EndFunc
Func muOpenISBNClick()

EndFunc
Func muSearchMarcClick()

EndFunc
Func muShowISBNClick()

EndFunc
Func muShowMarcClick()

EndFunc
Edited by yqf0215

Share this post


Link to post
Share on other sites



You need to use a control handle in a _WinAPI_SetWindowLong function.

Example:

#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GuiStatusBar.au3>
#include <ListViewConstants.au3>
#include <TreeViewConstants.au3>
#include <WindowsConstants.au3>
#include <Constants.au3>

Global Const $VK_RETURN = 0x0D ;Enter key

Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=d:\ghostxp\isbn\marc\mainform.kxf
$mainForm = GUICreate("????", 711, 423, 209, 169, BitOR($WS_MAXIMIZEBOX,$WS_MINIMIZEBOX,$WS_SIZEBOX,$WS_THICKFRAME,$WS_SYSMENU,$WS_CAPTION,$WS_OVERLAPPEDWINDOW,$WS_TILEDWINDOW,$WS_POPUP,$WS_POPUPWINDOW,$WS_GROUP,$WS_TABSTOP,$WS_BORDER,$WS_CLIPSIBLINGS))
;GUISetOnEvent($GUI_EVENT_CLOSE, "mainFormClose")
$lvMarc = GUICtrlCreateListView("010a??", 144, 0, 561, 337, BitOR($LVS_REPORT,$LVS_EDITLABELS,$LVS_SINGLESEL,$LVS_SHOWSELALWAYS,$WS_VSCROLL,$WS_BORDER))
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 70)
GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKRIGHT+$GUI_DOCKTOP+$GUI_DOCKBOTTOM+$GUI_DOCKWIDTH)
;GUICtrlSetOnEvent(-1, "lvMarcClick")

$inISBN = GUICtrlCreateInput("????isbn...", 154, 344, 217, 21)
GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM+$GUI_DOCKHEIGHT)
$hInput = GUICtrlGetHandle($inISBN)

$btSaveISBN = GUICtrlCreateButton("??", 383, 344, 73, 25, 0)
GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
;GUICtrlSetOnEvent(-1, "ClickBtSaveISBN")
$btDelISBN = GUICtrlCreateButton("??", 494, 344, 65, 25, 0)
GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
;GUICtrlSetOnEvent(-1, "ClickBtDelISBN")
$StatusBar = _GUICtrlStatusBar_Create($mainForm, -1, "", -1, $WS_EX_STATICEDGE)
Dim $StatusBar_PartsWidth[3] = [150, 300, 350]
_GUICtrlStatusBar_SetParts($StatusBar, $StatusBar_PartsWidth)
_GUICtrlStatusBar_SetText($StatusBar, "????", 0)
_GUICtrlStatusBar_SetText($StatusBar, "ISBN???:", 1)
_GUICtrlStatusBar_SetText($StatusBar, "????:", 2)
$tvGroupISBN = GUICtrlCreateTreeView(0, 0, 145, 337, BitOR($TVS_HASBUTTONS,$TVS_HASLINES,$TVS_LINESATROOT,$TVS_DISABLEDRAGDROP,$TVS_SHOWSELALWAYS,$WS_GROUP), $WS_EX_CLIENTEDGE)
GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKRIGHT+$GUI_DOCKTOP+$GUI_DOCKBOTTOM+$GUI_DOCKHEIGHT)
$cbMainName = GUICtrlCreateCombo("??", 0, 344, 145, 25)
GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM+$GUI_DOCKHEIGHT)
$menuFile = GUICtrlCreateMenu("??(&Z)")
$muOpenISBN = GUICtrlCreateMenuItem("??ISBN??(&O)", $menuFile)
;GUICtrlSetOnEvent(-1, "muOpenISBNClick")
$MenuItem2 = GUICtrlCreateMenu("&ISBN")
$muImportISB = GUICtrlCreateMenuItem("???ISBN", $MenuItem2)
;GUICtrlSetOnEvent(-1, "muImportISBClick")
$muShowISBN = GUICtrlCreateMenuItem("??I&SBN", $MenuItem2)
;GUICtrlSetOnEvent(-1, "muShowISBNClick")
$muDelSelectISBN = GUICtrlCreateMenuItem("?????ISBN(&D)", $MenuItem2)
;GUICtrlSetOnEvent(-1, "muDelSelectISBNClick")
$muSearchMarc = GUICtrlCreateMenuItem("??MARC??", $MenuItem2)
;GUICtrlSetOnEvent(-1, "muSearchMarcClick")
$MenuItem1 = GUICtrlCreateMenu("&MARC")
$muShowMarc = GUICtrlCreateMenuItem("??MARC??", $MenuItem1)
;GUICtrlSetOnEvent(-1, "muShowMarcClick")
$muDelSelectMarc = GUICtrlCreateMenuItem("?????MARC??", $MenuItem1)
;GUICtrlSetOnEvent(-1, "muDelSelectMarcClick")
$muDelAllMarc = GUICtrlCreateMenuItem("?????MARC??", $MenuItem1)
;GUICtrlSetOnEvent(-1, "muDelAllMarcClick")
$muExportMarc = GUICtrlCreateMenuItem("??MARC??", $MenuItem1)
;GUICtrlSetOnEvent(-1, "muExportMarcClick")
$muHelp = GUICtrlCreateMenu("??(&Y)")
$lvMarccontext = GUICtrlCreateContextMenu($lvMarc)
$cmCheckByISBN = GUICtrlCreateMenuItem("?????ISBN", $lvMarccontext)
;GUICtrlSetOnEvent(-1, "cmCheckByISBNClick")
$cmDelSelectMarc = GUICtrlCreateMenuItem("?????ISBN", $lvMarccontext)
;GUICtrlSetOnEvent(-1, "cmDelSelectMarcClick")
$cmExportMarc = GUICtrlCreateMenuItem("??MARC", $lvMarccontext)
;GUICtrlSetOnEvent(-1, "cmExportMarcClick")
$tvGroupISBNcontext = GUICtrlCreateContextMenu($tvGroupISBN)
$cbShowByName = GUICtrlCreateMenuItem("??", $tvGroupISBNcontext)
;GUICtrlSetOnEvent(-1, "cbShowByNameClick")
$cbDelByName = GUICtrlCreateMenuItem("??", $tvGroupISBNcontext)
GUICtrlSetState(-1, $GUI_DISABLE)
;GUICtrlSetOnEvent(-1, "cbDelByNameClick")
$cbSearchByCheck = GUICtrlCreateMenuItem("????ISBN??MARC", $tvGroupISBNcontext)
;GUICtrlSetOnEvent(-1, "cbSearchByCheckClick")
$cbExportByName = GUICtrlCreateMenuItem("??", $tvGroupISBNcontext)
;GUICtrlSetOnEvent(-1, "cbExportByNameClick")

GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

$wProcHandle = DllCallbackRegister("_WindowProc", "int", "hwnd;uint;wparam;lparam")
$wProcOld = _WinAPI_SetWindowLong($hInput, $GWL_WNDPROC, DllCallbackGetPtr($wProcHandle))

While 1
    Sleep(100)
WEnd

_WinAPI_SetWindowLong($inISBN, $GWL_WNDPROC, $wProcOld)
DllCallbackFree($wProcHandle)

Func _WindowProc($hWnd, $Msg, $wParam, $lParam)
    Switch $hWnd
        Case $hInput
            Switch $Msg
                Case $WM_GETDLGCODE
                    Switch $wParam
                        Case $VK_RETURN
                            ConsoleWrite("Enter key is pressed" & @LF)
                            Return 0
                    EndSwitch
            EndSwitch
    EndSwitch
   
    Return _WinAPI_CallWindowProc($wProcOld, $hWnd, $Msg, $wParam, $lParam)
EndFunc

:)

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Thank you very much ,rasim , this Works .

That seems confict with my other code, and I can't focus my mouse in the Input Control , But when I use your code along everything goes well.

Edited by yqf0215

Share this post


Link to post
Share on other sites

Thank you very much ,rasim , this Works .

That seems confict with my other code, and I can't focus my mouse in the Input Control , But when I use your code along everything goes well.

Can you make a small example script to duplicate the problem?

Share this post


Link to post
Share on other sites

Can you make a small example script to duplicate the problem?

#Include <GuiListView.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUITreeView.au3>
#include <ListViewConstants.au3>
#include <WindowsConstants.au3>
#include <GuiStatusBar.au3>
#include <TreeViewConstants.au3>
#include <GUIComboBox.au3>
#Include <GuiMenu.au3>


Global Const $VK_RETURN = 0x0D;Enter key
Global Const $finishedMarc="已检索的MARC"
Global Const $unfinishISBN="待检索ISBN"

Local $mainForm,$lvMarc,$inISBN,$btSaveISBN,$btDelISBN,$StatusBar,$tvGroupISBN,$tvGroupISBNcontext,$menuFile
Local $cbMainName ,$cbShowByName,$cbDelByName,$cbSearchByCheck,$cbExportByName,$cmCheckByISBN,$cmDelSelectMarc,$cmExportMarc
Local $subItemIndex
Local $FormReadISBN,$btOK,$btCancel,$inPathFile,$cbNames
;Local $GWL_WNDPROC,$hInput,$wProcOld,$i

Local $hInput,$wProcOld,$GWL_WNDPROC
Global $i
Opt("GUIOnEventMode", 1)
$i=0
 mainFrame()
 Func mainFrame()
#Region ### START Koda GUI section ### Form=d:\ghostxp\isbn\marc\mainform.kxf
$mainForm = GUICreate("编目助理", 711, 423, 209, 169, BitOR($WS_MAXIMIZEBOX,$WS_MINIMIZEBOX,$WS_SIZEBOX,$WS_THICKFRAME,$WS_SYSMENU,$WS_CAPTION,$WS_OVERLAPPEDWINDOW,$WS_TILEDWINDOW,$WS_POPUP,$WS_POPUPWINDOW,$WS_GROUP,$WS_TABSTOP,$WS_BORDER,$WS_CLIPSIBLINGS))
GUISetOnEvent($GUI_EVENT_CLOSE, "mainFormClose")
$lvMarc = GUICtrlCreateListView("TEST", 144, 0, 561, 337, BitOR($LVS_REPORT,$LVS_EDITLABELS,$LVS_SINGLESEL,$LVS_SHOWSELALWAYS,$WS_VSCROLL,$WS_BORDER))
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 70)
GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKRIGHT+$GUI_DOCKTOP+$GUI_DOCKBOTTOM+$GUI_DOCKWIDTH)
GUICtrlSetOnEvent(-1, "lvMarcClick")
$inISBN = GUICtrlCreateInput("在此输入isbn...", 154, 344, 217, 21)
GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM+$GUI_DOCKHEIGHT)
$btSaveISBN = GUICtrlCreateButton("保存", 383, 344, 73, 25, 0)
GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
GUICtrlSetOnEvent(-1, "ClickBtSaveISBN")
$btDelISBN = GUICtrlCreateButton("删除", 494, 344, 65, 25, 0)
GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
GUICtrlSetOnEvent(-1, "ClickBtDelISBN")
$StatusBar = _GUICtrlStatusBar_Create($mainForm, -1, "", -1, $WS_EX_STATICEDGE)
Dim $StatusBar_PartsWidth[3] = [150, 300, 350]
_GUICtrlStatusBar_SetParts($StatusBar, $StatusBar_PartsWidth)
_GUICtrlStatusBar_SetText($StatusBar, "当前进度", 0)
_GUICtrlStatusBar_SetText($StatusBar, "ISBN总条数:", 1)
_GUICtrlStatusBar_SetText($StatusBar, "操作记录:", 2)
$tvGroupISBN = GUICtrlCreateTreeView(0, 0, 145, 337, BitOR($TVS_HASBUTTONS,$TVS_HASLINES,$TVS_LINESATROOT,$TVS_DISABLEDRAGDROP,$TVS_SHOWSELALWAYS,$WS_GROUP), $WS_EX_CLIENTEDGE)
GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKRIGHT+$GUI_DOCKTOP+$GUI_DOCKBOTTOM+$GUI_DOCKHEIGHT)
$cbMainName = GUICtrlCreateCombo("批次", 0, 344, 145, 25)
GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM+$GUI_DOCKHEIGHT)
$menuFile = GUICtrlCreateMenu("文件(&Z)")
$muOpenISBN = GUICtrlCreateMenuItem("打开ISBN文件(&O)", $menuFile)
GUICtrlSetOnEvent(-1, "muOpenISBNClick")
$MenuItem2 = GUICtrlCreateMenu("&ISBN")
$muImportISB = GUICtrlCreateMenuItem("导入待ISBN", $MenuItem2)
GUICtrlSetOnEvent(-1, "muImportISBClick")
$muShowISBN = GUICtrlCreateMenuItem("查看I&SBN", $MenuItem2)
GUICtrlSetOnEvent(-1, "muShowISBNClick")
$muDelSelectISBN = GUICtrlCreateMenuItem("删除选中的ISBN(&D)", $MenuItem2)
GUICtrlSetOnEvent(-1, "muDelSelectISBNClick")
$muSearchMarc = GUICtrlCreateMenuItem("检索MARC信息", $MenuItem2)
GUICtrlSetOnEvent(-1, "muSearchMarcClick")
$MenuItem1 = GUICtrlCreateMenu("&MARC")
$muShowMarc = GUICtrlCreateMenuItem("查看MARC信息", $MenuItem1)
GUICtrlSetOnEvent(-1, "muShowMarcClick")
$muDelSelectMarc = GUICtrlCreateMenuItem("删除选中的MARC信息", $MenuItem1)
GUICtrlSetOnEvent(-1, "muDelSelectMarcClick")
$muDelAllMarc = GUICtrlCreateMenuItem("删除所有的MARC信息", $MenuItem1)
GUICtrlSetOnEvent(-1, "muDelAllMarcClick")
$muExportMarc = GUICtrlCreateMenuItem("导出MARC数据", $MenuItem1)
GUICtrlSetOnEvent(-1, "muExportMarcClick")
$muHelp = GUICtrlCreateMenu("帮助(&Y)")
$lvMarccontext = GUICtrlCreateContextMenu($lvMarc)
$cmCheckByISBN = GUICtrlCreateMenuItem("检索选中的ISBN", $lvMarccontext)
GUICtrlSetOnEvent(-1, "cmCheckByISBNClick")
$cmDelSelectMarc = GUICtrlCreateMenuItem("删除选中的ISBN", $lvMarccontext)
GUICtrlSetOnEvent(-1, "cmDelSelectMarcClick")
$cmExportMarc = GUICtrlCreateMenuItem("导出MARC", $lvMarccontext)
GUICtrlSetOnEvent(-1, "cmExportMarcClick")
$tvGroupISBNcontext = GUICtrlCreateContextMenu($tvGroupISBN)
$cbShowByName = GUICtrlCreateMenuItem("查看", $tvGroupISBNcontext)
GUICtrlSetOnEvent(-1, "cbShowByNameClick")
$cbDelByName = GUICtrlCreateMenuItem("删除", $tvGroupISBNcontext)
GUICtrlSetState(-1, $GUI_DISABLE)
GUICtrlSetOnEvent(-1, "cbDelByNameClick")
$cbSearchByCheck = GUICtrlCreateMenuItem("未检索的ISBN检索MARC", $tvGroupISBNcontext)
GUICtrlSetOnEvent(-1, "cbSearchByCheckClick")
$cbExportByName = GUICtrlCreateMenuItem("导出", $tvGroupISBNcontext)
GUICtrlSetOnEvent(-1, "cbExportByNameClick")
GUISetState(@SW_SHOW)






#EndRegion ### END Koda GUI section ###
$hInput = GUICtrlGetHandle($inISBN)
init()
$wProcHandle = DllCallbackRegister("_WindowProc", "int", "hwnd;uint;wparam;lparam")
$wProcOld = _WinAPI_SetWindowLong($hInput, $GWL_WNDPROC, DllCallbackGetPtr($wProcHandle))

While 1
    Sleep(100)
WEnd

_WinAPI_SetWindowLong($inISBN, $GWL_WNDPROC, $wProcOld)
DllCallbackFree($wProcHandle)
EndFunc

Func _WindowProc($hWnd, $Msg, $wParam, $lParam)
    _DebugPrint("HERE" & @error &" count:"&$i)
    $i +=1
    Switch $hWnd
        Case $hInput
            Switch $Msg
                Case $WM_GETDLGCODE
                    Switch $wParam
                        Case $VK_RETURN
                            ConsoleWrite("Enter key is pressed" & @LF)
                            Return 0
                    EndSwitch
            EndSwitch
    EndSwitch
   
    Return _WinAPI_CallWindowProc($wProcOld, $hWnd, $Msg, $wParam, $lParam)
EndFunc

Func init()
;Opt("GUIOnEventMode", 1)

    initGUI()
;注册快捷键:回车。保存输入的ISBN
;Dim $AccelKeys[2][2]=[["{Enter}", $btSaveISBN],["^n", $btDelISBN]]
;GUISetAccelerators($AccelKeys)
EndFunc

Func initGUI()
    GUISetState()
    GUIRegisterMsg($WM_NOTIFY , "WM_MY_NOTIFY")

    GUIRegisterMsg($WM_SIZE, "WM_SIZE")
    updateTVGroupISBN()
    updateComboBoxNames()
EndFunc

Func updateTVGroupISBN()
    _GUICtrlTreeView_BeginUpdate($tvGroupISBN)
    _GUICtrlTreeView_DeleteAll($tvGroupISBN)
;$allIsbn=_GUICtrlTreeView_Add($tvGroupISBN,0,"待检索ISBN")
    $allIsbn=GUICtrlCreateTreeViewItem($unfinishISBN,$tvGroupISBN)
    GUICtrlSetColor(-1, 0x0000C0)


    _GUICtrlTreeView_EndUpdate($tvGroupISBN)
EndFunc

Func updateComboBoxNames()

;_ArrayDisplay($names)
    _GUICtrlComboBox_DeleteString($cbMainName,0)
    _GUICtrlComboBox_SetEditText($cbMainName,@YEAR&@mon&@MDAY&@HOUR)
    
        _GUICtrlComboBox_EndUpdate($cbMainName)
    
EndFunc
Func mainFormClose()
    If $SQLite_RUNING==True Then
        _shutdownSQLite()
    EndIf
    _DebugPrint("HERE" & @error)
    If @GUI_WINHANDLE == $mainForm Then
        _DebugPrint("HERE" & @error)
    ;MsgBox(0, "GUI 事件", "您选择了关闭主窗口!...")
        Exit
        
    EndIf
EndFunc

Func WM_MY_NOTIFY($hWnd, $Msg, $wParam, $lParam)

    Local $hWndTreeView, $tNMHDR, $hWndFrom, $iCode,$hWndListView
    $hWndTreeView = $tvGroupISBN
    $hListView = $lvMarc
    If Not IsHWnd($hWndTreeView) Then $hWndTreeView = GUICtrlGetHandle($tvGroupISBN)
    If Not IsHWnd($hWndListView) Then $hWndListView = GUICtrlGetHandle($lvMarc)
    $tNMHDR = DllStructCreate($tagNMHDR, $lParam)
    $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
    $iCode = DllStructGetData($tNMHDR, "Code")





    Switch $hWndFrom
        Case $hWndTreeView
            Switch $iCode
                Case $NM_RCLICK
                   ;Local $tPOINT = _WinAPI_GetMousePos(True, $hWndFrom)                    
                    Local $tPOINT = _WinAPI_GetMousePos(True, $hWndTreeView)                    
                    Local $iX = DllStructGetData($tPOINT, "X")
                    Local $iY = DllStructGetData($tPOINT, "Y")
                   
                    Local $tTVHITTESTINFO  = _GUICtrlTreeView_HitTestEx($hWndFrom, $iX, $iY)
                    Local $iFlags = DllStructGetData($tTVHITTESTINFO, "Flags")
                   
                    If BitAND($iFlags, $TVHT_ONITEM) Or BitAND($iFlags, $TVHT_ONITEMLABEL) Then
                        $hItem = DllStructGetData($tTVHITTESTINFO, "Item")
                        _GUICtrlTreeView_SelectItem($hWndFrom, $hItem, $TVGN_CARET)                     
                    EndIf
                ;setTvGroupISBNContextStateFalse()
                Case  $NM_DBLCLK 
                ;setTvGroupISBNContextStateFalse()
                ;cbShowByNameClick()

                EndSwitch
        Case $hWndListView
            Switch $iCode
            Case $NM_RCLICK
                Local $tInfo = DllStructCreate($tagNMLISTVIEW, $lParam)
                Local $iItem = DllStructGetData($tInfo, "Item")
                Local $aInfo = DllStructCreate($tagNMITEMACTIVATE, $lParam)
                Local $subItem=DllStructGetData($aInfo, "SubItem") 
                If $iItem == -1 Then
                    cmMenuItemState($GUI_DISABLE,$GUI_DISABLE,$GUI_DISABLE)
                    $subItemIndex = -1
                Else
                    $subItemIndex=$subItem                  
                    $ListViewColumns= _GUICtrlListView_GetColumn($hWndListView,$subItemIndex)
                    If $ListViewColumns[5]== "ISBN" Then                        
                        $select=_GUICtrlTreeView_GetSelection($tvGroupISBN)
                        $parent=_GUICtrlTreeView_GetParentHandle($tvGroupISBN,$select)
                        $t=_GUICtrlListView_GetItem($lvMarc,_GUICtrlListView_GetSelectionMark($lvMarc),$subItemIndex)
                        $isbn=$t[3]
                        Switch _GUICtrlTreeView_GetText($tvGroupISBN,$parent)
                        Case $finishedMarc
                            cmMenuItemState($GUI_ENABLE,$GUI_DISABLE,$GUI_ENABLE)
                        Case $unfinishISBN                      
                            cmMenuItemState($GUI_ENABLE,$GUI_ENABLE,$GUI_ENABLE)                            
                        EndSwitch                           
                    Else
                        cmMenuItemState($GUI_DISABLE,$GUI_DISABLE,$GUI_ENABLE)
                    EndIf
                EndIf               
            EndSwitch   
        EndSwitch

;~   Local 
    Return $GUI_RUNDEFMSG
EndFunc  ;==>WM_NOTIFY






Func cbShowByNameClick()
    $select=_GUICtrlTreeView_GetSelection($tvGroupISBN)
    $parent=_GUICtrlTreeView_GetParentHandle($tvGroupISBN,$select)
    Switch _GUICtrlTreeView_GetText($tvGroupISBN,$parent)
    Case $finishedMarc
        alterLVColAndWidth($lvMarcColumns,$lvMarcColumnWidth)
        $result=queryMarcByName(_GUICtrlTreeView_GetText($tvGroupISBN,$select))
        _GUICtrlListView_AddArray($lvMarc,$result)
    Case $unfinishISBN
        alterLVColAndWidth($lvMarcISBNColumns,$lvMarcISBNColumnWidth)
        $result=queryISBNAllByName(_GUICtrlTreeView_GetText($tvGroupISBN,$select))
        _GUICtrlListView_AddArray($lvMarc,$result)
    EndSwitch   
    _GUICtrlTreeView_Expand($tvGroupISBN,$select)
EndFunc

Func cbDelByNameClick()
    $select=_GUICtrlTreeView_GetSelection($tvGroupISBN)
    $parent=_GUICtrlTreeView_GetParentHandle($tvGroupISBN,$select)
    Switch _GUICtrlTreeView_GetText($tvGroupISBN,$parent)
    Case $finishedMarc
        alterLVColAndWidth($lvMarcColumns,$lvMarcColumnWidth)
        $result=delMarcByName(_GUICtrlTreeView_GetText($tvGroupISBN,$select))
    Case $unfinishISBN
        alterLVColAndWidth($lvMarcISBNColumns,$lvMarcISBNColumnWidth)
        $result=delISBNAllByName(_GUICtrlTreeView_GetText($tvGroupISBN,$select))
    EndSwitch   
    updateTVGroupISBN()
EndFunc
;根据未搜到MARC信息的ISBN号,检索MARC信息
;未完成
Func cbSearchByCheckClick()
    $select=_GUICtrlTreeView_GetSelection($tvGroupISBN)
    $parent=_GUICtrlTreeView_GetParentHandle($tvGroupISBN,$select)
    alterLVColAndWidth($lvMarcISBNColumns,$lvMarcISBNColumnWidth)
    $result=queryISBNAllByName(_GUICtrlTreeView_GetText($tvGroupISBN,$select),0)
    _GUICtrlListView_AddArray($lvMarc,$result)
EndFunc
;导出选中的批次到EXCEL文件
Func cbExportByNameClick()
    cbShowByNameClick()
    exportExcel()
EndFunc


;调整lvMarc的栏标题
Func alterLVColumn(ByRef const $columns)
    _GUICtrlListView_DeleteAllItems(GUICtrlGetHandle($lvMarc))
    
    $count=_GUICtrlListView_GetColumnCount($lvMarc)
    While $count>0
        _GUICtrlListView_DeleteColumn($lvMarc,$count-1)
    ;MsgBox(0,"delete all","删除所有item")
        $count -=1
    WEnd
    
    If IsArray($columns) Then
    ;$j=0
        $i=UBound($columns)-1
        For $j=0 To $i 
            _GUICtrlListView_AddColumn($lvMarc,$columns[$j])
        ;MsgBox(0,"delete all","删除所有item")
        Next
    Else
        _GUICtrlListView_AddColumn($lvMarc,$columns)
    EndIf
    
EndFunc
Func alterLVColAndWidth(ByRef const $columns,ByRef Const $colWidth)
    _GUICtrlListView_DeleteAllItems(GUICtrlGetHandle($lvMarc))
    
    $count=_GUICtrlListView_GetColumnCount($lvMarc)
    While $count>0
        _GUICtrlListView_DeleteColumn($lvMarc,$count-1)
    ;MsgBox(0,"delete all","删除所有item")
        $count -=1
    WEnd
    
    If IsArray($columns) Then
    ;$j=0
        $i=UBound($columns)-1
        For $j=0 To $i 
            _GUICtrlListView_AddColumn($lvMarc,$columns[$j],$colWidth[$j])
        ;MsgBox(0,"delete all","删除所有item")
        Next
    Else
        _GUICtrlListView_AddColumn($lvMarc,$columns,200)
    EndIf
    
EndFunc

;设置$tvGroupISBN的右键弹出菜单状态
Func setTvGroupISBNContextState($view,$del,$search, $export)
    GUICtrlSetState($cbShowByName,$view)
    GUICtrlSetState($cbDelByName,$del)
    GUICtrlSetState($cbExportByName,$export)
    GUICtrlSetState($cbSearchByCheck,$search)
EndFunc

;如果选择的根菜单,设置菜单状态不可选
Func setTvGroupISBNContextStateFalse()
    $select=_GUICtrlTreeView_GetSelection($tvGroupISBN)
    $parent=_GUICtrlTreeView_GetParentHandle($tvGroupISBN,$select)  
    If $parent=="0x00000000" Or $select=="0x00000000" Then
        setTvGroupISBNContextState($GUI_DISABLE,$GUI_DISABLE,$GUI_DISABLE,$GUI_DISABLE)
    Else
        Switch _GUICtrlTreeView_GetText($tvGroupISBN,$parent)
        Case $finishedMarc
            setTvGroupISBNContextState($GUI_ENABLE,$GUI_ENABLE,$GUI_DISABLE,$GUI_ENABLE)            
        Case $unfinishISBN
            setTvGroupISBNContextState($GUI_ENABLE,$GUI_ENABLE,$GUI_ENABLE,$GUI_ENABLE)         
        EndSwitch       
    EndIf       
EndFunc

;$lvMarc的右键菜单
Func cmCheckByISBNClick()
    $r=_GUICtrlListView_GetSelectionMark($lvMarc)
    $c=$subItemIndex
    $columnTitle=_GUICtrlListView_GetColumn($lvMarc,$c)
    _debugPrint("Column:"&$c&" Row:"&$r&" title:"&$columnTitle[5])
    search(_GUICtrlListView_GetItemText($lvMarc,$r,$c))
EndFunc
Func cmDelSelectMarcClick()
    $isbns=_GUICtrlListView_GetItem($lvMarc,_GUICtrlListView_GetSelectionMark($lvMarc),$subItemIndex)
    $isbn=$isbns[3]
    delISBNAllByISBN($isbn,_GUICtrlTreeView_GetText($tvGroupISBN,_GUICtrlTreeView_GetSelection($tvGroupISBN)))
    _debugPrint($isbn)
    cbShowByNameClick()
EndFunc
Func cmExportMarcClick()
    exportExcel()
EndFunc
;$lvMarc邮件菜单工具类
Func cmMenuItemState($search,$del,$export)
    GUICtrlSetState($cmCheckByISBN,$search)
    GUICtrlSetState($cmDelSelectMarc,$del)
    GUICtrlSetState($cmExportMarc,$export)
EndFunc

Func saveISBN()
;If @GUI_CtrlId = $inISBN Then
    ;MsgBox(0, "HotKeySet 事件",GUICtrlRead($btSaveISBN))
    ;Exit
        
;EndIf
EndFunc

Func ClickBtDelISBN()

EndFunc
Func ClickBtSaveISBN()
    If @GUI_CtrlId==$btSaveISBN Then
    MsgBox(0, "HotKeySet 事件",GUICtrlRead($inISBN))
    EndIf
EndFunc

;设置按钮的状态
Func setButtonState( $boolSave,$boolDel)
        GUICtrlSetState($btSaveISBN, $boolSave)
        GUICtrlSetState($btDelISBN, $boolDel)
    ;ConsoleWrite("button"&$boolSave&"b2"&$boolDel)
EndFunc

;~;选中marc记录
Func lvMarcClick()
    _debugPrint("双击")
EndFunc



Func muDelAllMarcClick()

EndFunc
Func muDelSelectISBNClick()

EndFunc
Func muDelSelectMarcClick()

EndFunc
Func muExportMarcClick()

EndFunc
Func muImportISBClick()
    
EndFunc
Func muOpenISBNClick()
    openISBNFile()
EndFunc
Func muSearchMarcClick()

EndFunc
Func muShowISBNClick()

EndFunc
Func muShowMarcClick()

EndFunc

; Resize the status bar when GUI size changes
Func WM_SIZE($hWnd, $iMsg, $iwParam, $ilParam)
    _GUICtrlStatusBar_Resize ($StatusBar)
    Return $GUI_RUNDEFMSG
EndFunc  ;==>WM_SIZE
;=============>这里为检索MARC的主窗口的结尾

Func _DebugPrint($s_text, $line = @ScriptLineNumber)
    ConsoleWrite( _
            "!===========================================================" & @LF & _
            "+======================================================" & @LF & _
            "-->Line(" & StringFormat("%04d", $line) & "):" & @TAB & $s_text & @LF & _
            "+======================================================" & @LF)
EndFunc  ;==>_DebugPrint

Share this post


Link to post
Share on other sites

yqf0215

It's a small example? :)

Share this post


Link to post
Share on other sites

yqf0215

It's a small example? :)

:)

When I use your sample , everything goes well ,but when I copy that into my programe , It doen't work.

I'm feeling sorry that I takes truble to you , And thanks for your help.

I'm to try other way.

Share this post


Link to post
Share on other sites

:)

When I use your sample , everything goes well ,but when I copy that into my programe , It doen't work.

I'm feeling sorry that I takes truble to you , And thanks for your help.

I'm to try other way.

But your example does not work.

CODE

>Running AU3Check (1.54.13.0) from:C:\Program Files\AutoIt3

C:\AutoIt v3 Script (2).au3(172,22) : WARNING: $SQLite_RUNING: possibly used before declaration.

If $SQLite_RUNING==

~~~~~~~~~~~~~~~~~~~~~^

C:\AutoIt v3 Script (2).au3(266,42) : WARNING: $lvMarcColumns: possibly used before declaration.

alterLVColAndWidth($lvMarcColumns,

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\AutoIt v3 Script (2).au3(266,61) : WARNING: $lvMarcColumnWidth: possibly used before declaration.

alterLVColAndWidth($lvMarcColumns,$lvMarcColumnWidth)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\AutoIt v3 Script (2).au3(270,46) : WARNING: $lvMarcISBNColumns: possibly used before declaration.

alterLVColAndWidth($lvMarcISBNColumns,

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\AutoIt v3 Script (2).au3(270,69) : WARNING: $lvMarcISBNColumnWidth: possibly used before declaration.

alterLVColAndWidth($lvMarcISBNColumns,$lvMarcISBNColumnWidth)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\AutoIt v3 Script (2).au3(172,22) : ERROR: $SQLite_RUNING: undeclared global variable.

If $SQLite_RUNING==

~~~~~~~~~~~~~~~~~~~~~^

C:\AutoIt v3 Script (2).au3(173,25) : ERROR: _shutdownSQLite(): undefined function.

_shutdownSQLite()

~~~~~~~~~~~~~~~~~~~~~~~~^

C:\AutoIt v3 Script (2).au3(267,79) : ERROR: queryMarcByName(): undefined function.

$result=queryMarcByName(_GUICtrlTreeView_GetText($tvGroupISBN,$select))

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\AutoIt v3 Script (2).au3(271,82) : ERROR: queryISBNAllByName(): undefined function.

$result=queryISBNAllByName(_GUICtrlTreeView_GetText($tvGroupISBN,$select))

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\AutoIt v3 Script (2).au3(283,77) : ERROR: delMarcByName(): undefined function.

$result=delMarcByName(_GUICtrlTreeView_GetText($tvGroupISBN,$select))

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\AutoIt v3 Script (2).au3(286,80) : ERROR: delISBNAllByName(): undefined function.

$result=delISBNAllByName(_GUICtrlTreeView_GetText($tvGroupISBN,$select))

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\AutoIt v3 Script (2).au3(302,17) : ERROR: exportExcel(): undefined function.

exportExcel()

~~~~~~~~~~~~~~~~^

C:\AutoIt v3 Script (2).au3(382,55) : ERROR: search(): undefined function.

search(_GUICtrlListView_GetItemText($lvMarc,$r,$c))

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\AutoIt v3 Script (2).au3(387,110) : ERROR: delISBNAllByISBN(): undefined function.

delISBNAllByISBN($isbn,_GUICtrlTreeView_GetText($tvGroupISBN,_GUICtrlTreeView_GetSelection($tvGroupISBN)))

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~^

C:\AutoIt v3 Script (2).au3(448,18) : ERROR: openISBNFile(): undefined function.

openISBNFile()

~~~~~~~~~~~~~~~~~^

C:\AutoIt v3 Script (2).au3 - 10 error(s), 5 warning(s)

Post a working example.

Share this post


Link to post
Share on other sites

I'm sorry to post the code with error, I'm try to resolve the problem by other way, Writing another programe instand of using _isPressed() in the main func.

Thanks your help!

Share this post


Link to post
Share on other sites

But your example does not work.

CODE

>Running AU3Check (1.54.13.0) from:C:\Program Files\AutoIt3

C:\AutoIt v3 Script (2).au3(172,22) : WARNING: $SQLite_RUNING: possibly used before declaration.

If $SQLite_RUNING==

~~~~~~~~~~~~~~~~~~~~~^

C:\AutoIt v3 Script (2).au3(266,42) : WARNING: $lvMarcColumns: possibly used before declaration.

alterLVColAndWidth($lvMarcColumns,

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\AutoIt v3 Script (2).au3(266,61) : WARNING: $lvMarcColumnWidth: possibly used before declaration.

alterLVColAndWidth($lvMarcColumns,$lvMarcColumnWidth)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\AutoIt v3 Script (2).au3(270,46) : WARNING: $lvMarcISBNColumns: possibly used before declaration.

alterLVColAndWidth($lvMarcISBNColumns,

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\AutoIt v3 Script (2).au3(270,69) : WARNING: $lvMarcISBNColumnWidth: possibly used before declaration.

alterLVColAndWidth($lvMarcISBNColumns,$lvMarcISBNColumnWidth)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\AutoIt v3 Script (2).au3(172,22) : ERROR: $SQLite_RUNING: undeclared global variable.

If $SQLite_RUNING==

~~~~~~~~~~~~~~~~~~~~~^

C:\AutoIt v3 Script (2).au3(173,25) : ERROR: _shutdownSQLite(): undefined function.

_shutdownSQLite()

~~~~~~~~~~~~~~~~~~~~~~~~^

C:\AutoIt v3 Script (2).au3(267,79) : ERROR: queryMarcByName(): undefined function.

$result=queryMarcByName(_GUICtrlTreeView_GetText($tvGroupISBN,$select))

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\AutoIt v3 Script (2).au3(271,82) : ERROR: queryISBNAllByName(): undefined function.

$result=queryISBNAllByName(_GUICtrlTreeView_GetText($tvGroupISBN,$select))

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\AutoIt v3 Script (2).au3(283,77) : ERROR: delMarcByName(): undefined function.

$result=delMarcByName(_GUICtrlTreeView_GetText($tvGroupISBN,$select))

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\AutoIt v3 Script (2).au3(286,80) : ERROR: delISBNAllByName(): undefined function.

$result=delISBNAllByName(_GUICtrlTreeView_GetText($tvGroupISBN,$select))

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\AutoIt v3 Script (2).au3(302,17) : ERROR: exportExcel(): undefined function.

exportExcel()

~~~~~~~~~~~~~~~~^

C:\AutoIt v3 Script (2).au3(382,55) : ERROR: search(): undefined function.

search(_GUICtrlListView_GetItemText($lvMarc,$r,$c))

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\AutoIt v3 Script (2).au3(387,110) : ERROR: delISBNAllByISBN(): undefined function.

delISBNAllByISBN($isbn,_GUICtrlTreeView_GetText($tvGroupISBN,_GUICtrlTreeView_GetSelection($tvGroupISBN)))

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~^

C:\AutoIt v3 Script (2).au3(448,18) : ERROR: openISBNFile(): undefined function.

openISBNFile()

~~~~~~~~~~~~~~~~~^

C:\AutoIt v3 Script (2).au3 - 10 error(s), 5 warning(s)

Post a working example.

rasim, hello:

Now I'm find out why occue the error, the Scite print error reports:

Variable used without being declared.:

$wProcOld = _WinAPI_SetWindowLong($hInput, $GWL_WNDPROC, DllCallbackGetPtr($wProcHandle))

$wProcOld = _WinAPI_SetWindowLong($hInput, ^ ERROR

And I'm alreay include the #include <WindowsConstants.au3>, and when I declare the $GWL_WNDPROC as:

Local $GWL_WNDPROC

then the input can't get the focus, May you help ME?

Share this post


Link to post
Share on other sites

I find that Global Const $GWL_WNDPROC = 0xFFFFFFFC,

Now EveryThing goes well.

Thanks

Share this post


Link to post
Share on other sites

I find that Global Const $GWL_WNDPROC = 0xFFFFFFFC,

Now EveryThing goes well.

Thanks

_WinAPI_SetWindowLong

Remarks

Needs Constants.au3 for pre-defined constants

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
Sign in to follow this  
Followers 0