Hey everybody :) Im trying to copy the full content of a listbox to the clipboard and then open a notepad window with this content when the user press a button...
Can anyone help me at this?
Im trying something like this, how does it look so far?
case ID_COPYBUTTON:
int i;
char lbbuffer;
char tempbuffer;
int itens=SendMessage(hwndListBox01, LB_GETCOUNT, 0, 0);
for (i=0; i<=itens; i++) {
SendMessage(hwndListBox01, LB_GETTEXT, i, tempbuffer);
strcat(lbbuffer, tempbuffer);
}
//something here to send lbbuffer to windows clipboard
//something here to open a notepad window displaying lbbuffer
return 0;
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
That probably means that what i wrote on the first post is categorized as a beautiful example of pure crap...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2002-12-13
i don't think that's his intention ;)_
i think it's just that it's quite a bit more complicated than CopyTextToClipboard(buffer)...
for a quicker solution than waiting for mail-order, you might wanna try getting the win32api devpack for devcpp (which is just one big win32api reference help file), and use the help file's find tab to search for "clipboard" - it's beyond my current experience, but judging by your code snip, you appear to know your stuff; i'd suggest just looking through the reference info for OpenClipboard() and SetClipboardData() (as well as all the other functions and data types listed with those, and those listed when you click the Group button within either of those listings) as a place to start and go from there...
forewarning though, it mentions some weird juju involving memory allocation and locked handles and other such black (at least to me) arts... but if that's familiar territory, the rest should be cake.
good luck... and if you get some working code, would you mind posting it up here for posterity? i wouldn't mind seeing it in action myself... ;)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hey everybody :) Im trying to copy the full content of a listbox to the clipboard and then open a notepad window with this content when the user press a button...
Can anyone help me at this?
Im trying something like this, how does it look so far?
case ID_COPYBUTTON:
int i;
char lbbuffer;
char tempbuffer;
int itens=SendMessage(hwndListBox01, LB_GETCOUNT, 0, 0);
for (i=0; i<=itens; i++) {
SendMessage(hwndListBox01, LB_GETTEXT, i, tempbuffer);
strcat(lbbuffer, tempbuffer);
}
//something here to send lbbuffer to windows clipboard
//something here to open a notepad window displaying lbbuffer
return 0;
http://www.amazon.com/exec/obidos/tg/detail/-/157231995X/ref=bxgy_cc_img_a/102-5896736-9384912?v=glance&s=books
Kip
That probably means that what i wrote on the first post is categorized as a beautiful example of pure crap...
i don't think that's his intention ;)_
i think it's just that it's quite a bit more complicated than CopyTextToClipboard(buffer)...
for a quicker solution than waiting for mail-order, you might wanna try getting the win32api devpack for devcpp (which is just one big win32api reference help file), and use the help file's find tab to search for "clipboard" - it's beyond my current experience, but judging by your code snip, you appear to know your stuff; i'd suggest just looking through the reference info for OpenClipboard() and SetClipboardData() (as well as all the other functions and data types listed with those, and those listed when you click the Group button within either of those listings) as a place to start and go from there...
forewarning though, it mentions some weird juju involving memory allocation and locked handles and other such black (at least to me) arts... but if that's familiar territory, the rest should be cake.
good luck... and if you get some working code, would you mind posting it up here for posterity? i wouldn't mind seeing it in action myself... ;)