Jump to content

[Solved] Cannot capture ctrl inputs (WM_NOTIFY)


Kyan
 Share

Recommended Posts

Hi, I have 2 forms, when I'm in WM_NOTIFY i cannot open _arraydisplay or capture user inputs in any ctrl, how do I can contorn this problem?, yes, in the help file is said to do not use msgbox or windows, the return should be the fastest possible, but I need to open a form from listview context menu, and in this way it is not possible

Here's what I'm trying to do (simplified)

#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <ButtonConstants.au3>
#include <WindowsConstants.au3>
#include <array.au3>
#include <GuiMenu.au3>
#include <GuiListView.au3>
#include <ListViewConstants.au3>
Opt('TrayIconHide',1)
#Region ### START Koda GUI section ### Form=
Global $RCopen, $Form2, $Button1
Global $array[3] = ["This","ins't","displayed"]
$Form1 = GUICreate("Form1", -1,-1, 259, 242)
$ListView1 = GUICtrlCreateListView("", 0, -8, 259, 94)
_GUICtrlListView_SetExtendedListViewStyle($ListView1, BitOR($LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT, $LVS_EX_SUBITEMIMAGES))
_GUICtrlListView_InsertColumn($ListView1, 0, "Position", 120)
_GUICtrlListView_InsertColumn($ListView1, 1, "No one cares", 100)
_GUICtrlListView_AddItem($ListView1, '1st')
_GUICtrlListView_AddItem($ListView1, '2nd')
_GUICtrlListView_AddItem($ListView1, '3nd')
_GUICtrlListView_AddSubItem($ListView1, 2, 'No one', 1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")

While 1
$nMsg = GUIGetMsg(1)
Switch $nMsg[1]
Case $Form1
Switch $nMsg[0]
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
Case $Form2
Switch $nMsg[0]
Case $GUI_EVENT_CLOSE
GUIDelete($Form2)

Case $Button1
_ArrayDisplay($array)

EndSwitch
EndSwitch
WEnd

Func _Form2()
$Form2 = GUICreate("Form2", -1,-1, 284, 430)
$Button1 = GUICtrlCreateButton("List Array", 56, 26, 153, 33)
GUISetState(@SW_SHOW)
EndFunc

Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam)
Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndListView, $tInfo
$hWndListView = $ListView1
If Not IsHWnd($ListView1) Then $hWndListView = GUICtrlGetHandle($ListView1)

$tNMHDR = DllStructCreate($tagNMHDR, $ilParam)
$hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
$iIDFrom = DllStructGetData($tNMHDR, "IDFrom")
$iCode = DllStructGetData($tNMHDR, "Code")
Switch $hWndFrom
Case $hWndListView
Switch $iCode
Case $NM_RCLICK
ListView_RClick()
Return 0
EndSwitch
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc


Func ListView_RClick()
Local $mipost,$numsel
$mipost = _GUICtrlListView_SubItemHitTest($ListView1)
If ($mipost[0] <> -1) Then
$hMenu = _GUICtrlMenu_CreatePopup()
_GUICtrlMenu_AddMenuItem($hMenu, "Open", $RCopen)
;>>>>>>>>>>>>>>>>>>> Seleccion menu Contextual <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Switch _GUICtrlMenu_TrackPopupMenu($hMenu, $ListView1, -1, -1, 1, 1, 2)
Case $RCopen
_Form2()
EndSwitch
_GUICtrlMenu_DestroyMenu($hMenu)
EndIf
EndFunc

PS: By some reason, all ctrls are triggred when the example is runned, I checked for syntax error but didn't find anything wrong

Edited by DiOgO

Heroes, there is no such thing

One day I'll discover what IE.au3 has of special for so many users using it.
C'mon there's InetRead and WinHTTP, way better
happy.png

Link to comment
Share on other sites

Why aren't you using the native controls when adding items to the ListView? Because if you do it that way, you can use the normal Context Menu controls instead of trying to shoehorn your code in there.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

