Open Borph opened 7 years ago
You misunderstood the meaning of DefTerm! The feature allows users to run children console applications in ConEmu automatically. But you are talking about creation of console window in existing process / existing GUI application. Your app was already started outside of ConEmu and perhaps created some visible windows, doesn't it?
It's started from devenv.exe, but when from inside ConEmu it doesn't open the console window, I guess due to the check (hOut == NULL). Still no output then :-( Yes, it first opens the GUI window. I'm asking because Issue#55 suggested the DefaultTerminal feature!
Ok, I'll fix it
Today I got it working, the app had the console in ConEmu automatically, but strangely it stopped again. Not sure why, I updated ConEmu to 161009a and rebased the app as well. Now the default terminal appears again :-( Will have a look in Git.
My program is doing something like the following:
I have enabled DefaultTerm feature in settings and also see the DLL loaded in that process:
C:\Users\user\AppData\Local\ConEmu\ConEmuHk.161002.dll
.Still, the application opens the default terminal window. I can go to ConEmu and attach to that process, though, but this also doesn't work always (don't know why).
I'm not owning above code, just used the fact that I have the source to find the AllocConsole(). Any hint why hooking doesn't open ConEmu automatically?
Versions
ConEmu build: 161002 stable x64 OS version: Windows 7 x64 Used shell version: git-bash (of git 2.10.0.windows.1)
ConEmuLogs/sys.exe-1552.log
2016-10-05 16:00:39.902 ConEmu 161002[32] log 16:00:39.913 "D:...\sys.exe" 16:00:39.916 DefTerm[1552]: InitDefaultTerm finished, calling StartDefTerm 16:00:39.948 DefTerm[3792]: CheckForeground x00010154 <<== trying to set hooks 16:00:39.948 DefTerm[3792]: "C:\Program Files\ConEmu\ConEmu\ConEmuC64.exe" /DEFTRM=3792 16:00:39.969 DefTerm[3792]: Service process PID=6064 started 16:00:39.981 DefTerm[3792]: Service process PID=6064 finished with code=144 16:00:39.981 DefTerm[3792]: CheckForeground x00010154 <<== nResult=144 iHookerRc=0