Click here to Skip to main content
15,914,109 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralProblems with ranges in Excel Pin
Anonymous7-Oct-02 5:37
Anonymous7-Oct-02 5:37 
GeneralMFC Sockets design question Pin
User 66587-Oct-02 5:32
User 66587-Oct-02 5:32 
GeneralW2K vs Win9X child window creation w/ menu Pin
Tony Teveris7-Oct-02 4:48
Tony Teveris7-Oct-02 4:48 
Generalprocess handle to window HWND Pin
Liorsh7-Oct-02 4:34
Liorsh7-Oct-02 4:34 
GeneralRe: process handle to window HWND Pin
Iain Clarke, Warrior Programmer7-Oct-02 5:35
Iain Clarke, Warrior Programmer7-Oct-02 5:35 
GeneralAdding streams and files into MSWord compound file Pin
Mariusz Popiolek7-Oct-02 4:19
sussMariusz Popiolek7-Oct-02 4:19 
QuestionHDROP??? Pin
Nitron7-Oct-02 4:19
Nitron7-Oct-02 4:19 
AnswerRe: HDROP??? Pin
jmkhael7-Oct-02 4:26
jmkhael7-Oct-02 4:26 
MSDN:
Drag-and-Drop Operations
To support a drag-and-drop operation in a rich edit control, an application must first set an event mask by using the EM_SETEVENTMASK message to allow the EN_DROPFILES notification to be sent to the control's parent window. In the RICHED sample, when the parent window receives this notification, the DragQueryFile function is called to determine how many files have been dropped in the rich edit control. This sample allows the user to drop only one file at a time, so if more than one file has been dropped, the action is disallowed. If the user has dropped only one file, the application queries for the filename, opens the file, and reads it into the rich edit control. As you can see in the following code, the sample allows the user to drop only a TXT or an RTF file:

case WM_NOTIFY:
§
// Is the notification a drop notification?
else if (((LPNMHDR)lParam)->code == EN_DROPFILES)
{
WORD cFiles;
char lpszFile [80];
HANDLE hDrop;

// Get the handle to the drop object.
hDrop = ((ENDROPFILES *)lParam)->hDrop;
// Determine how many objects have been dropped.
cFiles = DragQueryFile (hDrop, 0xFFFF, (LPSTR)NULL, 0);
// If more than one object has been dropped, don't bother.
if (cFiles > 1)
return 0;
// Get the name of the file dropped.
DragQueryFile (hDrop, 0, lpszFile, sizeof (lpszFile));

// Open the file (TXT or RTF).
if (strstr (lpszFile, "TXT"))
OpenTheFile (hWndRichEdit, SF_TEXT, lpszFile);
else if (strstr (lpszFile, "RTF"))
OpenTheFile (hWndRichEdit, SF_RTF, lpszFile);
DragFinish (hDrop);
return 1;
}
return 0L;
break;

This code demonstrates one way that an application can handle a drop operation. Rich edit controls also support OLE drag and drop through the IRichEditOle and IRichEditOleCallback interfaces, which allow objects to be embedded in the control. The subject of embedding objects is beyond the scope of this book, however, so I will not cover it here.

Papa


while (TRUE)
Papa.WillLove ( Bebe ) ;
AnswerRe: HDROP??? Pin
Michael Dunn7-Oct-02 4:28
sitebuilderMichael Dunn7-Oct-02 4:28 
AnswerRe: HDROP??? Pin
Ravi Bhavnani7-Oct-02 4:34
professionalRavi Bhavnani7-Oct-02 4:34 
AnswerThanx! Pin
Nitron7-Oct-02 4:37
Nitron7-Oct-02 4:37 
Generalstatic function question Pin
ns7-Oct-02 3:39
ns7-Oct-02 3:39 
GeneralRe: static function question Pin
Chris Losinger7-Oct-02 3:39
professionalChris Losinger7-Oct-02 3:39 
Generalanother static member question Pin
ns7-Oct-02 3:45
ns7-Oct-02 3:45 
GeneralRe: another static member question Pin
Ravi Bhavnani7-Oct-02 4:32
professionalRavi Bhavnani7-Oct-02 4:32 
QuestionPowerPoint 2002 Automation, anyone tried ? Pin
Braulio Dez7-Oct-02 3:14
Braulio Dez7-Oct-02 3:14 
AnswerRe: PowerPoint 2002 Automation, anyone tried ? Pin
jmkhael7-Oct-02 5:18
jmkhael7-Oct-02 5:18 
GeneralRe: PowerPoint 2002 Automation, anyone tried ? Pin
Braulio Dez7-Oct-02 5:50
Braulio Dez7-Oct-02 5:50 
Questionhow to simulate the terrians? Pin
wangnanjing7-Oct-02 3:16
wangnanjing7-Oct-02 3:16 
AnswerRe: how to simulate the terrians? Pin
Chris Richardson7-Oct-02 6:48
Chris Richardson7-Oct-02 6:48 
GeneralRe: how to simulate the terrians? Pin
Maximilien7-Oct-02 7:39
Maximilien7-Oct-02 7:39 
GeneralRe: how to simulate the terrians? Pin
Chris Richardson7-Oct-02 7:41
Chris Richardson7-Oct-02 7:41 
GeneralRe: how to simulate the terrians? Pin
Mike Nordell8-Oct-02 4:49
Mike Nordell8-Oct-02 4:49 
GeneralRe: how to simulate the terrians? Pin
Chris Richardson8-Oct-02 5:53
Chris Richardson8-Oct-02 5:53 
Generalderived class, but want base class function Pin
ns7-Oct-02 3:06
ns7-Oct-02 3:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.