NO

Author Topic: IdeSpawn  (Read 4406 times)

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2113
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.
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • 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: 2113
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....).
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • 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: 2113
Re: IdeSpawn
« Reply #4 on: May 03, 2014, 12:31:48 PM »
Thanks  :)
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide

Offline jj2007

  • Member
  • *
  • Posts: 536
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.