Click here to Skip to main content
15,891,777 members
Home / Discussions / C#
   

C#

 
GeneralRe: How can I disallow SelectedValue to be -1 in a ComboBox? Pin
OriginalGriff25-Apr-14 5:04
mveOriginalGriff25-Apr-14 5:04 
GeneralRe: How can I disallow SelectedValue to be -1 in a ComboBox? Pin
arnold_w25-Apr-14 5:20
arnold_w25-Apr-14 5:20 
GeneralRe: How can I disallow SelectedValue to be -1 in a ComboBox? Pin
OriginalGriff25-Apr-14 6:00
mveOriginalGriff25-Apr-14 6:00 
Questionadd picturebox to panel from a dll file at design time Pin
Member 1059256824-Apr-14 23:25
Member 1059256824-Apr-14 23:25 
AnswerRe: add picturebox to panel from a dll file at design time Pin
Eddy Vluggen25-Apr-14 4:00
professionalEddy Vluggen25-Apr-14 4:00 
QuestionC# unable to get handle when multiple instances of app are open in windows 8.1 Pin
RRLCoder24-Apr-14 19:11
RRLCoder24-Apr-14 19:11 
QuestionRe: C# unable to get handle when multiple instances of app are open in windows 8.1 Pin
Eddy Vluggen25-Apr-14 4:01
professionalEddy Vluggen25-Apr-14 4:01 
AnswerRe: C# unable to get handle when multiple instances of app are open in windows 8.1 Pin
RRLCoder25-Apr-14 6:44
RRLCoder25-Apr-14 6:44 
This is a bit long but shows most of what i've tried
//typical prcess start
	string ProcToStart = "iexplore";
	int saveProcId;
	
	Process myProcess = new Process();
	myProcess.StartInfo.FileName = TargetFile;
	myProcess.StartInfo.Arguments = TargetArguments;
    	myProcess.StartInfo.UseShellExecute = true;  //seems to make no difference
	myProcess.Start();
	saveProcId = myProcess.Id;
		
1-the simple approach, just trying to access myProcess.MainWindowHandle gets 0 even after a 10 min sleep

2--here is one method looping through all processes
I also tried this wraped in:  while (proc.MainWindowHandle == IntPtr.Zero) (ran forever & didnt find a hit)....
    foreach (Process proc in Process.GetProcesses())
    {
        if (proc.Id == saveProcId)
        { 
	    Console.WriteLine(" PID: " + proc.Id + "    Handle:  " + proc.MainWindowHandle);
	}
    }

3--Here is another attempt using ....GetProcessById
		try
		{
			ChosenProc = Process.GetProcessById(ProcId);
			Console.WriteLine("Your Process Info: " );
			Console.WriteLine("  Id: " + ChosenProc.Id
				+ "  Handle: " + ChosenProc.Handle
				+ "  MainWinHndl: " + ChosenProc.MainWindowHandle
				+ "  Name: " + ChosenProc.ProcessName);
			return true;
		}
		catch
		{
			ChosenProc = null;
			Console.WriteLine("Incorrect entry.");
			return false;
		}

GeneralRe: C# unable to get handle when multiple instances of app are open in windows 8.1 Pin
Eddy Vluggen27-Apr-14 9:00
professionalEddy Vluggen27-Apr-14 9:00 
GeneralRe: C# unable to get handle when multiple instances of app are open in windows 8.1 Pin
RRLCoder27-Apr-14 10:49
RRLCoder27-Apr-14 10:49 
QuestionMute other applications Pin
el_stupey24-Apr-14 15:40
el_stupey24-Apr-14 15:40 
AnswerRe: Mute other applications Pin
Mycroft Holmes24-Apr-14 16:17
professionalMycroft Holmes24-Apr-14 16:17 
GeneralRe: Mute other applications Pin
el_stupey26-Apr-14 1:39
el_stupey26-Apr-14 1:39 
AnswerRe: Mute other applications Pin
Eddy Vluggen25-Apr-14 3:53
professionalEddy Vluggen25-Apr-14 3:53 
GeneralRe: Mute other applications Pin
el_stupey26-Apr-14 1:46
el_stupey26-Apr-14 1:46 
Questionhow to edit in crystal report Pin
Er Aslam Khan23-Apr-14 22:33
Er Aslam Khan23-Apr-14 22:33 
AnswerRe: how to edit in crystal report PinPopular
Chris Quinn23-Apr-14 22:59
Chris Quinn23-Apr-14 22:59 
AnswerRe: how to edit in crystal report Pin
Keith Barrow24-Apr-14 3:09
professionalKeith Barrow24-Apr-14 3:09 
AnswerRe: how to edit in crystal report Pin
thatraja24-Apr-14 21:09
professionalthatraja24-Apr-14 21:09 
AnswerRe: how to edit in crystal report Pin
Mycroft Holmes24-Apr-14 21:57
professionalMycroft Holmes24-Apr-14 21:57 
AnswerRe: how to edit in crystal report Pin
V.25-Apr-14 2:00
professionalV.25-Apr-14 2:00 
QuestionWndProc related issue in win apps c# Pin
Tridip Bhattacharjee23-Apr-14 20:55
professionalTridip Bhattacharjee23-Apr-14 20:55 
QuestionRe: WndProc related issue in win apps c# Pin
Eddy Vluggen23-Apr-14 21:46
professionalEddy Vluggen23-Apr-14 21:46 
AnswerRe: WndProc related issue in win apps c# Pin
Tridip Bhattacharjee24-Apr-14 0:25
professionalTridip Bhattacharjee24-Apr-14 0:25 
GeneralRe: WndProc related issue in win apps c# Pin
Eddy Vluggen24-Apr-14 1:20
professionalEddy Vluggen24-Apr-14 1:20 

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.