Click here to Skip to main content
15,899,124 members
Home / Discussions / C#
   

C#

 
AnswerRe: Show a hidden console again? Pin
V.15-Sep-11 23:16
professionalV.15-Sep-11 23:16 
GeneralRe: Show a hidden console again? Pin
Don Rolando15-Sep-11 23:18
Don Rolando15-Sep-11 23:18 
GeneralRe: Show a hidden console again? Pin
V.15-Sep-11 23:37
professionalV.15-Sep-11 23:37 
GeneralRe: Show a hidden console again? Pin
Don Rolando16-Sep-11 0:23
Don Rolando16-Sep-11 0:23 
GeneralRe: Show a hidden console again? Pin
V.16-Sep-11 0:36
professionalV.16-Sep-11 0:36 
GeneralRe: Show a hidden console again? Pin
Don Rolando16-Sep-11 0:47
Don Rolando16-Sep-11 0:47 
AnswerRe: Show a hidden console again? Pin
Alan N16-Sep-11 3:04
Alan N16-Sep-11 3:04 
GeneralRe: Show a hidden console again? Pin
Don Rolando16-Sep-11 3:19
Don Rolando16-Sep-11 3:19 
Hi Alan,
thanks for your reply!

At the moment I really make use of a combination of EnumWindows and GetWindowThreadProcessId to get my own (hidden) window's handle within the console application. But I am not happy about enumerating over all windows.

FindWindow was also my first thought... the problem was that I had no clue what the title is. The shell usually shows the console application's full path in the title. Having multiple instances running, this can be quite difficult to find a specific one.

But you made me think about the window title again, because you really hardcoded a title for a console application. First I thought I could not change it from within the console application itself in C#, since MainWindowTitle is read-only. But then I found the following API method:
[DllImportAttribute("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)] 
public static extern bool SetConsoleTitle(IntPtr lpConsoleTitle);


In this case I can easily set the window title; either by passing it as parameter along with ProcessStartInfo, or simply generating it within the console itself.


Thanks for thought-provoking impulse. Smile | :)


Cheers,
Roland
AnswerRe: Show a hidden console again? Pin
PIEBALDconsult16-Sep-11 3:19
mvePIEBALDconsult16-Sep-11 3:19 
GeneralRe: Show a hidden console again? Pin
Don Rolando16-Sep-11 3:22
Don Rolando16-Sep-11 3:22 
QuestionDataGridView throws Data Pin
beauroak15-Sep-11 15:15
beauroak15-Sep-11 15:15 
AnswerRe: DataGridView throws Data Pin
Luc Pattyn15-Sep-11 15:29
sitebuilderLuc Pattyn15-Sep-11 15:29 
Questionretrive gridview cell value Pin
jashimu15-Sep-11 9:55
jashimu15-Sep-11 9:55 
AnswerRe: retrive gridview cell value Pin
walterhevedeich15-Sep-11 15:56
professionalwalterhevedeich15-Sep-11 15:56 
Questionhow to write regular expression for this code? Pin
SRKSHOME15-Sep-11 6:48
SRKSHOME15-Sep-11 6:48 
AnswerRe: how to write regular expression for this code? Pin
BillWoodruff15-Sep-11 7:33
professionalBillWoodruff15-Sep-11 7:33 
GeneralRe: how to write regular expression for this code? Pin
SRKSHOME15-Sep-11 19:43
SRKSHOME15-Sep-11 19:43 
AnswerRe: how to write regular expression for this code? Pin
OriginalGriff15-Sep-11 8:26
mveOriginalGriff15-Sep-11 8:26 
GeneralRe: how to write regular expression for this code? Pin
PIEBALDconsult15-Sep-11 9:10
mvePIEBALDconsult15-Sep-11 9:10 
GeneralRe: how to write regular expression for this code? Pin
OriginalGriff15-Sep-11 9:15
mveOriginalGriff15-Sep-11 9:15 
GeneralRe: how to write regular expression for this code? Pin
BillWoodruff15-Sep-11 21:42
professionalBillWoodruff15-Sep-11 21:42 
GeneralRe: how to write regular expression for this code? Pin
BillWoodruff15-Sep-11 21:43
professionalBillWoodruff15-Sep-11 21:43 
GeneralRe: how to write regular expression for this code? Pin
SRKSHOME15-Sep-11 20:21
SRKSHOME15-Sep-11 20:21 
GeneralRe: how to write regular expression for this code? Pin
Pete O'Hanlon15-Sep-11 20:32
mvePete O'Hanlon15-Sep-11 20:32 
GeneralRe: how to write regular expression for this code? Pin
SRKSHOME15-Sep-11 21:03
SRKSHOME15-Sep-11 21:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.