1. RE: moving a listview item
- Posted by Derek Parnell <Derek.Parnell at SYD.RABOBANK.COM> Jun 17, 2002
- 380 views
This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_000_01C215CD.D1B87180 charset=iso-8859-1 I'm not sure why you NEED to create a ListView whose parent is the Desktop, but here is something that might get you along the way a bit. The problem is how are you intending to handle the Windows events for it? Also, the only way to close down the app is through the task manager, unless you explictly provide another way. -------------------- include win32lib.ew atom xgdw atom hWnd atom hp atom msg atom getRC xgdw = registerw32Function(user32, "GetDesktopWindow", {}, C_POINTER) hp = w32Func(xgdw,{}) hWnd = w32Func( xCreateWindow, { WS_EX_CLIENTEDGE, -- extended style WC_LISTVIEWA, 0, -- window caption or_all({ WS_CHILD, WS_VISIBLE, WS_BORDER, WS_TABSTOP, LVS_SHAREIMAGELISTS } ), -- window style 0, 0, -- initial x, y position 200, 200, -- initial x, y size hp, -- parent window handle 0, -- window menu handle instance(), -- program instance handle NULL} ) -- creation parameters -- Keep the application alive but not actually do anything. msg = acquire_mem(0, SIZEOF_MSG) while 1 do getRC = w32Func( xGetMessage, { msg, hp, 0, 0 } ) if find(getRC, {0, -1}) then exit -- The app has been closed down by somebody. end if w32Proc( xTranslateMessage, { msg } ) w32Proc( xDispatchMessage, { msg } ) end while release_mem(msg) -------------------------- cheers, Derek. > -----Original Message----- > From: pampeano at rocketmail.com [mailto:pampeano at rocketmail.com] > Sent: Monday, 17 June 2002 14:37 > To: EUforum > Subject: Re: moving a listview item > > > > Thanks Derek, i think i was too sleepy when i did that =P > Oh, another ques, is there a way to create a windows with a parent > that's not a win32lib prog (i'm trying to create a shell and I need to > create a window with GetDesktopWindow as parent). I done the same work > using only api calls, but unfortunatly couldn't succesfully create a > listview. > > Best Regards, > Guillermo Bonvehi > > --- Derek Parnell <ddparnell at bigpond.com> wrote: > > > > Hi Guillermo, > > the code sample you supplied can't be all of the offending code. > > Because in > > this snippet, the memory acquired in ptrPOINT is not set to > anything, > > thus > > the fetch() will always return zero. > > Also the line of code ... > > > > > store( ptrPOINT, ptX, fetch(ptrPOINT,ptX) ) > > > > seems to be doing nothing. It fetches whatever is at ptX in ptrPOINT > > and > > then stores that back into the same spot. > > > > As an alternative, have you looked at the demo program > > ListTreeView.exw as > > this moves items from a listview. > > > > ------------ > > Derek. > > > > ----- Original Message ----- > > From: <pampeano at rocketmail.com> > > To: "EUforum" <EUforum at topica.com> > > Sent: Friday, June 14, 2002 6:35 AM > > Subject: moving a listview item > > > > > > > > > > Hi all, > > > I've a routine that's supposed to move the icons of a listview, > > but > > > it's working very weird. > > > Code: > > > elsif msg = WM_LBUTTONDOWN then > > > Dragging = 1 > > > elsif msg = WM_LBUTTONUP then > > > Dragging = 0 > > > elsif msg = WM_MOUSEMOVE then > > > if Dragging = 1 and getLVSelectedCount(Desktop) > 0 then > > > ptrPOINT = acquire_mem(0, SIZEOF_POINT) > > > DesktopSelected = getLVSelected(Desktop) > > > if fetch(ptrPOINT, ptX) >= 0 and fetch(ptrPOINT, ptY) >= 0 then > > > fResult = w32Func(xGetCursorPos,{ptrPOINT}) > > > fResult = w32Func(xScreenToClient,{Desktop,ptrPOINT}) > > > store( ptrPOINT, ptX, fetch(ptrPOINT,ptX) ) > > > store( ptrPOINT, ptY, fetch(ptrPOINT,ptY) ) > > > fResult = sendMessage(Desktop, LVM_SETITEMPOSITION32, > > > DesktopSelected[1], ptrPOINT) > > > end if > > > release_mem( ptrPOINT ) > > > end if > > > end if > > > When i click on the icon an try to drag it it doesn't do > > > anything. Then i click on another one and drags the one that i > > clicked > > > first to that place. After that i can freely drag the > icon all over > > the > > > listview without the button pressed.. > > > > > > ===== > > > Best Regards, > > > Guillermo Bonvehi > > > AKA: Knixeur - Caballero Rojo > > > > > > > > > > ===== > Best Regards, > Guillermo Bonvehi > AKA: Knixeur - Caballero Rojo > > > > ================================================================== De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================================== The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================================== ------_=_NextPart_000_01C215CD.D1B87180 Content-Type: application/ms-tnef
2. RE: moving a listview item
- Posted by pampeano at rocketmail.com Jun 17, 2002
- 368 views
Hi Derek, Actually, i've already done that, i just was thinking if there was a way to create(window) with a parent that's not a win32lib created control. I guess i've to achieva that manually thanks anyway =) Oh i managed to add hittestLV if you want the code (it's actually mats code with all the vars changed). I tried to use the ondraganddrop event but it doesn't triggers if the drag is on the same listview.. I'll try to hack the lib's code to achieve that, if get some positive results and anyone wants it, i'll post the code. Best Regards, Guillermo Bonvehi --- Derek Parnell <Derek.Parnell at SYD.RABOBANK.COM> wrote: > > I'm not sure why you NEED to create a ListView whose parent is the > Desktop, > but here is something that might get you along the way a bit. > > The problem is how are you intending to handle the Windows events for > it? > Also, the only way to close down the app is through the task manager, > unless > you explictly provide another way. > > -------------------- > include win32lib.ew > atom xgdw > atom hWnd > atom hp > atom msg > atom getRC > > xgdw = registerw32Function(user32, "GetDesktopWindow", {}, C_POINTER) > hp = w32Func(xgdw,{}) > > hWnd = w32Func( xCreateWindow, { > WS_EX_CLIENTEDGE, -- extended style > WC_LISTVIEWA, > 0, -- window caption > or_all({ WS_CHILD, > WS_VISIBLE, > WS_BORDER, > WS_TABSTOP, > LVS_SHAREIMAGELISTS } ), -- window style > 0, 0, -- initial x, y position > 200, 200, -- initial x, y size > hp, -- parent window handle > 0, -- window menu handle > instance(), -- program instance handle > NULL} ) -- creation parameters > > > -- Keep the application alive but not actually do anything. > msg = acquire_mem(0, SIZEOF_MSG) > while 1 do > > getRC = w32Func( xGetMessage, { msg, hp, 0, 0 } ) > if find(getRC, {0, -1}) then > exit -- The app has been closed down by somebody. > end if > w32Proc( xTranslateMessage, { msg } ) > w32Proc( xDispatchMessage, { msg } ) > > end while > > release_mem(msg) > -------------------------- > cheers, > Derek.