www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Clipboard Tinkering - clipboard.d

reply Kevin Laborda <Kevin_member pathlink.com> writes:
I'm working on a project of mine which does the following (don't ask why... it's
for a game):
1. Grabs an HTML page
2. Parses it with RegExp to obtain specific data.
3. Writes the data to a file.

Now, I want to add a feature which automatically sets the clipboard to this
specific data.  The data is stored as-- char[] data.  I've attached some "code"
which tries to set data to the clipboard (function from "Matthew").  Yet,
OpenClipboard isn't working right, so I assume HWND needs to be set properly.
This leads to my question:  how do I get HWND set properly so this will work?
Jul 08 2006
next sibling parent "Andrew Fedoniouk" <news terrainformatica.com> writes:
"Kevin Laborda" <Kevin_member pathlink.com> wrote in message 
news:e8onuu$161a$1 digitaldaemon.com...
 I'm working on a project of mine which does the following (don't ask 
 why... it's
 for a game):
 1. Grabs an HTML page
 2. Parses it with RegExp to obtain specific data.
 3. Writes the data to a file.

 Now, I want to add a feature which automatically sets the clipboard to 
 this
 specific data.  The data is stored as-- char[] data.  I've attached some 
 "code"
 which tries to set data to the clipboard (function from "Matthew").  Yet,
 OpenClipboard isn't working right, so I assume HWND needs to be set 
 properly.
 This leads to my question:  how do I get HWND set properly so this will 
 work?

You can use NULL as HWND in clipboard functions. See: module harmonia.ui.exchange.clipboard; module harmonia.ui.native.win32exchange; http://harmonia.terrainformatica.com
Jul 08 2006
prev sibling parent reply Stewart Gordon <smjg_1998 yahoo.com> writes:
Kevin Laborda wrote:
 I'm working on a project of mine which does the following (don't ask why...
it's
 for a game):
 1. Grabs an HTML page
 2. Parses it with RegExp to obtain specific data.
 3. Writes the data to a file.
 
 Now, I want to add a feature which automatically sets the clipboard to this
 specific data.  The data is stored as-- char[] data.  I've attached some "code"
 which tries to set data to the clipboard (function from "Matthew").  Yet,
 OpenClipboard isn't working right, so I assume HWND needs to be set properly.
 This leads to my question:  how do I get HWND set properly so this will work?

http://tinyurl.com/ghalp The argument passed to OpenClipboard must be a handle of a window, not an application instance. Since you have no window, just set it to null. Stewart.
Jul 11 2006
parent Stewart Gordon <smjg_1998 yahoo.com> writes:
Stewart Gordon wrote:
<snip>
 http://tinyurl.com/ghalp

I've just realised the link I've given you is for Windows CE! (Has anyone managed to build GDC on WinCE, FTM?) Still, here's the regular Win32 version, which is the same in this respect.... http://tinyurl.com/p6w6k Stewart.
Jul 11 2006