[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.vb.general.discussion

OLEDrag Mouse Icon Change

BeeJ

7/8/2012 4:26:00 PM

I am dragging a file from Windows Explorer to my VB6 app and want the
mouse icon to reflect what my VB6 app will do when the mouse is over my
app and over my app drop spot (a Picturebox or Image):
The mouse icon state is dependent on the state of SHIFT as well.
i.e.
no shift or over a non-drop area = illegal
Ctrl = OK with one type of mouse icon
Ctrl-Shift = OK with a different type of mouse icon

How do I change the mouse icon for this operation?
I googled and found nothing.
I tried doing the work in imgIcon_OLEDragOver and it changed the icon
after not during.


28 Answers

Dee Earley

7/9/2012 9:40:00 AM

0

On 08/07/2012 17:26, BeeJ wrote:
> I am dragging a file from Windows Explorer to my VB6 app and want the
> mouse icon to reflect what my VB6 app will do when the mouse is over my
> app and over my app drop spot (a Picturebox or Image):
> The mouse icon state is dependent on the state of SHIFT as well.
> i.e.
> no shift or over a non-drop area = illegal
> Ctrl = OK with one type of mouse icon
> Ctrl-Shift = OK with a different type of mouse icon
>
> How do I change the mouse icon for this operation?
> I googled and found nothing.
> I tried doing the work in imgIcon_OLEDragOver and it changed the icon
> after not during.

You set the value of Effect to specify what you want it to do/allow.
Windows will then change the cursor to suit.

Private Sub FeedList_OLEDragOver(Data As ComctlLib.DataObject, Effect As
Long, Button As Integer, Shift As Integer, X As Single, Y As Single,
State As Integer)
Dim Item As Node

'Default to none
Effect = vbDropEffectNone

'Get the highlighted item
Set Item = FeedList.HitTest(X, Y)

'Only the group items are drop targets
If ItemType(Item) = "group" Then
'We're only interested in the local feeds
If Data.GetFormat(CF_CONSOLEFEED) Then
Effect = IIf(Shift And vbShiftMask, vbDropEffectMove, 0) Or
IIf(Shift And vbCtrlMask, vbDropEffectCopy, 0)
'Allow a default action dependant on the source group
Effect = Effect Or IIf(ParentGroupID = "groupall",
vbDropEffectCopy, vbDropEffectMove)
End If
End If
End Sub

--
Deanna Earley (dee.earley@icode.co.uk)
i-Catcher Development Team
http://www.icode.co.uk...

iCode Systems

(Replies direct to my email address will be ignored. Please reply to the
group.)


BeeJ

7/9/2012 9:59:00 PM

0

Deanna Earley expressed precisely :
> On 08/07/2012 17:26, BeeJ wrote:
>> I am dragging a file from Windows Explorer to my VB6 app and want the
>> mouse icon to reflect what my VB6 app will do when the mouse is over my
>> app and over my app drop spot (a Picturebox or Image):
>> The mouse icon state is dependent on the state of SHIFT as well.
>> i.e.
>> no shift or over a non-drop area = illegal
>> Ctrl = OK with one type of mouse icon
>> Ctrl-Shift = OK with a different type of mouse icon
>>
>> How do I change the mouse icon for this operation?
>> I googled and found nothing.
>> I tried doing the work in imgIcon_OLEDragOver and it changed the icon
>> after not during.
>
> You set the value of Effect to specify what you want it to do/allow.
> Windows will then change the cursor to suit.
>
> Private Sub FeedList_OLEDragOver(Data As ComctlLib.DataObject, Effect As
> Long, Button As Integer, Shift As Integer, X As Single, Y As Single, State As
> Integer)
> Dim Item As Node
>
> 'Default to none
> Effect = vbDropEffectNone
>
> 'Get the highlighted item
> Set Item = FeedList.HitTest(X, Y)
>
> 'Only the group items are drop targets
> If ItemType(Item) = "group" Then
> 'We're only interested in the local feeds
> If Data.GetFormat(CF_CONSOLEFEED) Then
> Effect = IIf(Shift And vbShiftMask, vbDropEffectMove, 0) Or IIf(Shift
> And vbCtrlMask, vbDropEffectCopy, 0)
> 'Allow a default action dependant on the source group
> Effect = Effect Or IIf(ParentGroupID = "groupall", vbDropEffectCopy,
> vbDropEffectMove)
> End If
> End If
> End Sub

I tried your way and this helps but I was hoping for a way to actually
change the icon as in

Screen.MousePointer =

I know that it can be done when within my own app but can't seem to
find a way when dragging starts outside my app. That would make if
much more user friendly.

--
Present and unaccounted for.


BeeJ

7/9/2012 10:34:00 PM

0

Deanna Earley submitted this idea :
> On 08/07/2012 17:26, BeeJ wrote:
>> I am dragging a file from Windows Explorer to my VB6 app and want the
>> mouse icon to reflect what my VB6 app will do when the mouse is over my
>> app and over my app drop spot (a Picturebox or Image):
>> The mouse icon state is dependent on the state of SHIFT as well.
>> i.e.
>> no shift or over a non-drop area = illegal
>> Ctrl = OK with one type of mouse icon
>> Ctrl-Shift = OK with a different type of mouse icon
>>
>> How do I change the mouse icon for this operation?
>> I googled and found nothing.
>> I tried doing the work in imgIcon_OLEDragOver and it changed the icon
>> after not during.
>
> You set the value of Effect to specify what you want it to do/allow.
> Windows will then change the cursor to suit.
>
> Private Sub FeedList_OLEDragOver(Data As ComctlLib.DataObject, Effect As
> Long, Button As Integer, Shift As Integer, X As Single, Y As Single, State As
> Integer)
> Dim Item As Node
>
> 'Default to none
> Effect = vbDropEffectNone
>
> 'Get the highlighted item
> Set Item = FeedList.HitTest(X, Y)
>
> 'Only the group items are drop targets
> If ItemType(Item) = "group" Then
> 'We're only interested in the local feeds
> If Data.GetFormat(CF_CONSOLEFEED) Then
> Effect = IIf(Shift And vbShiftMask, vbDropEffectMove, 0) Or IIf(Shift
> And vbCtrlMask, vbDropEffectCopy, 0)
> 'Allow a default action dependant on the source group
> Effect = Effect Or IIf(ParentGroupID = "groupall", vbDropEffectCopy,
> vbDropEffectMove)
> End If
> End If
> End Sub

Also, I see that this code only works if the Shift, Ctrl or Alt keys
are NOT used. Shift and Ctrl override the Effect returned thus
nullifying the desired visual.

--
Present and unaccounted for.


Larry Serflaten

7/10/2012 1:25:00 AM

0

BeeJ wrote:
>
> I tried your way and this helps but I was hoping for a way to actually
> change the icon as in
>
> Screen.MousePointer =
>
> I know that it can be done when within my own app but can't seem to
> find a way when dragging starts outside my app. That would make if
> much more user friendly.


See if this info helps:

http://msdn.microsoft.com/en-us/librar...(v=vs.60).aspx

LFS

Coder X

7/10/2012 2:06:00 AM

0

I see you are still asking for others to write your code for you. Have you
ever, once, actually tried writing your own code, even if it means days of
trial and error? Since I've never seen you post any, I'm guessing not.

And shame on the rest of you for enabling this kid. In the old days, we
used to ask folks to show the code they wrote so we could look at it,
instead of handing it to them.

::shakes head::

"BeeJ" <nospam@spamnot.com> wrote in message
news:jtfm8k$s1f$1@speranza.aioe.org...
> Deanna Earley submitted this idea :
>> On 08/07/2012 17:26, BeeJ wrote:
>>> I am dragging a file from Windows Explorer to my VB6 app and want the
>>> mouse icon to reflect what my VB6 app will do when the mouse is over my
>>> app and over my app drop spot (a Picturebox or Image):
>>> The mouse icon state is dependent on the state of SHIFT as well.
>>> i.e.
>>> no shift or over a non-drop area = illegal
>>> Ctrl = OK with one type of mouse icon
>>> Ctrl-Shift = OK with a different type of mouse icon
>>>
>>> How do I change the mouse icon for this operation?
>>> I googled and found nothing.
>>> I tried doing the work in imgIcon_OLEDragOver and it changed the icon
>>> after not during.
>>
>> You set the value of Effect to specify what you want it to do/allow.
>> Windows will then change the cursor to suit.
>>
>> Private Sub FeedList_OLEDragOver(Data As ComctlLib.DataObject, Effect As
>> Long, Button As Integer, Shift As Integer, X As Single, Y As Single,
>> State As Integer)
>> Dim Item As Node
>>
>> 'Default to none
>> Effect = vbDropEffectNone
>>
>> 'Get the highlighted item
>> Set Item = FeedList.HitTest(X, Y)
>>
>> 'Only the group items are drop targets
>> If ItemType(Item) = "group" Then
>> 'We're only interested in the local feeds
>> If Data.GetFormat(CF_CONSOLEFEED) Then
>> Effect = IIf(Shift And vbShiftMask, vbDropEffectMove, 0) Or
>> IIf(Shift And vbCtrlMask, vbDropEffectCopy, 0)
>> 'Allow a default action dependant on the source group
>> Effect = Effect Or IIf(ParentGroupID = "groupall",
>> vbDropEffectCopy, vbDropEffectMove)
>> End If
>> End If
>> End Sub
>
> Also, I see that this code only works if the Shift, Ctrl or Alt keys are
> NOT used. Shift and Ctrl override the Effect returned thus nullifying the
> desired visual.
>
> --
> Present and unaccounted for.
>
>


BeeJ

7/10/2012 2:38:00 AM

0

Coder X formulated the question :
> I see you are still asking for others to write your code for you. Have you
> ever, once, actually tried writing your own code, even if it means days of
> trial and error? Since I've never seen you post any, I'm guessing not.
>
> And shame on the rest of you for enabling this kid. In the old days, we used
> to ask folks to show the code they wrote so we could look at it, instead of
> handing it to them.
>
> ::shakes head::
>
> "BeeJ" <nospam@spamnot.com> wrote in message
> news:jtfm8k$s1f$1@speranza.aioe.org...
>> Deanna Earley submitted this idea :
>>> On 08/07/2012 17:26, BeeJ wrote:
>>>> I am dragging a file from Windows Explorer to my VB6 app and want the
>>>> mouse icon to reflect what my VB6 app will do when the mouse is over my
>>>> app and over my app drop spot (a Picturebox or Image):
>>>> The mouse icon state is dependent on the state of SHIFT as well.
>>>> i.e.
>>>> no shift or over a non-drop area = illegal
>>>> Ctrl = OK with one type of mouse icon
>>>> Ctrl-Shift = OK with a different type of mouse icon
>>>>
>>>> How do I change the mouse icon for this operation?
>>>> I googled and found nothing.
>>>> I tried doing the work in imgIcon_OLEDragOver and it changed the icon
>>>> after not during.
>>>
>>> You set the value of Effect to specify what you want it to do/allow.
>>> Windows will then change the cursor to suit.
>>>
>>> Private Sub FeedList_OLEDragOver(Data As ComctlLib.DataObject, Effect As
>>> Long, Button As Integer, Shift As Integer, X As Single, Y As Single, State
>>> As Integer)
>>> Dim Item As Node
>>>
>>> 'Default to none
>>> Effect = vbDropEffectNone
>>>
>>> 'Get the highlighted item
>>> Set Item = FeedList.HitTest(X, Y)
>>>
>>> 'Only the group items are drop targets
>>> If ItemType(Item) = "group" Then
>>> 'We're only interested in the local feeds
>>> If Data.GetFormat(CF_CONSOLEFEED) Then
>>> Effect = IIf(Shift And vbShiftMask, vbDropEffectMove, 0) Or
>>> IIf(Shift And vbCtrlMask, vbDropEffectCopy, 0)
>>> 'Allow a default action dependant on the source group
>>> Effect = Effect Or IIf(ParentGroupID = "groupall",
>>> vbDropEffectCopy, vbDropEffectMove)
>>> End If
>>> End If
>>> End Sub
>>
>> Also, I see that this code only works if the Shift, Ctrl or Alt keys are
>> NOT used. Shift and Ctrl override the Effect returned thus nullifying the
>> desired visual.
>>
>> -- Present and unaccounted for.
>>
>>

You must be blind. When I post code I am sometimes told it is too
much.
In my posts you will see that I do Google for answers.
And I usually state that I do not know the terminology so how can I
search.

Anyway thanks for you lack of help wasting my and other's time.

I come here because I know there are people who want to help and very
few are spoilers.


BeeJ

7/10/2012 2:38:00 AM

0

It happens that Larry Serflaten formulated :
> BeeJ wrote:
>>
>> I tried your way and this helps but I was hoping for a way to actually
>> change the icon as in
>>
>> Screen.MousePointer =
>>
>> I know that it can be done when within my own app but can&#39;t seem to
>> find a way when dragging starts outside my app. That would make if
>> much more user friendly.
>
>
> See if this info helps:
>
> http://msdn.microsoft.com/en-us/librar...(v=vs.60).aspx
>
> LFS

Thanks, I'll read it through. Hope I can understand it all.


mm

7/10/2012 6:40:00 AM

0


"BeeJ" <nospam@spamnot.com> escribió en el mensaje
news:jtfk6m$nik$1@speranza.aioe.org...

> I know that it can be done when within my own app but can't seem to find a
> way when dragging starts outside my app. That would make if much more
> user friendly.

But that would be being notified of any dragging action, and how would you
know if the dragging operation will end on your application or somewhere
else?


Dee Earley

7/10/2012 9:01:00 AM

0

On 09/07/2012 22:58, BeeJ wrote:
> Deanna Earley expressed precisely :
>> On 08/07/2012 17:26, BeeJ wrote:
>>> I am dragging a file from Windows Explorer to my VB6 app and want the
>>> mouse icon to reflect what my VB6 app will do when the mouse is over my
>>> app and over my app drop spot (a Picturebox or Image):
>>> The mouse icon state is dependent on the state of SHIFT as well.
>>> i.e.
>>> no shift or over a non-drop area = illegal
>>> Ctrl = OK with one type of mouse icon
>>> Ctrl-Shift = OK with a different type of mouse icon
>>>
>>> How do I change the mouse icon for this operation?
>>> I googled and found nothing.
>>> I tried doing the work in imgIcon_OLEDragOver and it changed the icon
>>> after not during.
>>
>> You set the value of Effect to specify what you want it to do/allow.
>> Windows will then change the cursor to suit.
>
> I tried your way and this helps but I was hoping for a way to actually
> change the icon as in
>
> Screen.MousePointer =
>
> I know that it can be done when within my own app but can't seem to find
> a way when dragging starts outside my app. That would make if much more
> user friendly.

It's not your icon/cursor to change to that extent.
It belongs to the application that initiated the drag.

--
Deanna Earley (dee.earley@icode.co.uk)
i-Catcher Development Team
http://www.icode.co.uk...

iCode Systems

(Replies direct to my email address will be ignored. Please reply to the
group.)


BeeJ

7/10/2012 10:16:00 PM

0

Deanna Earley formulated on Tuesday :
> On 09/07/2012 22:58, BeeJ wrote:
>> Deanna Earley expressed precisely :
>>> On 08/07/2012 17:26, BeeJ wrote:
>>>> I am dragging a file from Windows Explorer to my VB6 app and want the
>>>> mouse icon to reflect what my VB6 app will do when the mouse is over my
>>>> app and over my app drop spot (a Picturebox or Image):
>>>> The mouse icon state is dependent on the state of SHIFT as well.
>>>> i.e.
>>>> no shift or over a non-drop area = illegal
>>>> Ctrl = OK with one type of mouse icon
>>>> Ctrl-Shift = OK with a different type of mouse icon
>>>>
>>>> How do I change the mouse icon for this operation?
>>>> I googled and found nothing.
>>>> I tried doing the work in imgIcon_OLEDragOver and it changed the icon
>>>> after not during.
>>>
>>> You set the value of Effect to specify what you want it to do/allow.
>>> Windows will then change the cursor to suit.
>>
>> I tried your way and this helps but I was hoping for a way to actually
>> change the icon as in
>>
>> Screen.MousePointer =
>>
>> I know that it can be done when within my own app but can't seem to find
>> a way when dragging starts outside my app. That would make if much more
>> user friendly.
>
> It's not your icon/cursor to change to that extent.
> It belongs to the application that initiated the drag.

That is what I am seeing where ever I look but wouldn't it be nice to
allow the receiving app to indicate something more useful???
Are you listening MS? lol

--
Present and unaccounted for.