Author Topic: Black Window Pop-up when starting application  (Read 707 times)

0 Members and 1 Guest are viewing this topic.

Offline IronMan

  • Newbie
  • Posts: 38
Black Window Pop-up when starting application
« on: May 31, 2020, 11:51:35 pm »
I am trying to call another Windows application by using the SHELL command from within a QB64 application. It all works just fine with the exception of it displaying a BLACK WINDOW when application starts just before running the SHELL command.

Is there a way to not show or hide the default screen when a QB64 app first runs. It only display for a second, but because this small application is running another windows application using the SHELL command, it flashes the black window on the screen first.


Basically the code is:

_SCREENHIDE
SHELL _HIDE "PROGRAM.EXE"
END


Everything works perfect for what I'm needing to do except the black pop-up windows when the program starts.



Any help is appreciated.

Thank you.
Kent

Offline RhoSigma

  • QB64 Developer
  • Forum Resident
  • Posts: 565
Re: Black Window Pop-up when starting application
« Reply #1 on: June 01, 2020, 04:40:30 am »
My Projects:   https://qb64forum.alephc.xyz/index.php?topic=809
GuiTools - A graphic UI framework (can do multiple UI forms/windows in one program)
Libraries - ImageProcess, StringBuffers (virt. files), MD5/SHA2-Hash, LZW etc.
Bonus - Blankers, QB64/Notepad++ setup pack

Marked as best answer by IronMan on June 01, 2020, 04:50:57 am

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
Re: Black Window Pop-up when starting application
« Reply #2 on: June 01, 2020, 05:05:19 am »
LOL
Quote
Why do you keep asking same question again?

seriously
Yes the suggestion of RhoSigma is right

https://www.qb64.org/forum/index.php?topic=2406.msg116262#msg116262

see here my code on that track
Code: QB64: [Select]
  1. SHELL _DONTWAIT "notepad.exe"
  2. SCREEN _NEWIMAGE(600, 600, 32)
  3. CLS , _RGB(17, 194, 50, 255)
  4. PRINT "hello"
  5.  
  6.  
no starting black window before notepad appears on the screen on my old TOSHIBA i3 4GB Ram
Programming isn't difficult, only it's  consuming time and coffee

Offline IronMan

  • Newbie
  • Posts: 38
Re: Black Window Pop-up when starting application
« Reply #3 on: June 01, 2020, 08:35:42 am »
Why do you keep asking same question again?
https://www.qb64.org/forum/index.php?topic=2406.msg116251#msg116251

Perhaps because I have failed yet to get it to work like I need it to. Am I missing something? Is this forum not the place where we share and ask for help? Perhaps I'm confused.....

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • Steve’s QB64 Archive Forum
Re: Black Window Pop-up when starting application
« Reply #4 on: June 01, 2020, 11:28:55 am »
If I were to guess, I'd say your second program is the one creating that initial black window as it loads.

If the program you're SHELLing to is written in QB64, add an command line option to have it hide itself upon startup.

In your second program, which you'll shell to, use something like this:

$SCREENHIDE
IF COMMAND$ <> "-H" THEN_SCREENSHOW


Then, in your program which calls the shell, call it with:

SHELL_HIDE "PROGRAM.EXE -H"
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline IronMan

  • Newbie
  • Posts: 38
Re: Black Window Pop-up when starting application
« Reply #5 on: June 01, 2020, 02:26:45 pm »
WORKING!!!!  Thanks for all the help. I as using _SCREENHIDE instead of $SCREENHIDE.

Everything working great..

Thank you.
Kent