Somewhat like this should get you to the way

#include <GUIConstantsEx.au3>
#include <ButtonConstants.au3>

Global $Form1, $Form2, $Button1, $context_id

Example1()

; ****************
; * First sample *
; ****************
Func Example1()
;right click on gui to bring up context Menu.
;right click on the "ok" button to bring up a controll specific context menu.

$Form1 = GUICreate("My GUI Context Menu", 300, 200)

Local $contextmenu = GUICtrlCreateContextMenu()

Local $listview = GUICtrlCreateListView("Position|No one Cares", 10, 10, 200)
GUICtrlCreateListViewItem("1st|", $listview)
GUICtrlCreateListViewItem("2nd|", $listview)
GUICtrlCreateListViewItem("3rd|No one", $listview)

Local $listviewcontext = GUICtrlCreateContextMenu($listview) ;for the whole listview can also be for individual items
$context_id = GUICtrlCreateMenuItem("Open", $listviewcontext)

GUISetState()

; Run the GUI until the dialog is closed
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
ExitLoop
Case $context_id
_Form2()
EndSwitch
WEnd
GUIDelete()
EndFunc ;==>Example1


Func _Form2()
$Form2 = GUICreate("Form2", -1, -1, 284, 430)
$Button1 = GUICtrlCreateButton("Exit This Second GUI for the First to Work Again", 56, 26)
GUISetState(@SW_SHOW)

Local $iMsg
While 1
$iMsg = GUIGetMsg(1)
Switch $iMsg[1]
Case $Form1
Switch $iMsg[0]
Case $GUI_EVENT_CLOSE
GUIDelete($Form1)
Case $context_id
Beep()
EndSwitch
Case $Form2
Switch $iMsg[0]
Case $GUI_EVENT_CLOSE, $Button1
GUIDelete($Form2)
ExitLoop
EndSwitch
EndSwitch
WEnd

EndFunc ;==>_Form2
Dont forget to use tidy(CTRL + T) for a clean look

Regards :)

Edited by PhoenixXL

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Link to comment
Share on other sites

Why aren't you using the native controls when adding items to the ListView? Because if you do it that way, you can use the normal Context Menu controls instead of trying to shoehorn your code in there.

because with native controls, the context menu could be open by clean anywhere in the listview even without a item being selected

Somewhat like this should get you to the way

#include <GUIConstantsEx.au3>
#include <ButtonConstants.au3>

Global $Form1, $Form2, $Button1, $context_id

Example1()

; ****************
; * First sample *
; ****************
Func Example1()
;right click on gui to bring up context Menu.
;right click on the "ok" button to bring up a controll specific context menu.

$Form1 = GUICreate("My GUI Context Menu", 300, 200)

Local $contextmenu = GUICtrlCreateContextMenu()

Local $listview = GUICtrlCreateListView("Position|No one Cares", 10, 10, 200)
GUICtrlCreateListViewItem("1st|", $listview)
GUICtrlCreateListViewItem("2nd|", $listview)
GUICtrlCreateListViewItem("3rd|No one", $listview)

Local $listviewcontext = GUICtrlCreateContextMenu($listview) ;for the whole listview can also be for individual items
$context_id = GUICtrlCreateMenuItem("Open", $listviewcontext)

GUISetState()

; Run the GUI until the dialog is closed
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
ExitLoop
Case $context_id
_Form2()
EndSwitch
WEnd
GUIDelete()
EndFunc ;==>Example1


Func _Form2()
$Form2 = GUICreate("Form2", -1, -1, 284, 430)
$Button1 = GUICtrlCreateButton("Exit This Second GUI for the First to Work Again", 56, 26)
GUISetState(@SW_SHOW)

