I have created a network application that unifies the clipboards of multiple computers over a network, it will even detect URL links clicked on and mailto: links clicked on and run the associated program on another computer if you want it to, as well as many other advanced options... now my problem is this...
It currently only deals with text data, I need it to also use File data, like when copying and pasting a file in windows explorer.
When a user presses Ctrl-C to copy a file in windows explorer, I need to parse the file name and reformat it to the appropriate name over the network, the reformatting part is easy (it'd be even easier if I knew a function to get the name of the computer on the workgroup automatically), but the accessing of the clipboard file name is tougher. I need to figure out how to do that, as well as how to SET the new file name to the IDataObject(or other format if so), it needs to do this without effecting the data currently on the clipboard, basically, make a clone of the data object and edit it, then send the cloned data over the network.
As far as sending it over the network, I believe I can use:
SendBuf(&MyIDataObject, sizeof(MyIDataObject));
I'll have to transfer the data itself, not just the pointer, of course.
Then I just retrieve the data on the other end call OleSetClipboard...
If the IDataObject contains pointers in itself, then this probably wouldn't work unless the pointers weren't necessary to access and weren't accessed in this case.
I believe when copying a file in windows explorer it just copies the file name, and has nothing to do with the data in the file itself.
So the other way which is what I was trying to do in the first place, was to get the name of the file(s) on the clipboard, reformat them of course, send them over the network, and then when I retrieve them, I use the file names to create a new IDataObject if needed, and/or set the data to the clipboard.
The clipboard format seems to be of type CF_HDROP.
I would really appreciate any ideas, input, code, advice, or anything that might help me do this. Maybe there is a workaround to it that I'm not seeing...
Also, I would like to add the ability to the client machines to not have to specify an IP address of the server if they didn't know it or didn't want to, or if the server had a dynamic IP address. It would probably have to get a list of available IPs on the network and go through one by one trying to connect to the server. I need the code to get this list if possible.
Thank you for any and all help.
Chris
It currently only deals with text data, I need it to also use File data, like when copying and pasting a file in windows explorer.
When a user presses Ctrl-C to copy a file in windows explorer, I need to parse the file name and reformat it to the appropriate name over the network, the reformatting part is easy (it'd be even easier if I knew a function to get the name of the computer on the workgroup automatically), but the accessing of the clipboard file name is tougher. I need to figure out how to do that, as well as how to SET the new file name to the IDataObject(or other format if so), it needs to do this without effecting the data currently on the clipboard, basically, make a clone of the data object and edit it, then send the cloned data over the network.
As far as sending it over the network, I believe I can use:
SendBuf(&MyIDataObject, sizeof(MyIDataObject));
I'll have to transfer the data itself, not just the pointer, of course.
Then I just retrieve the data on the other end call OleSetClipboard...
If the IDataObject contains pointers in itself, then this probably wouldn't work unless the pointers weren't necessary to access and weren't accessed in this case.
I believe when copying a file in windows explorer it just copies the file name, and has nothing to do with the data in the file itself.
So the other way which is what I was trying to do in the first place, was to get the name of the file(s) on the clipboard, reformat them of course, send them over the network, and then when I retrieve them, I use the file names to create a new IDataObject if needed, and/or set the data to the clipboard.
The clipboard format seems to be of type CF_HDROP.
I would really appreciate any ideas, input, code, advice, or anything that might help me do this. Maybe there is a workaround to it that I'm not seeing...
Also, I would like to add the ability to the client machines to not have to specify an IP address of the server if they didn't know it or didn't want to, or if the server had a dynamic IP address. It would probably have to get a list of available IPs on the network and go through one by one trying to connect to the server. I need the code to get this list if possible.
Thank you for any and all help.
Chris