Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

drag-n-drop issues...

Status
Not open for further replies.

MFCnewbieDave

Programmer
Mar 9, 2001
4
0
0
US
Background: MFC6.0 on XPSP2
App: Wizard-generated SDI (w/splitter)

I have successfully been able to drag and drop files
into my SDI VIEW class (even after splitting). This
works fine.

BUT, If I accidentally drop onto the mainframe's toolbar,
or the splitter-window separater bars, I get a nasty
exception that kills my program.

What is required for me to do to band-aid this?
(Do I gotta make my mainframe a legitimate OLE drop-target,
and override the OnDragEnter/exit/drop methods, returning
DROPEFFECT_NONE???) I cant seem to find the right place to
call my dtMainFrameOleContainer.Register function)

Secondly. When Im dragging files in from explorer, If
my program has input focus, then while Im dragging in, I
can trap the SHIFT and CTRL key up and down message in order
to change my DROPEFFECT return types (meaning to toggle
between MOVES, COPYS, and LINKS).

BUT, if EXPLORER has the input focus before the drag,
then it has the input focus, and I cant get the keydown
and up message to register to my application, and I can
only get the default DROPEFFECT return type.

How can I cause my application to steal input focus from
within the OnDragEnter function? Do I do this from my view?
or do I have to have this done from my mainframe window?

Free candy-bar to whoever sets me on the enlightened path.
:cool:

Thanks a $1E6.

-Dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top