Local $iMsg
While 1
$iMsg = GUIGetMsg(1)
Switch $iMsg[1]
Case $Form1
Switch $iMsg[0]
Case $GUI_EVENT_CLOSE
GUIDelete($Form1)
Case $context_id
Beep()
EndSwitch
Case $Form2
Switch $iMsg[0]
Case $GUI_EVENT_CLOSE, $Button1
GUIDelete($Form2)
ExitLoop
EndSwitch
EndSwitch
WEnd

EndFunc ;==>_Form2
Dont forget to use tidy(CTRL + T) for a clean look

Regards :)

didn't know about this tidy function for making the script clean to work with, thanks

in your example I can open the context menu, everywhere in listview, that's why I need to move to $WM_NOTIFY event :)

Heroes, there is no such thing

One day I'll discover what IE.au3 has of special for so many users using it.
C'mon there's InetRead and WinHTTP, way better
happy.png

Link to comment
Share on other sites

This would show up on the last listitem

#include <GUIConstantsEx.au3>


Example1()

; ****************
; * First sample *
; ****************
Func Example1()
;right click on gui to bring up context Menu.
;right click on the "ok" button to bring up a controll specific context menu.

GUICreate("My GUI Context Menu", 300, 200)

Local $listview = GUICtrlCreateListView("Position|No one Cares", 10, 10, 200)
GUICtrlCreateListViewItem("1st|", $listview)
GUICtrlCreateListViewItem("2nd|", $listview)
Local $iLast = GUICtrlCreateListViewItem("3rd|No one", $listview)

Local $listviewcontext = GUICtrlCreateContextMenu($iLast) ;for the last listview item
$context_id = GUICtrlCreateMenuItem("Open", $listviewcontext)

GUISetState()

; Run the GUI until the dialog is closed
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
ExitLoop
Case $context_id
MsgBox(64, "Info - " & @ScriptName, "Last ListItem Clicked" )
EndSwitch
WEnd
GUIDelete()
EndFunc   ;==>Example1

Press CTRL+T in scite and it would add the TAB character in your script

Edited by PhoenixXL

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Link to comment
Share on other sites

This would show up on the last listitem

#include <GUIConstantsEx.au3>


Example1()

; ****************
; * First sample *
; ****************
Func Example1()
;right click on gui to bring up context Menu.
;right click on the "ok" button to bring up a controll specific context menu.

GUICreate("My GUI Context Menu", 300, 200)

Local $listview = GUICtrlCreateListView("Position|No one Cares", 10, 10, 200)
GUICtrlCreateListViewItem("1st|", $listview)
GUICtrlCreateListViewItem("2nd|", $listview)
Local $iLast = GUICtrlCreateListViewItem("3rd|No one", $listview)

Local $listviewcontext = GUICtrlCreateContextMenu($iLast) ;for the last listview item
$context_id = GUICtrlCreateMenuItem("Open", $listviewcontext)

GUISetState()

; Run the GUI until the dialog is closed
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
ExitLoop
Case $context_id
MsgBox(64, "Info - " & @ScriptName, "Last ListItem Clicked" )
EndSwitch
WEnd
GUIDelete()
EndFunc ;==>Example1

Press CTRL+T in scite and it would add the TAB character in your script

works for the last (the one you create the handle), but I need to create a dinamic list, readed from a sql database, how can I create handles for everything, get the index, search for text with native listview?

Heroes, there is no such thing

One day I'll discover what IE.au3 has of special for so many users using it.
C'mon there's InetRead and WinHTTP, way better
happy.png

Link to comment
Share on other sites

works for the last (the one you create the handle), but I need to create a dinamic list, readed from a sql database, how can I create handles for everything, get the index, search for text with native listview?

First its not the handle its the controlid, and i declared $iLast because of the clearity of the script it could even be "$listview + 3"

Second, can you please tell us what do you want ?

From my point of view using an Array and For loop you can do load SQL data without any problem

Please do provide what you want clearly !!

Edited by PhoenixXL

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Link to comment
Share on other sites

