Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

HDROP issue

Posted on 2006-04-02
2
Medium Priority
?
233 Views
Last Modified: 2013-11-20
Hi,

I currently have some code triggered on the DrawClipboard event that looks for copied files in the clipboard format of HDROP, the code works great except for one problem; when my app is running and I copy a file in a folder using CTRL+C the code is triggered and then when I close the folder window because Im done copying my code is triggered again causing a duplicate copy. My question is, does closing a window after a copy usually trigger a DrawClipboard event? I didnt include any code but can if you think its a problem with my code. This is driving me crazy because I have no idea how to stop the duplicate entries.
0
Comment
Question by:rushtheweb
  • 2
2 Comments
 
LVL 22

Expert Comment

by:mahesh1402
ID: 16357858
Each window that receives an OnDrawClipboard call should call the SendMessage Windows function to pass a WM_DRAWCLIPBOARD message on to the next window in the Clipboard-viewer chain. The handle of the next window is returned by the SetClipboardViewer member function; it may be modified in response to an OnChangeCbChain member function call.

Also Each CWnd object that receives an OnChangeCbChain call should use the SendMessage Windows function to send the WM_CHANGECBCHAIN message to the
next window in the Clipboard-viewer chain (the handle returned by SetClipboardViewer). If hWndRemove is the next window in the chain, the window specified by hWndAfter becomes the next window, and Clipboard messages are passed on to it.  Look at ChangeClipboardChain() and SetClipboardViewer().

MAHESH


0
 
LVL 22

Accepted Solution

by:
mahesh1402 earned 2000 total points
ID: 16357893
Also consider each message to indicate a change, unconditionally. Programs like Word often put stuff on the clipboard with delayed rendering ,the actual data
is only provided when some app asks for it. When they close they copy the actual data to the clipboard to it stays available after the app has gone away,hence the message.

MAHESH
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question