|
What do you mean exactly? TopMost or on a certain Location?
Are we talking WinForms or WPF?
V.
|
|
|
|
|
You are not going to put any of your windows on my desktop, you hear!
It is strictly forbidden!
"With sufficient thrust, pigs fly just fine."
Ross Callon, The Twelve Networking Truths, RFC1925
|
|
|
|
|
|
|
Fetch[^] handle of the desktop-window, set it as your parent[^], make your form the "bottom most[^]" and you're there. Should look like an IFrame in your desktop, should work and behave in the same way.
Good luck
Bastard Programmer from Hell
|
|
|
|
|
wave file can be add to project as resources but mp3 i cant played it as resources ....what the problem with mp3 can anyone help me with that please
|
|
|
|
|
1. One exclamation sign suffices if not separated from last word.
2. What have you tried to play the mp3 in question? What error messages (if any) did you see?
After getting the Play part to work, you can deal with attaching the file to your project's resources pretty easily.
Ciao,
luker
|
|
|
|
|
i try to add mp3 file to resources without open dialog its not work ..
after i add wav file to resources i played it with :
SoundPlayer sndplayr = new SoundPlayer(resource.Properties.Resources.xp);
sndplayr.Play();
and i try :
System.Reflection.Assembly a = System.Reflection.Assembly.GetExecutingAssembly();
System.IO.Stream s = a.GetManifestResourceStream("xp.wav");
SoundPlayer player = new SoundPlayer(s);
player.Play();
wave file played but mp3 i can't .. is that any method to do it ..
|
|
|
|
|
You can embed anything (well, any file or finite stream which can be saved as a file) as a resource. I don't think there is native MP3 playing in the Framework, though.
|
|
|
|
|
AFAIK (and MSDN[^] is pretty categorical about it) SoundPlayer can't handle MP3's - you would need to use a MediaPlayer embed to play them. The problem with that is that MediaPlayer only works with files: it has no facility to work with streams. So, you would need to export the MP3 from your resources into a temporary file, play it, then clean up after yourself when you are finished. Which defeats the purpose of having the file as a resource in the first place!
There is an alternative solution here: http://stackoverflow.com/questions/184683/play-audio-from-a-stream-using-c-sharp[^] but I haven't tried it and can't vouch for it's effectiveness!
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|
|
i look about it but i don't understand anything i m newer in C# can you help me please with that in a little sample cod project ?
|
|
|
|
|
If you don't understand the link I gave you, then probably the best thing to do is put this project on the shelf for a while - just until you understand a bit more about the basics - otherwise you will probably end up missing something important and never learn it!
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|
|
This is a repost of the question I responded to here[^].
|
|
|
|
|
I can't believe, this is the same guy.
|
|
|
|
|
I know, hence my comment.
|
|
|
|
|
Repost! do not repost your questions here.
***** Programme comme si dept soutien technique. est plein de tueurs en série et ils savent adresse de votre domicile. *****
|
|
|
|
|
When my background thread calls the following code,
public void Func(object Request, object Response)
{
if (this.InvokeRequired)
{
this.Invoke(new ResponseHandlerDelegate(ResponseHandler), new object[] { Request, Response });
return;
}
}
does the background thread get blocked at the Invoke call until the UI thread completes the function call?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Yes, the calling thread will block.
If this behaviour is not desired, you can circumvent it by using BeginInvoke instead of Invoke .
Ciao,
luker
|
|
|
|
|
And if I use BeginInvoke , can I "stack" multiple calls to BeginInvoke before any of them completes?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
You can, but be aware that this can lead to unpredictable results as they might not complete in the order you expect.
|
|
|
|
|
How true is this? Two calls to BeginInvoke from the same thread will execute in the order you called them in, I would imagine. And calls from different threads don't have a natural concept of before/after anyway, so it wouldn't matter.
|
|
|
|
|
They may start in the order you requested, but how do you know what order they finish in?
|
|
|
|
|
Correct me if I am wrong but all call will all run in the same thread.
That is in the thread of the control you are invoking.
As they are queued, I can't see how they could finish in a different order from the order they started.
|
|
|
|
|
|
I read the post I agree with you Luc. You can't predict in which order the methods will be run.
What I was trying to say is that they will complete in the order they start.
thread A: Control1.BeginInvoke DoSomething(1)
thread B: Control1.BeginInvoke DoSomething(2)
thread C: Control1.BeginInvoke DoSomething(3)
... sometime later
Control1's thread: Start Running DoSomething(1)
Control1's thread: End DoSomething(1)
Control1's thread: Start Running DoSomething(3)
Control1's thread: End DoSomething(3)
Control1's thread: Start Running DoSomething(2)
Control1's thread: End DoSomething(2)
I am not sure if it is clearer. What I want to say is that two calls to DoSomething won't happen simultaneously if they are called using Invoke.
|
|
|
|