using the clipboard for communicatign between programs - Printable Version +- QB64 Phoenix Edition (https://staging.qb64phoenix.com) +-- Forum: QB64 Rising (https://staging.qb64phoenix.com/forumdisplay.php?fid=1) +--- Forum: Code and Stuff (https://staging.qb64phoenix.com/forumdisplay.php?fid=3) +---- Forum: Programs (https://staging.qb64phoenix.com/forumdisplay.php?fid=7) +---- Thread: using the clipboard for communicatign between programs (/showthread.php?tid=996) Pages:
1
2
|
using the clipboard for communicatign between programs - James D Jarvis - 10-22-2022 a simple example of using the clipboard to communicate between programs. This example requires three programs Clipmaster ,cliptalk1, and cliptalk2. Compile all three and save them in the same directory to see how this works. I almost certainly lifted the idea from somewhere else but I can't recall where, sorry if I'm failing to give proper credit. Clipmaster Code: (Select All) 'Clipmaster Cliptalk1 Code: (Select All) 'cliptalk1 cliptalk2 Code: (Select All) 'cliptalk2 RE: using the clipboard for communicatign between programs - Pete - 10-22-2022 Funny, I posted my clipboard routine to communicate to another program here: https://staging.qb64phoenix.com/showthread.php?tid=978&pid=8104#pid8104 I coded that for my buddy from Germany, so he could open up a second window and load a pic determined in the main program. It's a nice technique if you want to avoid setting up a communications database. There is a way to pipe contents using SHELL, too. I have that buried somewhere. I think maybe Spriggsy came up with that method at .rip. Now I could be wrong, but I see no reason for /RUN in the SHELL statements. The SHELL call itself runs the program. Fun stuff! Pete RE: using the clipboard for communicatign between programs - James D Jarvis - 10-22-2022 Oh that's good, I didn't even see that one because of the thread it was in. It is just such an easy method if you aren't too concerned about noise on the clipboard that could be thrown there by other programs. I have one somewhere in my directories where the program responds to a script sent to it from any text editing program because of the ease of reading the clipboard. I'm no shell guru I thought /run was needed if you hadn't declared the executable on some sort of path but I could of course be wrong there. EDIT: Just checked, yup doesn't need "/RUN" RE: using the clipboard for communicatign between programs - bplus - 10-22-2022 Sure beats using a common file to pass data back and forth between programs. I am wondering if I didn't use it for Tabulator, why? Clipboard is great resource. I like how Steve used as an option for Input, that could save a ton on typing. RE: using the clipboard for communicatign between programs - SpriggsySpriggs - 10-23-2022 Microsoft discourages usage of the clipboard in this manner but if it works for your specific purpose then nice. RE: using the clipboard for communicatign between programs - bplus - 10-23-2022 (10-23-2022, 08:36 PM)Spriggsy Wrote: Microsoft discourages usage of the clipboard in this manner but if it works for your specific purpose then nice. Did they give a reason to go along with discouragement? RE: using the clipboard for communicatign between programs - Pete - 10-23-2022 In the old days, we could just POKE what we wanted into memory. Now the professional way to do it is probably limited to using a database. I'm not surprised M$ doesn't endorse using the clipboard, because using other programs with copy will interfere with your QB64 app if it relies on constant communications with the clipboard. Pete RE: using the clipboard for communicatign between programs - James D Jarvis - 10-23-2022 Didn't there used to be a little spot in DOS memory called inter-program communication memory? It wasn't huge but it was likely not tampered with unless purposefully written into. Not a big deal in the before times. After windows however and there's all these different programs poking about. As for discouraging the clipboard being used in this matter it makes sense as any running program can copy into it and and destroy "vital" inter-program communication. But... haven't we all used a host of programs copying and pasting as part of the normal workflow and never had a big issue with info getting overwritten? RE: using the clipboard for communicatign between programs - SpriggsySpriggs - 10-23-2022 The official way that Microsoft recommends is to use TCP/IP. Which, luckily enough, is built-in with QB64. It's the same way that Fellippe does his InForm stuff. It shouldn't be hard for you to swap it in to your flow. RE: using the clipboard for communicatign between programs - Pete - 10-24-2022 It looks like you're trying to make an open host connection. Can I help? Well, Halloween is coming, so forgive me for channeling Clippy. On second though, douse me with Holly water, and call the fire dept. Anyway, compile both programs. Call the first one whatever you want, but name the second one Pete2.bas. Save and compile it as Pete2.exe before running the first (host) app, which SHELLs to Pete2.exe. Host - This is where you will make input choices. Code: (Select All) _SCREENMOVE 0, 0 Now the client window where your choices will be displayed... Code: (Select All) _SCREENMOVE 600, 0 Pete |