Win32 API SetClipboardData - Printable Version +- QB64 Phoenix Edition (https://qb64phoenix.com/forum) +-- Forum: QB64 Rising (https://qb64phoenix.com/forum/forumdisplay.php?fid=1) +--- Forum: Code and Stuff (https://qb64phoenix.com/forum/forumdisplay.php?fid=3) +---- Forum: Help Me! (https://qb64phoenix.com/forum/forumdisplay.php?fid=10) +---- Thread: Win32 API SetClipboardData (/showthread.php?tid=1036) |
Win32 API SetClipboardData - Pete - 11-03-2022 @Spriggsy I tried to add a SetClipboardData to your WinAPI routine below, but no luck. No luck as in my addition of SetClipboardData caused the program to crash before the console even opened. I posted your routine below. Could it be modified so instead of just reading the present clipboard contents, it gets the highlighted text from the active window and adds that highlighted text to the clipboard? If that would be a PITA to code, just let me know and don't go to the trouble. What I'm looking for is an API alternative to using _SCREENPRINT CHR$(3) because in our IDE, if applied from another program, it doesn't copy the QB64 text, it just removes the highlighted text and leaves lowercase c in its place. Code: (Select All) ' Display Clipboard Contents by Spriggsy. Pete RE: Win32 API SetClipboardData - SpriggsySpriggs - 11-03-2022 To be honest, I don't remember much about this code. I made it a long time ago. I'd need to get familiar with it again. The peekpoke library is a bit unstable and I'm betting that's where the issue is coming from. I have better routines now that could be used instead. Not sure how quickly I can get back to you on this, though. RE: Win32 API SetClipboardData - mnrvovrfc - 11-03-2022 (11-03-2022, 12:00 PM)Pete Wrote: No luck as in my addition of SetClipboardData caused the program to crash before the console even opened.Because Freebasic has had no such functionality as "_CLIPBOARD$", a few years ago I tried my hand at a solution with Win32 API. It had to be text only, and it crashed periodically. It was infuriating. But could "_SCREENPRINT" yet do an "alt" key combination? If so could do [ALT][E] then "c" in the QB64PE IDE. Otherwise would have to figure out where the window is and "_SCREENCLICK" with the mouse to open the "Edit" menu and then "_SCREENPRINT" the "c". I know, getting complicated now. RE: Win32 API SetClipboardData - Pete - 11-03-2022 I love talking things out on a forum. I'm going to try a workaround with a SENDKEY altrnative. Now sure, that would just print the "c" to the screen just like _SCREENPRINT but mn gave reminded me of something I used to do before we had that keyword. Yes, I could open the menu but the good news is I don't have to rely on _SCREENCLICK anymore. What I'm going to take a shot at is using SENDKEY to open the QB64 IDE edit menu and then send the "c" selection to it. I have some stuff to do around the house first, and then I'll report back. @Spriggsy, my bet is you are doing other stuff this afternoon, so please don't bother yourself with this, as I'm pretty certain I can work this out now. Thanks +1 both! Pete RE: Win32 API SetClipboardData - Pete - 11-03-2022 Okay workaround works! Code: (Select All) ' To test have another QB64 IDE open and some text you want copied highlighted. Pete |