|
I've designed a udp connection using socket and threading. I want to know how I can change sound to an array of byte and change an array of byte to sound. So how can I set received sound to speaker and give output sound from its device like microphone?
What should I do?
Thanks a lot for your answers.
Bahman
|
|
|
|
|
Hi,
I have a partial answer to your question:
store the sound data in a byte array, pin it in memory, and call the unmanaged function
[DllImport("Winmm.dll", CallingConvention=CallingConvention.Cdecl)]
static extern int sndPlaySound(IntPtr buffer, int dwFlags);
with flag value = 4 (= SND_MEMORY)
More on this in http://www.bobpowell.net/playsnd.htm[^]
Dont know about capturing sounds though.
Luc Pattyn
|
|
|
|
|
I am trying use the IR on a PDA to communicate to another source. I am successful in finding out either the DeviceID and Device Name. I can also connect using irClient.Connect(irEndP);
My problem is either declaring the Stream or the WriteByte. My code is
irEndP =
new IrDAEndPoint(irDevices[0].DeviceID, irServiceName);
irClient = new IrDAClient();
irClient.Connect(irEndP);
Stream baseStream = irClient.GetStream();
System.Text.ASCIIEncoding encoding = new
System.Text.ASCIIEncoding();
string Name = "Hello World\n";
int strlen = Name.Length;
byte[] buffer = new byte[buffersize];
buffer = encoding.GetBytes(Name);
if (baseStream.CanWrite)
{
//baseStream.WriteTimeout = 1000;
baseStream.Write(buffer, 0, 5);
baseStream.Close();
}
I have tried baseStream.Flush(); and it does not help.
Help Please!
|
|
|
|
|
Is there any way to permanently set a window to the bottom of the stack?
I know you can send it to the back using:
void setbottom(ref Window window)
{
IntPtr hWnd = new WindowInteropHelper(window).Handle;
SetWindowPos(hWnd, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE);
}
However that method needs to be called every time something else goes to the back. So is there any way make a window permanently set to the back?
- Munty
|
|
|
|
|
I seriously doubt that you could. What would happen if you had two applications that tried to do this?
Why would you want to do this?
Arthur Dent - "That would explain it. All my life I've had this strange feeling that there's something big and sinister going on in the world."
Slartibartfast - "No. That's perfectly normal paranoia. Everybody in the universe gets that."
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
It's an alternate desktop. (Most normal windows functions are gone, and some specific functions are included)
As for what happens when two programs do this, I'd assume that the first program to do it would have priority.
After some digging around on my own, in microsofts MSDN website, there's apparently a AlwaysOnBottom setting in Object, but it seems to be for only VB. I was kind of hopping there was something similar for C#. (As far as I can tell it acts the opposite of the AlwaysOnTop setting(which in itself is basically what things like TaskManager use. Apparently.))
|
|
|
|
|
If you're writing a windows forms app, the TextBox control has a mechanism to let you select the text. Not so for web pages, or so it seems, anyway.
My desire doesn't seem that complex. I have to manually set focus to controls on occasion, and when I do I'd like to select the complete contents as well. Can't seem to find a way to do this.
The browser does this by default if you just tab through controls. However, if you manually set the focus, the text is unselected and I can find no mechanism to manually select it.
Anyone know the workaround for this?
Thanks,
|
|
|
|
|
Hi,
Not sure, but Javascript might do the trick. You can select all the text on click event.
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
|
|
|
|
|
Hello All,
How can i do in order to change a permission for an user in a registry key.
How to do it programatically.
Thanks in advance...
Regards,
|
|
|
|
|
What would be the legit reason for this?
|
|
|
|
|
Hi guys, first post, i'm just getting to grips with c#.net finally, should be a pro at the end of the week, anyway, i'm pretty used to vb.net so that might be why im having trouble.
Here is the issue:
Say for example my program.cs opens a form, we will call that Main_Form, and from Main_Form, i load another form, we will call this new form Sub_Form, how can i change the height of Main_Form from the code of Sub_Form, Main_Form is already open, i dont want to do a show dialog because that only good if the forms not open right?, i just want to access the properys of the already open Main_Form from the Sub_Form, i'm not really after changeing the height to be honest, i just can't work out how to play with an already open form without making a new instance of it.
I've done this in VB.net just can't do the same in C#.net, many thanks guys.
Si
|
|
|
|
|
Hello,
You need to have an reference of Main_Form in your Sub_Form.
You can do that with an property:
public Main_Form mymainform
{
get ...
set...
}
The Main_Form gives its instance to the Sub_Form property
//Main_Form code
this.sub_form.mymainform = this;
Your Sub_Form can now change Main_Form properties, like:
this.mymainform.Height = ...;
But there are much more elegant posibilities discriped in this article from Colin Angus Mackay:
http://www.codeproject.com/dotnet/passingvaluesbetweenforms.asp[^]
Hope that helps you.
All the best,
Martin
|
|
|
|
|
Hi,
Why do the following statement not working:
DataColumn.Expression = "Value1 + \n + Value2"
Try to assign two strings which is below each other for multi-line text.
thanks
|
|
|
|
|
Fixed it myself. Sorry.
DataColumn.Expression = "ProjectCode +'"+Environment.NewLine+"' + ProjectDesc";
|
|
|
|
|
hi everybody,
how can i change default exe icon in VC#.net
Thanks
|
|
|
|
|
Select the project, Right Click -> Properties
On the properties page
under the resource section there is an option for Icon.
set that by browsing to the ico file.
hope that works for u.
Thanks & Regards,
Pramod
"Everyone is a genius at least once a year"
|
|
|
|
|
Just want to know if anyone here has any experience with Ghost Installer?
I downloaded the free version get the files added but when I run the setup.exe I get an error at the first file it tries to copy, says that it can't install file.
My apologies if this isn't in the correct forum, wasn't quite sure where it would fit.
Thanks in advance
He who laughs last is a bit on the slow side
|
|
|
|
|
Hello,
i have lage jpeg files. i want to preview (small) this files in an picbox.
i want not to read the files completely, i want to read the tumbnail info.
my jpeg includes thumbnal images...
but how?
thx ipgi
|
|
|
|
|
Do u want the Thumbnail image of jpeg file or only the info?
Thanks & Regards,
Pramod
"Everyone is a genius at least once a year"
|
|
|
|
|
hello,
I want the Thumbnail image of jpeg...
|
|
|
|
|
You have a smaller version of the image embedded inside the jpeg as metadata ? Reading metadata from images is supported, I've seen samples that do it.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi,
I have added a reference to Microsoft Excel 11 and it shows as Excel under references.
I believe I should now use "using Excel".
But Excel does not get picked up by Intellisense.
So what I have ended up doing is as follows:
Microsoft.Office.Interop.Excel.Application excelApp = new Microsoft.Office.Interop.Excel.ApplicationClass();
I basically should be able to abreviate the above line to:
Excel.Application excelApp = new Excel.ApplicationClass();
Thanks
|
|
|
|
|
Errm - that should be using Microsoft.Office.Interop; I think.
Arthur Dent - "That would explain it. All my life I've had this strange feeling that there's something big and sinister going on in the world."
Slartibartfast - "No. That's perfectly normal paranoia. Everybody in the universe gets that."
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Try Next Code:
Excel._Application m_app = null;
Excel.Workbook m_workBook = null;
Excell.Worksheet m_workSheet = null;
m_app = new Excel.ApplicationClass();
m_app.Visible = false;
m_app.UserControl = true;
m_workBook = m_app.Workbooks.Open(filename, false, false, Type.Missing......Type.Missing);
m_workSheet = m_app.Worksheets[shet] as Excel.WorkSheet;
//************************
m_workSheet.Cells[x,y] = "Yes";
//************************
m_workBook.Close(false,"", Type.Missing);
m_app.Quit();
m_workBook = null;
m_workSheet = null;
m_app = null;
GC.Collect();
devers@inbox.ru
|
|
|
|
|
hi,
Please let me know if anybody has idea about showing the graphical representation similar to performance graph available with Task Manager which show the graphical representation of cpu usage.
i wanted to implement the similar functinality into the .Net (winforms) application.
Please help me.
Regards,
Rajesh Khubchandani
|
|
|
|