 |
|
 |
I'm doing a one off MFC project, I don't need to know everything about the way messages are handled. Following this article, it took me about five minutes to integrate a drag and drop feature, whereas otherwise it probably would have taken me the whole morning.
|
|
|
|
 |
|
|
 |
|
 |
Bookmarked!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
 |
|
 |
It clearly and simply works and he explains what he does.
I found it a great tutorial.
- Art
|
|
|
|
 |
|
 |
It's DragAcceptFiles(TRUE);
Maybe one can fix that typo?
In the "OnDropFiles" function, return 0.
|
|
|
|
 |
|
 |
First great code from you and 5 stars for you, i have used your mfc code solution for mfc windows moving without a caption.
p.s. sry for my sh***y english.
To be able to move your windows in a win32 api non mfc application.
Simply add:
case WM_LBUTTONDOWN:
{
SendMessage(hwndDlg, WM_NCLBUTTONDOWN, HTCAPTION,NULL);
break;
}
in
BOOL CALLBACK MainProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg)
{
case WM_INITDIALOG:
hWndMain = hwndDlg;
SetClassLong (hwndDlg, GCL_HICON, (long)LoadIcon(hInstance, MAKEINTRESOURCE(ICON_MAIN)));
case WM_LBUTTONDOWN:
{
SendMessage(hwndDlg, WM_NCLBUTTONDOWN, HTCAPTION,NULL);
break;
}
}
return FALSE;
}
|
|
|
|
 |
|
 |
Hi there,
I looked arround on CodeProject quite a while for "drag and drop" and
looked to enough samples to say, that this one is the best I found. Yes,
at MSDN is everything, but, you spend more time for looking than for
coding. At M$ they never will be able to write an documentation which
is usable.
|
|
|
|
 |
|
 |
Many code examples I've seen elsewhere have too many bells and whistles attached and confuse me more often than help me. Having more experience in UNIX programming, I tend to get overwhelmed by the amount of code in a very simple Windows program. This drag and drop example seems to be about as simple as you can get while demonstrating a very useful feature. Good job!!
|
|
|
|
 |
|
 |
Man, I pressed the vote button by mistake and gave you a rating of 2 inadvertantly. Sorry about that. It won't let me change votes. You deserve 4 at the very least.
|
|
|
|
 |
|
 |
thanks for the short, precise article. not all of us can be as l33t as the guys in the previous thread. i had file dnd working w/in 5 minutes of reading your article...
|
|
|
|
 |
|
 |
Hi,
Can u tell me who is the target audience for this article..
What u have said can be found in any MSDN help or other sites too...
cheers,
Super
------------------------------------------
Too much of good is bad,mix some evil in it
|
|
|
|
 |
|
 |
Yes i agree with your attitude.
we can get A to Z of things(Any thing ) from MSDN.But they are not arranged well ,we have to mix it up for our need thaz what i have done here. Any one can use this techniq who wann Drag and Drop in a Dialog.while searching for a stuff like this i couldnt find neither in codeproject nor in codeguru.;)
If you do little things well, you'll do big ones better.
|
|
|
|
 |
|
 |
Why stop with WM_DROPFILES? How about articles descrbing every WM message? And then some for all the shell32.dll functions? How about painting? Where do you stop? Lets just duplicate all of MSDN here!!
This sort of article is unnecessary and superfluous. All it does is make it harder to find quality information.
The only article you should be posting is a Dummy's Guide to Navigating MSDN.
|
|
|
|
 |
|
 |
i dont thing so .. I am pretty sure that this will help for those who wants a start to drag and drop feature in a dialog.
|
|
|
|
 |
|
 |
Just for curiosity, the rating now is 3.7. How is this done? In a normal way to find average value, it is:
Avrg = sum(Xi)/N (for i = 1 to N).
But now the rating is 3.7 and two people have rated, so it would be 7.4 in sum and divided by 2. How have 7.4 been obtained? We can rate 3 and 5 which give 4 in average. By any ways we cannot give a decimal. Therefore, it must have had another way to calculate the average value.
Ke
|
|
|
|
 |
|
 |
Rating is counted proportionally to member status. It is described somewhere in CodeProject. For example, I am a gold member and my 5 changed the rating from 2.93 to 3.39.
I put 5 because I think this article is useful for somebody who needs this stuff. To my opinion, simple article is not bad article, and CodeProject is site both for experienced programmers and for beginners.
|
|
|
|
 |
|
 |
cannot open include file 'res\ComGuidFinder.rc2'.
(Actually, I removed "res\" from all references of the file, and it ran. I just wanted to let you know that what you released for downloading, needed a bit of house cleaning done.)
William
Fortes in fide et opere!
|
|
|
|
 |
|
 |
Sorry it was my mistake . while zipping files i missed one thing. Now i added that in my Zip file.
One methods to overcome the error for now is, create a folder under your project folder name it as 'res' then copy the
ComGuidFinder.rc2 and ComGuidFinder icon file into that folder
thx
Jibesh
|
|
|
|
 |