Chat App / Messenger - 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: Chat App / Messenger (/showthread.php?tid=1251) Pages:
1
2
|
Chat App / Messenger - Pete - 12-09-2022 This is a TCP/IP routine. Windows users will need to Okay it, on the first run, with Windows Defender. I posted two versions. The first minimizes and restores the chat window to activate it. The second uses QB64 _SCREENCLICK. auto-activation allows us to continuously send messages back and forth without clicking the window each rotation. Sorry Linux and mac users, I tried, but to return focus to each active chat window requires one Win32 API command to restore the window, and mn pointed out that _SCREENCLICK isn't supported in these operating systems. If anyone can figure out a QB64 way to force a minimized window back to the desktop, please let me know. So to gives this a try, you need to copy and run both the "host" and client" programs. Since the host starts the client, you will need to name the client as messenger_client.bas and save it as messenger_client.exe before you run the host program. Min/Restore Version Host Code: (Select All) DECLARE DYNAMIC LIBRARY "user32" Client (Remember, name and save this one as messenger_client.exe). Code: (Select All) DECLARE DYNAMIC LIBRARY "user32" This project is slightly modified from my October 28th post at The QBasic Forum: https://www.tapatalk.com/groups/qbasic/tired-of-talking-to-yourself-all-day-now-you-can-m-t39735.html That one used all Win32 API to find, minimize and restore the window. If you are interested in seeing the extra API stuff, check it out. Also, I play loose and fast with the API type variables. So far I've only been stung once by changing an _OFFSET to a LONG. Most of the time you can get away from convention. Oh, why bother minimizing and restoring? Well, so far none of us can figure out a way to get a window not just in focus, but active and in focus after another window is made active. Spriggsy and I both came up with the min/restore trick at the same time, which was pretty funny. Okay, for Linus and Mac fans... (And yes, I made _SCREENCLICK 'smart' so you can move the windows around). _SCREENCLICK Version: Same App, but uses _SCREENCLICK instead of Win32 API to activate each window. Host Code: (Select All) _SCREENMOVE 0, 0 Client (Name as messenger_client.exe). Code: (Select All) title$ = "Messenger_Client" Pete RE: Chat App / Messenger - mnrvovrfc - 12-09-2022 It will have to be your program for Windows with Wine because "_SCREENCLICK" isn't implemented on Unix-like operating systems. It's the penultimate line of both programs you presented in your previous post. RE: Chat App / Messenger - Pete - 12-09-2022 LOL at Unix Like AKA Linux. like-unix = l-unix, which is an anagram for linux. So now I wonder if it was actually named after Linus Torvalds and this is just a coincidence. Anyway, back on topic, I just checked the Wiki, and there it is... "Keyword not supported in Linux or macOS versions" Well I edited the post to just a second version using _SCREENCLICK. Off the top of my head, I can't think of a method that would work to activate a Linux or MacOS window with QB64, but if I come up with one, I'll double check the Wiki, first. Thanks! Pete RE: Chat App / Messenger - mnrvovrfc - 12-09-2022 (12-09-2022, 04:20 PM)Pete Wrote: LOL at Unix Like AKA Linux. like-unix = l-unix, which is an anagram for linux. So now I wonder if it was actually named after Linus Torvalds and this is just a coincidence."Linux" was supposed to be the name of only the kernel. But people insisted so much on that word for the whole operating system, including the parts Mr. Torvalds had nothing to do with and that he had criticized in the past, and some distros made a "style" out of being just "Linux" instead of "GNU/Linux". There's for example "Debian GNU/Linux" but "Fedora Linux". The distro-maker, guided somewhat by legalese (FSF enough said), chooses what their creation is to be called. RE: Chat App / Messenger - Pete - 12-09-2022 Well I posted a challenge to see if anyone has or can come across a substitute method of activating a window in Linux/Mac systems. https://staging.qb64phoenix.com/showthread.php?tid=1254 Pete RE: Chat App / Messenger - vince - 12-10-2022 I'm curious, with team Steve in charge, is there any kind of overarching vision upheld by discipline when it comes to multi-platform (linux/mac/etc) or is it anything goes these days? Any more than say QB64 implementing QB45 on windows Vista onwards RE: Chat App / Messenger - Pete - 12-10-2022 Yes, the bar closes at 12. Pete RE: Chat App / Messenger - vince - 12-10-2022 thanks for reminding me, I sometimes forget this is a bar and not a strip club with Steve prancing about RE: Chat App / Messenger - Pete - 12-10-2022 Yeah the nurses weren't too happy with him, either, when he kept putting on his hospital gown backwards. Pete RE: Chat App / Messenger - vince - 12-10-2022 oh yeah, that's an old trick from Steve to keep you from sticking to the chair (or is it the other way around?) |