|
Hi all
I'm newbe to platform invoke in C#.
I need to retrieve the text of an item in a Listbox.
I should send a SendMessage sending a LB_GETTEXT message
with lParam as as a Pointer to the buffer that will
receive the string.
I always used this declaration for SendMessage that worked until now.
[DllImport("user32.dll", SetLastError = true)]
public static extern IntPtr SendMessage( IntPtr hWnd,
uint Msg,
uint wParam,
int lParam );
My problem is that I need to past to lParam a pointer to a string
or a buffer.
I tried using casting or directly StringBuilder object but
without success.
Do you know why this happens and how to use
this SendMessage to retrive the string I need?
Regards
ManuStone
|
|
|
|
|
If you need to use it with StringBuilder, declare it like so:
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = false)]
static extern IntPtr SendMessage(HandleRef hWnd, uint Msg, IntPtr wParam, StringBuilder lParam);
See P/Invoke.NET[^] for more info.
|
|
|
|
|
|
Can anyone tell me how to use a wait cursor, while some file execution is going on?
Consider the case. I have to load some file to a datagrid, which takes say approximately 8 seconds.
during that period, I want to show a wait cursor, so that the user has an idea that something is going on. Please tell me an easy way to do this.
Thanks in advance
Keshav Kamat
India
|
|
|
|
|
Take a look at the Cursor class.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
thanks i got it.
Cursor.Current = Cursors.WaitCursor;
// do work
Cursor.Current = Cursors.Default;
Keshav Kamat
India
|
|
|
|
|
I'm using a dictionary object to store data but it seems that it can't be ordered by the key name. I assumed that a dictionary would be ordered by key somewhat like one of those book things that you look words up in, you know those hmmm, what's the word, oh, dictionary things.
Do i need to write my own collection to support this behaviour?
Russell
|
|
|
|
|
Take a look at the SortedDictionary class.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Thanks
I'd been searching for dicionary sort; sortable dictionary and hadn't found anything
SortedDictionary looks just the thing
Thanks again
Russell
|
|
|
|
|
hi, I've created an XSD
but i am unable to validate that,
please suggest/guide me HOW TO VALIDATE A XML
i am using VS2005 &C# for windows applciation.
Thnx in advance,
prashanth,
s/w Engineer,
Syfnosys.
|
|
|
|
|
Validating XML Data with XmlReader[^]
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
I have one dataSet ds and one dataTable dt. In want to fill the table from dataset:
sommething like that:
ds.Tables["tab1"].LoadDataFromTable(dt);
// LoadDataFromTable not exist
|
|
|
|
|
Hi
To assign to dataset from datatable, use this:
ds = dt.DataSet;
Harini
|
|
|
|
|
tks
i have found this:->
dset.Tables["tab1"].Merge(table);
|
|
|
|
|
use this
DataSet dataset = new DataSet();
dataset.Tables.Add("aaa");
adapter.Fill(dataset, "AAA"); // Fills table "aaa" because only one similarly named table is in the DataSet.
Keshav Kamat
India
|
|
|
|
|
assuming that u already have a data adapter in place.
Keshav Kamat
India
|
|
|
|
|
Hi,
I am not able to set focus on a tird party grid when I tab out of a text box control placed before the third party grid.
Please help
Regards,
Sivaprasad
|
|
|
|
|
Are you sure your tab order is correct. It could be if the tab order was changed your third party grid would get focus.
Hope that helps.
Ben
|
|
|
|
|
Hi,
I am using a third party data grid in my page...I am not able to set focus on the grid when I tab out from textbox control placed before the grid.Please help
Regards,
Sivaprasad
|
|
|
|
|
Hi,
I'm not a web expert (I suppose you're talking about web development), but how do you thing can focus a data grid ? It is not a control, it's just a table with bunch of labels, texboxes and links in it.
|
|
|
|
|
i am talking about a grid in my windows application....It has 3 - 4 cells in each row..I want the focus to be in the first cell of the first row
Regards,
Sivaprasad
|
|
|
|
|
Well, ok.
It's a third party datagrid. Do you have sourcecode that u can change to make it work your way? If yes, how do you know that the control doesn't have focus. It may have focus but if it is customly drawn it's proboble that it just doesn't change (visual side) when recieved focus. If you have sourcecode just override void OnGotFocus(EventArgs e) method and make it focus the first cell in the first row. That will cause, of course, allways when you click on that control focusing that cell. There is way to change it (i.e. if you dont want to put the focus on first cell when mouseclicked, only when tabbed). Anyway , do you have source code? If not i guess, there is not much u can do about it...
|
|
|
|
|
As u say 'It may have focus but if it is customly drawn it's proboble that it just doesn't change (visual side) when recieved focus.'
here I am losing the focus that means I am not able to get the fous on any control after the third party grid when I tab out
Regards,
Sivaprasad
|
|
|
|
|
first u told that u are not able to focus the grid, resp. first cell on the grid. now u telling that u are not able to pass focus further from the grid ? U cannot loose focus. It just somewhere (probobly on the grid and it is not displayed). But u haven't answered my question. Do you have source code?
|
|
|
|
|
I told that I am not able to focus on the grid, WHICH IS MY PROBLEM.
But u told that focus will be ther but we cant viwe it ...thatz y I told that if focus is there and we cant view it the focus should atleast pass to the next control after the grid when I tab out rite??
I hope u understood my probl;em
No I dont have the source code.
Regards,
Sivaprasad
|
|
|
|