Thank you!
nc3b
Posts
-
Get text from the focused control in another window -
Get text from the focused control in another windowAnd then "hwndFocus" will contain the hwnd of the curently focused control? Thanks!
-
Get text from the focused control in another windowCan you please give an example? Suppose I have a HWND of a window (GetForegroundWindow()) and wnat to get it's focused child. How would I do that? Thank you.
-
Get text from the focused control in another windowYes, it's in a different program.
-
Get text from the focused control in another windowHello. I have the hwnd of another window and I am trying to get the text. I know how to get text from another window (WM_GETTEXT) but I don't know hot to get the text from the currently focused control in that window. Unfortunately GetFocus() won't work so I am out of ideas.. I would even try using EnumChildWindows, but I don't know how to find out if a particular control is focused. Can anybody help? Thank you in advance.
-
error in file 38592 -
Problem with getting string from bytesI might as well archive the project and attach it :laugh: But anyways. I don't mind:)
private System.Byte[] buffer=new Byte[1024]; private void SetupReceiveCallback(Socket _sock) { AsyncCallback receive=new AsyncCallback(OnReceive); _sock.BeginReceive(buffer,0,buffer.Length,SocketFlags.None,receive,_sock); } private void OnReceive(IAsyncResult result) { try { Socket _sock=(Socket)result.AsyncState; int stop=_sock.EndReceive(result); String str=System.Text.Encoding.ASCII.GetString(buffer,0,stop); MessageBox.Show(str); process(buffer,stop); SetupReceiveCallback(_sock); } catch { MessageBox.Show("Out"); this.Close(); } }
So? :laugh: -
Problem with getting string from bytesThe thing is that it's a lot of code.. Anyways, let's see... :) The BeginReceive
sock.BeginReceive(buffer,0,buffer.Length,SocketFlags.None,receive,_sock);
The EndReceiveint stop=_sock.EndReceive(result);
Is it not correct? :confused: -
Problem with getting string from bytesBut I already showed more than enough. Since I am able to transmit messages between the server and the client THERE IS NO PROBLEM HERE. Anyway, the server uses fprintf and the client uses BeginReceive - EndReceive (IAsync bla bla). The problem is the way I am handling the array of bytes coming from the server. I suspect EndReceive thinks that a 0 means \0 (as in end of string). So it stops there. I don't know why this happens..
-
Problem with getting string from bytesOkay then. Here is the server memcpy(msg,&type,1); memcpy(msg+1,&nr,1); memcpy(msg+2,&online,1); memcpy(msg+3,&p,sizeof(p)); type is 2, nr is 4 online is 0 and p is "Hello world". And on the client I get some unrecognizable characters (those squares you sometimes get). BUT, when online is 1 the string stays in one piece.. What am I supposed to make of this?
-
Problem with getting string from bytesOk here is the problem. I am developing a server in C and a client in C#. The server send streams of data to the client, and the client is responsible for decoding and interpreting these stream. So, if I send a simple "Hello world" from the server to the client, it works. If I send a byte representing an integer (I use memcpy) I can decode it in the client. But, the problems start when after some integers, I also put a string. If I put 2 bytes, each representing some number, I am still able to decode the string that follows using: System.Text.Encoding.ASCII.GetString(buffer,2,length) But if I say 3 bytes, and then the string, I don't get anything (yes, I said buffer,3,length to reflect the server changes), I get garbage.. Can anyone please help me? Thank you.
-
OleDB ImageI did it. Just omit the first 78 bytes from the file. After this wonderful solution, I believe I won't let anyone persuade me again into writing aspx. Why I don't like aspx.
-
OleDB ImageI looked into the source again and I tried Response.OutputStream.Write(imagedata,78,1000); But now mozilla doesn't say the immage cannot be displayed, it just doesn't print it.
-
OleDB ImageThere isn't, and more, I say response.Clear(); before BinaryWrite()
-
OleDB ImageYes, it's bmp
-
OleDB ImageOh come on guys, do I ask that much? I'm sure you know, it's not hard, it's just that I get a picture that "cannot be displayed" and when I look inside (with mozilla) I see /���� ���!�ÿÿÿÿBitmap Image�Paint.Picture���������PBrush����������Õ�BMöÔ�� and more stuff just like that. What am I doing wrong? OleDbCommand command=new OleDbCommand("SELECT imagine FROM produse WHERE produse.cod_produs=10",dbconn); Byte[] imagedata=(byte[])(command.ExecuteScalar()); Response.ContentType = "image/bmp"; Response.BinaryWrite(imagedata); :((
-
OleDB ImagePlease, anybody, I need to display an image from an access database. Can you show me how? I can't seem to get any of the example I've found to work
-
Ms Access imageHello. I have a ms access database (mdb) and I want to access it from asp.net, c#. I can access and display normal fields with OleDb. I need to display an image stored in the database. I have googled around a lot, but I can't seem to find something that just works. Please help me. Thank you in advance.:)
-
Ugly errorThank you verry much. I found out that the function runs in a new thread (or something like that) and to call a function in the main thread I would use invoke a few hours ago. Still, thank you very much, I'm so happy the program works now :D Cheers :)
-
ThreadingThank you verry much :)