Chat with Me -- HOST - Printable Version +- QB64 Phoenix Edition (https://qb64phoenix.com/forum) +-- Forum: Chatting and Socializing (https://qb64phoenix.com/forum/forumdisplay.php?fid=11) +--- Forum: General Discussion (https://qb64phoenix.com/forum/forumdisplay.php?fid=2) +--- Thread: Chat with Me -- HOST (/showthread.php?tid=1262) |
RE: Chat with Me -- HOST - Kernelpanic - 12-13-2022 (12-13-2022, 12:26 AM)SMcNeill Wrote: Try: Thanks! I tried it, but the program is not found there. RE: Chat with Me -- HOST - SMcNeill - 12-13-2022 Sounds like SHELL _HIDE _DONTWAIT might be what you want. RE: Chat with Me -- HOST - Kernelpanic - 12-13-2022 Quote:@mnrvovrfc - There should have been no need for "start" and "SHELL" should have been sufficient. The "start" is intended to ensure that when an external program is called, the program from which the call originates is not exited. At least that's what the manual for QuickC says. RE: Chat with Me -- HOST - Kernelpanic - 12-13-2022 (12-13-2022, 03:44 PM)SMcNeill Wrote: Sounds like SHELL _HIDE _DONTWAIT might be what you want. Thanks, that's it! - The wiki should really be published as a book. RE: Chat with Me -- HOST - Pete - 12-13-2022 (12-13-2022, 03:40 PM)Kernelpanic Wrote:(12-13-2022, 12:57 AM)Pete Wrote: Glad you got it working. SHELL is a bit fickle. As Steve pointed out, we have _HIDE and _DONTWAIT additions, whoich are pretty self-explanatory. _DONTWAIT is always needed with apps like Notepad. Without it, as you discovered, the program flow will not continue until the SHELL is closed, which means closing Notepad, Notepad++, etc. Now excluding _DONTWAIT is necessary if you need to suspend your program until action is taken in the app it opened. _HIDE prevents the cmd.exe console from appearing on the screen. Now here is where I call "fickle" on SHELL... I have had situations where adding _HIDE causes the SHELL to not function. I have had some other instances where I had to add "START" to make the SHELL function, too. So keep those in mind for future reference and fiddle with some different combinations and you might get your future SHELL statements to work if they initially fail. Oh, and if you are shelling to your own apps, try to avoid directories you make for them with spaces. Use dashes, instead. That cuts down on the work adding CHR$(34)'s in your SHELL calls. Pete RE: Chat with Me -- HOST - mnrvovrfc - 12-13-2022 (12-13-2022, 03:43 PM)Kernelpanic Wrote: Thanks! I tried it, but the program is not found there. This screenshot reveals all: the space is the culprit. It's what I've been trying to say but you guys were unaffected it seems. That's why I proposed the "PROGRA~1" or the other "outdated, internal 8-dot-3" name before the attempt was made instead from "D:\Programme". On Linux might have been able to do something like this: Code: (Select All) D:\'Program Files'\Notepad++\Notepad++.exe Incredibly, the stuff that prepares Wine and its related shortcuts doesn't do things this way, it creates a "dot-desktop" file that sometimes fails to launch the Windows app. So I have to get on top of it creating the "dot-desktop" file myself. (12-13-2022, 03:40 PM)Kernelpanic Wrote: Thank's for the Tipps! It even works with "Program Files" now, thanks Pete. The IP number is displayed and Notepad opens with the specified file. There are two peculiarities: Wait, did it work after all as D:\"Program Files"\... ?! (facepalm) Now I'm that long-eared critter that Sam wants to shoot down, do it now while I'm blindfolded... RE: Chat with Me -- HOST - Pete - 12-13-2022 It's fickle. Sometimes I get away with just enclosed quotes for the directory the space occurs in, sometimes I have to enclose the whole path in quotes. Just now... SHELL _HIDE _DONTWAIT "notepad " + cmd$ ' Didn't work for the app I am building, but SHELL _DONTWAIT "notepad " + cmd$ worked just fine! Sam's advice: Just keeps eh shootin' 'til ya's hits sometin, varmint! Pete RE: Chat with Me -- HOST - mnrvovrfc - 12-13-2022 (12-13-2022, 05:38 PM)Pete Wrote: SHELL _HIDE _DONTWAIT "notepad " + cmd$ ' Didn't work for the app I am building, but SHELL _DONTWAIT "notepad " + cmd$ worked just fine! But the following doesn't work? SHELL _HIDE _DONTWAIT "start notepad " + cmd$ It's because "HIDE" attribute is being involved, while in the other one that worked it has to display a "dummy" console window which is the launch pad. This was already indicated by Kernelpanic. To fire up an app such as Windows Notepad, "HIDE" should imply "DONTWAIT". I mean, the user would be fed up if the user program "suddenly" halts because he/she needs to quit some other program but he/she doesn't know it yet. How about using "_SHELLHIDE()" instead and checking out the value it returns? RE: Chat with Me -- HOST - Pete - 12-13-2022 The one you posted with START does work for me... Example: Code: (Select All) SHELL _HIDE _DONTWAIT "notepad" ' Doesn't launch. _HIDE causes the first one not to launch, but adding "start" in the second example allows it to launch Notepad. I'd like to buy the explanation that _HIDE prevents the cmd.exe console form launching an app, but I don't believe that is so, because... Code: (Select All) SHELL _HIDE _DONTWAIT "firefox" See? _HIDE with No "start" and Firefox launches where Notepad wouldn't. Fickle. Pete RE: Chat with Me -- HOST - SpriggsySpriggs - 12-13-2022 What are we trying to do here, gentlemen? I'm confused. |