NO

Author Topic: IdeSpawn  (Read 1724 times)

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 1698
IdeSpawn
« on: April 27, 2014, 07:32:56 pm »
Hi Pelle,
thanks for the new release 3.
I would propose an upgrade for IdeSpawn.
Recently working with GUI/console programs I experienced a problem related to the hiding of the console window. In this case if the program terminates normally (without an ExitProcess directive) the IdeSpawn remain active in the background and have to be killed with the task manager.
Maybe it's not a big deal to add code to restore console window when the program ends.

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 1974
    • http://www.smorgasbordet.com
Re: IdeSpawn
« Reply #1 on: May 03, 2014, 11:46:10 am »
The console window was a big problem in the past, at least. Hence the use of idespawn, with additional support in the debugger. Some console functions have been added to the Windows API that may help, but I have to look at it. Windows XP may be problem too.
/Pelle

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 1698
Re: IdeSpawn
« Reply #2 on: May 03, 2014, 12:00:55 pm »
Thanks Pelle.
The console is a big issue indeed, my experimentation allocating a console from inside a GUI program gave very bad results, that's why I choosed the way around for my apps: start a console app then creates windows.  >:(
But in my case I deliberately hided the window to use console in GUI programs (mainly because printf and the like seems to be blocking I/O and this locks output and input when used in multithreaded envs).
So as first suggestion I just asked to add a ShowWindow call before printing the message "press any key..." to be sure that such a practice done by a beginner can lead to posts abuot bugs (i.e. Idespawn continues to run....).

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 1974
    • http://www.smorgasbordet.com
Re: IdeSpawn
« Reply #3 on: May 03, 2014, 12:16:07 pm »
I will look at it, but I can't promise anything.
/Pelle

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 1698
Re: IdeSpawn
« Reply #4 on: May 03, 2014, 12:31:48 pm »
Thanks  :)

Offline jj2007

  • Member
  • *
  • Posts: 506
Re: IdeSpawn
« Reply #5 on: May 03, 2014, 03:08:10 pm »
Just for fun: put this at the end, below WinMain's closing bracket:

#pragma comment(linker, "-subsystem:console")
int main(void) {
   WinMain(GetModuleHandle(0), 0, 0, SW_SHOW);
}


Test it with a printf("Hello"); in the WM_CREATE handler.