Creating that drag image was a bit of work.
Fortunately, the listview control is willing to do some
of the work for you.
Throw away the OnLButtonDown function
(and the HANDLE_MESSAGE that goes with it).
Instead, we'll make the listview do all our presentation
for us.
BOOL
OnCreate(HWND hwnd, LPCREATESTRUCT lpcs)
{
g_hwndChild = CreateWindow(...
You may have noticed that the drag feedback is rather sad-looking.
Just a box, maybe with a plus sign or an arrow; you don't
even know what it is you're dragging.
Let's fix that. We'll drag the icon of the file around.
We'll need to add the drag image to the data object.
void OnLButtonDown(HWND hwnd, BOOL fDoubleClick, int x, int y, UINT keyF...
We were considering how to detect that the drag/drop operation
resulted in a conceptual Move even if the DROPEFFECT_MOVE
was optimized away.
If the drop target is the shell, you can query the
data object for CFSTR_PERFORMEDDROPEFFECT
to see what the performed effect was.
void OnLButtonDown(HWND hwnd, BOOL fDoubleClick,
int x...
Let's say that we did want to support Move in our
drag/drop program, for whatever reason.
Let's do it with some scratch file instead
of clock.avi, though. Create a file somewhere
that you don't mind losing; let's say it's C:\throwaway.txt.
Change the function OnLButtonDown as follows:
void OnLButtonDown(HWND hwnd, BOOL fDoubleClick,
...
I've seen some confusion over the difference between the function and the function.
returns the virtual key state. In other words, reports the state of the keyboard based on the messages you have retrieved from your input queue. This is not the same as the physical keyboard state:
When should you use and when should you use ?
For ...
Some people are offended by the special folders like "My Pictures" and "My Music" and delete them, only to find them being re-created. What's going on?
Windows itself is okay with you deleting those folders. Some corporations, for example, remove those folders from their employees' machines because they don't want the employees looking at picture...
There are several variations on the SendMessage function, but some are special cases of others.
The simplest version is SendMessage itself, which sends a message and waits indefinitely for the response.
The next level up is SendMessageTimeout which sends a message and waits for the response or until a certain amount of time has elapsed. Send...