I have a console application in Delphi that I start with another application this way:
FillChar(ExecInfo, SizeOf(ExecInfo), 0);
With ExecInfo Do Begin
cbSize := SizeOf(ExecInfo);
fMask := SEE_MASK_NOCLOSEPROCESS or SEE_MASK_NOASYNC;
Wnd := GetActiveWindow();
lpVerb := PChar('runas');
lpFile := PChar(FsCurrentPath + 'Install\Install_Elevated.exe');
lpDirectory := PChar(FNew.sBinDir);
lpParameters := PChar(sl.DelimitedText);
nShow := SW_HIDE
End;
ShellExecuteEx(@ExecInfo);
In some state, I would like to show that it is displayed (accept in SW_SHOWNORMAL state). How can i do this?
Thus, it does not show:
ShowWindow(GetConsoleWindow, SW_SHOW);
Not even that:
BringWindowToTop(GetConsoleWindow);
SetActiveWindow(GetConsoleWindow);
SetForegroundWindow(GetConsoleWindow);
ShowWindow(GetConsoleWindow, SW_SHOW)
But it manifests itself like this:
MessageBox(GetConsoleWindow, PChar(IntToStr(GetConsoleWindow)), PChar(''), MB_SETFOREGROUND);
ShowWindow(GetConsoleWindow, SW_SHOW);
But of course I do not want this message box.
What is the problem?
source
share