jbrady21 Posted January 7, 2010 Share Posted January 7, 2010 I have run into an issue when using the WM_NOTIFY function for editing the text in a listview. The problem is not on my machine, but on a coworkers box. When he tries to run the AU3 file on his box, he gets an error message saying that there are undefined variables ($LVN_BEGINLABELEDIT/$LVN_BEGINLABELEDITW)... D:\Documents and Settings\guidpaug\Desktop\New Folder (2)\Daily E-mail.au3 (1244) : ==> Variable used without being declared.: Case $LVN_BEGINLABELEDIT, $LVN_BEGINLABELEDITW All of the #includes are in the code, so that is not the issue. The only difference that I can see is that he is running Scite version 1.79 and I am running Scite version 1.78, but ??. Has anyone seen this before or know what is going on with this? Thanks, James List of the includes within the program: #include <StructureConstants.au3> #include <IE.au3> #include <GuiComboBox.au3> #include <ButtonConstants.au3> #include <ComboConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <ListViewConstants.au3> #include <String.au3> #include <GuiListView.au3> #include <Misc.au3> #include <GUIConstants.au3> #include <GuiListBox.au3> #include <GuiMenu.au3> #include <WinAPI.au3> #include <TipUpdate.au3> #include <Date.au3> #include <Array.au3> #include <WinAPI.au3> #include <File.au3> WM_NOTIFY code section: expandcollapse popupFunc WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam) #forceref $hWnd, $iMsg, $iwParam Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $Option $tNMHDR = DllStructCreate($tagNMHDR, $ilParam) $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom")) $iIDFrom = DllStructGetData($tNMHDR, "IDFrom") $iCode = DllStructGetData($tNMHDR, "Code") Switch $hWndFrom Case GUICtrlGetHandle($ListEmail), GUICtrlGetHandle($ListTo), GUICtrlGetHandle($ListCC) Switch $iCode Case $LVN_BEGINLABELEDIT, $LVN_BEGINLABELEDITW ; Start of label editing for an item ;Return False ; Allow the user to edit the label Return True ; Prevent the user from editing the label Case $LVN_COLUMNCLICK ; A column was clicked ; No return value Case $LVN_DELETEITEM ; An item is about to be deleted ; No return value Case $LVN_ENDLABELEDIT, $LVN_ENDLABELEDITW ; The end of label editing for an item $ListViewItem = _GUICtrlListView_SubItemHitTest($hWndFrom) $tInfo = DllStructCreate($tagNMLVDISPINFO, $ilParam) Local $tBuffer = DllStructCreate("char Text[" & DllStructGetData($tInfo, "TextMax") & "]", DllStructGetData($tInfo, "Text")) If StringLen(DllStructGetData($tBuffer, "Text")) And DllStructGetData($tBuffer, "Text") <> "0" Then If DuplicateAddress(DllStructGetData($tBuffer, "Text")) = 1 Then ReplaceAddressInAll(_GUICtrlListView_GetItemText($hWndFrom, DllStructGetData($tInfo, "Item")), DllStructGetData($tBuffer, "Text")) UpdateSetup() Return True Else MsgBox(0, "Duplicate E-mail Address", "This name already exists in the list" & @CRLF & "(Check E-mail Address, To and CC)") Return False EndIf EndIf ; If Text is not empty, return True to set the item's label to the edited text, return false to reject it ; If Text is empty the return value is ignored Case $NM_CLICK ; Sent by a list-view control when the user clicks an item with the left mouse button ; No return value Case $NM_DBLCLK ; Sent by a list-view control when the user double-clicks an item with the left mouse button ; No return value Case $NM_KILLFOCUS ; The control has lost the input focus ; No return value Case $NM_RCLICK ; Sent by a list-view control when the user clicks an item with the right mouse button ;Return 1 ; not to allow the default processing $ListViewItem = _GUICtrlListView_SubItemHitTest($hWndFrom) If $ListViewItem[0] <> -1 Then $Option = _GUICtrlMenu_TrackPopupMenu(GUICtrlGetHandle($EmailContext), $FrmSetup, -1, -1, 1, 1, 2, 0) If $Option = $EmailContextRename Then _GUICtrlListView_EditLabel($hWndFrom, $ListViewItem[0]) ElseIf $Option = $EmailContextDelete And $hWndFrom = GUICtrlGetHandle($ListEmail) Then RemoveAddress(_GUICtrlListView_GetItemText($hWndFrom, $ListViewItem[0]), 0) UpdateSetup() ElseIf $Option = $EmailContextDelete And ($hWndFrom = GUICtrlGetHandle($ListTo) Or $hWndFrom = GUICtrlGetHandle($ListCC)) Then _GUICtrlListView_CopyItems($hWndFrom, GUICtrlGetHandle($ListEmail), "true") _GUICtrlListView_SetColumnWidth(GUICtrlGetHandle($ListEmail), 0, $LVSCW_AUTOSIZE) ;~ RemoveAddress(_GUICtrlListView_GetItemText($hWndFrom, $ListViewItem[0]), 1) ;~ UpdateSetup() EndIf Return 0 ; allow the default processing Case $NM_RDBLCLK ; Sent by a list-view control when the user double-clicks an item with the right mouse button ; No return value Case $NM_RETURN ; The control has the input focus and that the user has pressed the ENTER key ; No return value Case $NM_SETFOCUS ; The control has received the input focus ; No return value EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFY Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted January 7, 2010 Share Posted January 7, 2010 Why does the version of SciTe matter? Unless you're hiding something from us then you should be more worried about that you have the same version of AutoIt. MsgBox(262208, "AutoIt version is:", @AutoItVersion) .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
KaFu Posted January 7, 2010 Share Posted January 7, 2010 Replace $LVN_BEGINLABELEDIT with $LVN_BEGINLABELEDITA. pixelsearch 1 OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 7, 2010 Moderators Share Posted January 7, 2010 (edited) jbrady21,The constants you are missing are in ListViewConstants.au3 for v3.3.2.0. I can only imagine that in an earlier version they were in another include which is why you do not have the problem. Are you both running the same version of Autoit?M23Edit: See I was beaten to it - that is what comes when i am trying to follow the Test match at the same time! Edited January 7, 2010 by Melba23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
jbrady21 Posted January 7, 2010 Author Share Posted January 7, 2010 We are not both running the same versions of AutoIt (3.3.0.0 for me / 3.3.2.0 for him). I will test out the suggestion from KaFu out (Replace $LVN_BEGINLABELEDIT with $LVN_BEGINLABELEDITA) and see where this gets me. Thanks for the quick responses, James Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now