|
Well, i don't know what the problem is. I pretty much did what you suggested but I used PostMessage as opposed to SendMessage . I have now tried your method also but its not killing the process.
I am making an assumption which could be the source of my problem - obtaining the handle to the process (the int Hdc parameter that is). I was assuming that I get the handle from the hProcess variable in the ProcessInfo class (the final parameter of the CreateProcess function. Was this assumption wrong perhaps? If so, how do I get the handle to the process that I want to send the message to?
Thanks again.
|
|
|
|
|
Hi,
SendMessage/PostMessage need a handle to a window, not a process.
CreateProcess returns a handle to the process created, so you still must translate
that into a window handle (maybe with GetMainWnd or something like that).
Greetings,
Luc Pattyn
|
|
|
|
|
Hi,
Can any body tell me
1. How can i programmatically get the instance name of SQL express on a system?
2. Sometimes we connect with SQL express using its instance name and on some systms we dont use the instance name, what is the difference between the two?
3.How can i adapt my Connectin String considering this situation? Below is the example
con.ConnectionString=".......Data Source=secb";
con.ConnectionString=".......Data Source=secb\\SQLExpress";
4. How can i enumerate only SQL Express instances on the local system?
Thanks in advance,
Wasif Ehsan.
|
|
|
|
|
There's an SqlEnumerator class or something named similar in one of the System.Data namespaces. I think it's under System.Data.Sql but it may be under the System.Data.SqlClient namespace.
I have no idea what I just said. But my intentions were sincere.
|
|
|
|
|
|
Hi All,
How can I select more than one subitem
of multiple items in a listview?
I need to do this when I click the subitems
by pressing CTRL, not by code.
Any suggestions would be greatly appreciated.
Thanks in advance,
Sarvan AL
|
|
|
|
|
Not possible in the standard Windows.Forms control AFAIK, try using the DataGridView or another ListView control. There are a couple available on CP.
I have no idea what I just said. But my intentions were sincere.
|
|
|
|
|
hi friends
can anyone plz guide me on the exception
An unhandled exception of type 'System.IndexOutOfRangeException' occurred in system.windows.forms.dll<br />
<br />
Additional information: Index was outside the bounds of the array.<br />
heres the code that gives me the exception
int count=4;<br />
int[] indice = new int[count]; <br />
MessageBox.Show(count.ToString());<br />
for(int i=0;i<count;i++)<br />
indice[i] = TableListBox.CheckedIndices[i];<--Exception<br />
return indice;
plz reply quickly
|
|
|
|
|
can you tell me what is this?
for(int i=0;i indice[i] = TableListBox.CheckedIndices[i];<--Exception
|
|
|
|
|
sorry about that i copied the incorrect code. the for loop looks like this
int count=4;<br />
int[] indice = new int[count]; <br />
for(int i=0;i<count;i++)<br />
{<br />
indice[i] = TableListBox.CheckedIndices[i]; <br />
}<br />
return indice;
TableList Box is a CheckedListBox.
what this loop does is takes the item on the selected index of the list box and stores it in another array.
|
|
|
|
|
check the size of TableListBox.it should not be greater than count
|
|
|
|
|
the size property of the listbox just gives its width and height.
what has that got to do with the exception??
|
|
|
|
|
i am not talking about the physical size.
i am talking about the count.
check during run time.just place a brek point in the for loop and see whether TableList[i] is not greater than TableList[count].
right??
|
|
|
|
|
I believe that your error is that there is less than 4 checked items in the Table listBox so when the compiler tries to go to (for example) index 4 it is not found and it is out of range.
try knowing how many items are checked before you initialize the other array and u do the for loop.
you can do this
<br />
int count = TableListBox.CheckedIndices.Count;<br />
and continue the rest of your code
|
|
|
|
|
i've already checked that the number of items selected in the listbox are 4 through
int count=TableListBox.CheckedIndices.Count;
approach.
but still it doesn't work. Any other suggestions???
|
|
|
|
|
Sorry,
i cann't see any error in the code you are providing.
Try providing us more information and maybe we can help
|
|
|
|
|
can this be due to the .Net Platform being corrupt?
i'm really confused
|
|
|
|
|
Is it the first time you develop on this Platform?
|
|
|
|
|
The odds of that are close to zero.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
thankyou for clearing that up
and YES this is my first project on this platform
|
|
|
|
|
paste the full code i will test and let u know
|
|
|
|
|
<br />
int count=4;<br />
int[] indice = new int[count];<br />
MessageBox.Show(count.ToString());<br />
for(int i=0;i<br />
indice[i] = TableListBox.CheckedIndices[i];<--Exception<br />
return indice;<br />
<br />
this is not C# coding
|
|
|
|
|
Why do you say that. (NB. the forum cut off everything after "for(int i=0;i" the line should have read "for(int i=0;i<count;i++)")
|
|
|
|
|
It is a good notice from you
But i didn't know that the forum cut that out.
Why don't u try to help that poor guy instead of loosing your time on unrelavent comments
|
|
|
|
|
<blockquote class="FQ"><div class="FQA">Saira Tanwir wrote:</div>plz reply quickly </blockquote>
This really bugs me. You're getting help for free, people will reply when they reply. No-one is 'on duty'
int count=4;
int[] indice = new int[count];
MessageBox.Show(count.ToString());
for(int i=0;i<count;i++)
indice[i] = TableListBox.CheckedIndices[i];<--Exception
return indice;
you need to check 'Ignore HTML tags in this message (good for code snippets) to post code with < in it. As I did.
Now, the issue is plainly that you don't have four checked indices. Why do you need to do this at all, why not just return the collection, or convert it to an array directly ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|