What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » AcceptFiles listbox

AcceptFiles listbox
Author: Message:
Dennis Mike
Junior Member
**

Avatar

Posts: 59
Reputation: 2
34 / Male / –
Joined: Jan 2007
O.P. AcceptFiles listbox
how can i use this property for add direction from the dragged file to the listbox?
03-02-2007 11:18 PM
Profile PM Web Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: AcceptFiles listbox
quote:
Originally posted by Dennis Mike
how can i use this property for add direction from the dragged file to the listbox?
You can't... (afaik)

That is, you can not do it unless you also use an external DLL to subclass the listview.

In Plus! scripting, you can subclass windows, but you can not subclass controls. And you need to subclass the listview control in order to use the drag/drop facility. There is no way to work around this I'm afraid...

Therefor, why the <AcceptFiles> was included in the listview is a small riddle to me :D. However, in the future I'm sure Patchou will add something to either subclass controls too or add some event which will trigger when files are dropped on a listview (which would be the best thing IMHO)...



Note: since you can subclass windows, you could drop files on a window and catch them though. For this you can use a small and very old API (is a leftover from Windows 95*). You need to tell Windows that your window can accept files. To do this you need to call the DragAcceptFiles API. When this is done, each time you drop files on your window, a WM_DROPFILES message will be posted from that window and you can get the dropped files using the DragQueryFile API.

But although this works for windows, here also lies the fact that you can not use this method for a control. This because the WM_DROPFILES message is posted from the window which accepted the files (your listview control), thus not send to its parent window... and the parent window is the only thing subclassable in Plus! scripting...

Other (more modern) methods like OLE2, also require methods not supported by Plus!. At least not that I know of..... But I actually hope I'm wrong here as I would like to use drag/dropping too.




* This was the method used in Windows 95 for setting windows to accept dropped files. Which since then better methods (OLE) were made. This also means that it is quite possible that this method will not work anymore in the future (eg: on Vista? dunno, don't have Vista atm to test it).

This post was edited on 03-03-2007 at 03:24 AM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
03-03-2007 02:07 AM
Profile PM Find Quote Report
Dennis Mike
Junior Member
**

Avatar

Posts: 59
Reputation: 2
34 / Male / –
Joined: Jan 2007
O.P. RE: AcceptFiles listbox
the mesage WM_DROPFILES is produced by listbox not by the pluswnd
how can i register the messages of listbox?
03-03-2007 03:05 AM
Profile PM Web Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: AcceptFiles listbox
As I said: you can not subclass controls with Plus! scripting, you can only subclass main Plus! windows, not the controls on them...

;)

This post was edited on 03-03-2007 at 03:25 AM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
03-03-2007 03:07 AM
Profile PM Find Quote Report
Dennis Mike
Junior Member
**

Avatar

Posts: 59
Reputation: 2
34 / Male / –
Joined: Jan 2007
O.P. RE: AcceptFiles listbox
it would be good including in the following version
pluswnd.controlid.RegisterMessageNotification
03-03-2007 03:12 AM
Profile PM Web Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: AcceptFiles listbox
yep, but the <AcceptFiles> attribute will still be useless then though, because that doesn't need to be set...

For dragging and dropping files on a listview it would be better and far more userfriendly if a new event will be added which accompanies <AcceptFiles>.



Note: you could still catch the WM_DROPFILES message though if you use the PeekMessage API. But this would require running in a loop and therefor this will also slow down or even halt everything in Messenger, therefor no good workaround...

This post was edited on 03-03-2007 at 03:30 AM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
03-03-2007 03:26 AM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On