First its not the handle its the controlid, and i declared $iLast because of the clearity of the script it could even be "$listview + 3"

Second, can you please tell us what do you want ?

From my point of view using an Array and For loop you can do load SQL data without any problem

Please do provide what you want clearly !!

ok, I thought the output from a guictrlcreate is a handle, so could I sum values to a ctrlid?

I want to list a sql table in listview (just a few columns), and if hit right click on a list item>Open, it opens a window with all the table info for that item index/text (I could use the index or the item text to query the sql row)

Edited by DiOgO

Heroes, there is no such thing

One day I'll discover what IE.au3 has of special for so many users using it.
C'mon there's InetRead and WinHTTP, way better
happy.png

Link to comment
Share on other sites

well, i followed a Melba23 ideia of using a flag in main loop, now i can use _arraydisplay and other stuff, the problem now is I cannot got ctrl iterations (clicks on buttons, etc) for the Form2, maybe by ctrl IDs ins't defined before using the main loop, but I put them as global and set a number like $Form2=2001, $Button1 = 2002 [...], why I cannot get "ctrl events" in the main loop (is not events, but I don't know how to called, and I'm using autoit in normal mode, not in EventMode)

EDIT: I manage to fix it by read the ctrl id from $msg[0] ($msg=GUIGetMsg(1)), what is strange is for a ctrl with the name $f2btn, If i use it at main loop, it have different id than the one returned when i click in $f2btn

EDIT2: Just 2 controls with same variable, thats why ctrlid have changed when I output to console

Edited by DiOgO

Heroes, there is no such thing

One day I'll discover what IE.au3 has of special for so many users using it.
C'mon there's InetRead and WinHTTP, way better
happy.png

Link to comment
Share on other sites

DiOgO,

ok, I thought the output from a guictrlcreate is a handle, so could I sum values to a ctrlid?

I would advise against this.

I want to list a sql table in listview (just a few columns), and if hit right click on a list item>Open, it opens a window with all the table info for that item index/text (I could use the index or the item text to query the sql row)

If you are displaying all row info for the item what do you expect a row query to return?

kylomas

edit: and what does this man?

EDIT2: Just 2 controls with same variable, thats why ctrlid have changed when I output to console

Edited by kylomas

Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Link to comment
Share on other sites

If you are displaying all row info for the item what do you expect a row query to return?

I'm displaying every column (returned by the sql query) in each listview column (subItem) for rows

edit: and what does this man?

when I said that ctrl id is diferent before when I create the ctrl from when I listen gui events, the cause was that I was using a variable to two ctrl's, that why I cannot get the correct ctrl id

Heroes, there is no such thing

One day I'll discover what IE.au3 has of special for so many users using it.
C'mon there's InetRead and WinHTTP, way better
happy.png

Link to comment
Share on other sites

DiOgO,

The following code is self-contained, just run it. As near as I can tell this is what you are trying to do. This does not use context menus or guiregistermsg.

#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
#include <Constants.au3>
#include <sqlite.au3>
#include <guilistview.au3>

#AutoIt3Wrapper_Add_Constants=n
;------------------------------------------------------------------------------------------------
;       Setup SQLITE
;------------------------------------------------------------------------------------------------

Local $db = @ScriptDir & '\example.DB3'

Local $Dllname = _SQLite_Startup(Default, 1)
If @error Then
    MsgBox($mb_ok,'OPEN ERROR',"sqlite3.dll can't be found.")
    _exit()
EndIf

OnAutoItExitRegister("_SQLite_ShutDown") ;  function is in sqlite.au3

ConsoleWrite("Using " & $Dllname & @LF)

Local $hDB = _SQLite_Open($db)
If @error Then
    MsgBox($mb_ok, "ERROR", "Error opening DB.")
    Exit
EndIf

OnAutoItExitRegister("_exit")

;------------------------------------------------------------------------------------------------
;       Create Table and load some data
;------------------------------------------------------------------------------------------------

local $sql

$sql  =  'drop table if exists CONTACTS;'   ; not neccessary unless changing table/column definitions

if _SQLite_Exec($hDB,$sql) <> $sqlite_ok then
    msgbox($mb_ok, 'Table DROP Error',@error)
    _exit()
endif

$sql  =  'CREATE TABLE if not exists [CONTACTS] ('
$sql &=  '[ID] INTEGER PRIMARY KEY autoincrement,'
$sql &=  '[FNAME] CHAR,'
$sql &=  '[LNAME] CHAR not null,'
$sql &=  '[Addr1] CHAR,'
$sql &=  '[Addr2] CHAR,'
$sql &=  '[City] CHAR,'
$sql &=  '[State] CHAR,'
$sql &=  '[Country] CHAR,'
$sql &=  '[Zip] INTEGER,'
$sql &=  '[Work Tele] CHAR,'
$sql &=  '[Home Tele] CHAR,'
$sql &=  '[TS] TIMESTAMP default CURRENT_TIMESTAMP,'
$sql &=  '[Email] CHAR,'
$sql &=  'constraint [chkZIP] check(length(ZIP) = 5));'

if _SQLite_Exec($hDB,$sql) <> $sqlite_ok then
    msgbox($mb_ok, 'Table Create Error',@error)
    _exit()
endif

local $aContacts[9][11] =   [ _
    ['Bilbo   ', 'Baggins  ', '1111 Hobbiton BLVD   ', '           ', 'Hobbiton       ', '         ', 'Shire  ', '00000', '            ', '', '                       '], _
    ['Paul    ', 'McCartney', '                     ', '           ', 'London         ', '         ', 'England', '12345', '            ', '', 'beatles@elanorrigby.com'], _
    ['Barak   ', 'Obama    ', '1600 Pennsylvania Ave', '           ', 'Washington D.C.', '         ', 'USA    ', '54321', '000-000-0000', '', 'howdidigetsolucky.com  '], _
    ['John    ', 'Smith    ', '1234 Common ST       ', 'ATTN:Anyman', 'AnyWhere       ', 'Wisconsin', 'USA    ', '00000', '            ', '', 'WTF.com                '], _
    ['Joe     ', 'Doe      ', '                     ', '           ', 'SomeWhere      ', '         ', 'USA    ', 'aaaaa', '            ', '', 'huh.net                '], _
    ['Aragorn ', ''         , '                     ', '           ', 'North          ', '         ', '',        '12345', '            ', '', '                       '], _
    ['Denethor', ''         , '                     ', '           ', 'Gondor         ', '         ', '',        '23456', '            ', '', '                       '], _
    ['George  ', 'Forman   ', '                     ', '           ', '               ', 'Alabama  ', '',        '34567', '414-444-9090', '', '                       '], _
    ['Alex    ', 'Analman  ', '000 Particular Ave   ', 'Suite 666  ', 'Normal         ', 'Oklahoma ', 'USA    ', '45678', '            ', '', 'please.org             '] _
                            ]

for $1 = 0 to ubound($aContacts,1) - 1
    $sql = 'insert into contacts (fname, lname, addr1, addr2, city, state, country, zip, [work tele], [home tele], email) values ('
    for $2 = 0 to ubound($aContacts,2) - 1
        $sql &=  _SQLite_FastEscape(stringstripws($aContacts[$1][$2],3)) & ','
    Next
    $sql = stringtrimright($sql,1)
    $sql &= ');'

    if _sqlite_exec(-1, $sql) <> $sqlite_ok Then
        ConsoleWrite('Table insert failed STMT = ' & $sql & @LF)
        _exit()
    endif
next

;------------------------------------------------------------------------------------------------
;
;       Setup / Display Gui's
;
;------------------------------------------------------------------------------------------------

local $aRows, $irows, $icols, $ret

local $gui010   =   guicreate('My Example Listview Using SQLite',80,200,-1,-1,bitor($ws_popup,$ws_thickframe),$ws_ex_clientedge)
local $aGS      =   wingetclientsize($gui010)
local $lvl010   =   GUICtrlCreateListView('Name           ',0,0,$aGS[0],$aGS[1])
local $hlvl010  =   GUICtrlGetHandle($lvl010)

                    $ret = _SQLite_GetTable(-1, "SELECT fname FROM contacts;", $arows, $iRows, $iCols)

                    local $alvitems[ubound($arows) - 2]

                    for $1 = 2 to $arows[0]
                        $alvitems[$1-2] = GUICtrlCreateListViewItem($arows[$1],$lvl010)
                    next

                    guisetstate()

while 1
    switch guigetmsg()
        case $gui_event_close
            _exit()
        case $alvitems[0] to $alvitems[ubound($alvitems) - 1]
             display_row( _GUICtrlListView_GetItemTextString($hlvl010, -1) )
    EndSwitch

WEnd

func display_row($str)

    if  _SQLite_GetTable2d(-1, 'SELECT * FROM contacts where fname = ' & _sqlite_fastescape($str) & ';', $aRows, $iRows, $iCols) <> $sqlite_ok then return

    local $apos = wingetpos($gui010)

    local $gui020   =   guicreate('',300,500,$apos[0]+$apos[2]+15,$apos[1]+15,$ws_popup)
                        GUISetBkColor(0xffffbb)
                        for $1 = 0 to ubound($arows) - 1
                            for $2 = 0 to ubound($arows,2) - 1
                                guictrlcreatelabel($arows[$1][$2],($1 * 100)+15,($2 * 15)+10,200,15)
                                guictrlsetfont(-1,8.5,600,default,'Courier New')
                            Next
                        next
                        guisetstate()

    while guigetmsg() <> $gui_event_close
    wend

    guidelete($gui020)

    return

endfunc

Func _exit()
    _SQLite_Close($hDB)
    exit
EndFunc   ;==>_exit

kylomas

Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Link to comment
Share on other sites

DiOgO,

You have the topic marked as [sOLVED]. Would you mind posting the solution, please?

kylomas

I already told how do I solved it, just set a flag and a var with the item index at ListView_RClick() and as the flag is set to 1, a if case is triggred inside the main loop (while 1 ... wend) and the code is executed, with this way and can return faster from WM-notify without causing GUI crashes :) (this idea is from Melba 23)

in this topic my problem ins't with sql, just listview context menu (as you can read in the first post)

btw, really nice use of a window popup, just need a small cross to close it :) (it can be closed with ESC key)

Heroes, there is no such thing

One day I'll discover what IE.au3 has of special for so many users using it.
C'mon there's InetRead and WinHTTP, way better
happy.png

Link to comment
Share on other sites

btw, really nice use of a window popup, just need a small cross to close it :) (it can be closed with ESC key)

That was the intent...was just trying to show you a way to do this without registering messages, using context menu's or manipulating ctrl id's.

in this topic my problem ins't with sql, just listview context menu (as you can read in the first post)

I know the issue is'nt SQLite, that is pretty straight forward.

Good Luck,

kylomas

edit: What is significant to this thread is the way I generated the listview item control id's and polled them.

Edited by kylomas

Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Link to comment
Share on other sites

That was the intent...was just trying to show you a way to do this without registering messages, using context menu's or manipulating ctrl id's.

really nice, thanks :)

edit: What is significant to this thread is the way I generated the listview item control id's and polled them.

yup, but in my case, I gave te possiblity of update the values from the row (each row points to a user as your example) as well a way to remove a row/user from the listview by using the context menu

Heroes, there is no such thing

One day I'll discover what IE.au3 has of special for so many users using it.
C'mon there's InetRead and WinHTTP, way better
happy.png

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...