473,587 Members | 2,568 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Adding Drag and Drop Functionality to AxMicrosoft.Med iaPlayer.Intero p.AxWindowsMedi aPlayer

I am wringing a small and lite Media Player to fit my custom needs for
usage while programming.

I had written some drag and drop functionality like i do with other
programs, but hey, the ActiveX doesn't support Drag and Drop. I've been
checking loads of search results, but no dice, no info on how to add
drag and drop to an activex that doesn't has it by default, or a hack
to get it to use the drag and drop of the form itself, or something
similar.

The drag&drop stuff i wrote (Get an unsupported error):
this.axWMP.Drag Drop += new
System.Windows. Forms.DragEvent Handler(axWMP_D ragDrop);
this.axWMP.Drag Enter += new
System.Windows. Forms.DragEvent Handler(axWMP_D ragEnter);

void axWMP_DragEnter (object sender,
System.Windows. Forms.DragEvent Args e)
{
if
(e.Data.GetData Present(System. Windows.Forms.D ataFormats.File Drop))
{
string[] files =
(string[])e.Data.GetData (System.Windows .Forms.DataForm ats.FileDrop);
foreach (string s in files)
{
if (s.EndsWith(".a vi") || s.EndsWith(".mp g") ||
s.EndsWith(".wm v"))
{
e.Effect =
System.Windows. Forms.DragDropE ffects.Copy;
return;
}
}
}
else
{
e.Effect = System.Windows. Forms.DragDropE ffects.None;
}
}

void axWMP_DragDrop( object sender,
System.Windows. Forms.DragEvent Args e)
{
//System.Windows. Forms.DataForma ts.FileDrop
if
(e.Data.GetData Present(System. Windows.Forms.D ataFormats.File Drop))
{
string[] files =
(string[])e.Data.GetData (System.Windows .Forms.DataForm ats.FileDrop);
try
{
foreach (string s in files)
{
if (s.EndsWith(".a vi") || s.EndsWith(".mp g") ||
s.EndsWith(".wm v"))
{

axWMP.currentPl aylist.appendIt em(axWMP.mediaC ollection.getBy Name(s).get_Ite m(0));
}
}
}
catch (System.Excepti on ex)
{
System.Windows. Forms.MessageBo x.Show(ex.Messa ge);
return;
}
if (axWMP.playStat e !=
Microsoft.Media Player.Interop. WMPPlayState.wm ppsPlaying)
{
axWMP.Ctlcontro ls.play();
}
}
}
On a different note: i also have a small question about the Alt-Enter
behaviour of this ActiveX, when in full screen modus, and you hit
alt-enter, it goes out of fullscreen modus, it does not respont to
other hotkey's, because of this matter, i cannot write support for the
alt-enter hotkey combo, because it will allow me to toggle into full
screen the first time, but after that, it will go out of, and directly
back into fullscreen again, other combo's work without a problem.
Thanks in advance,

Nick.

Dec 4 '05 #1
2 5330
Anyone?

ViRi wrote:
I am wringing a small and lite Media Player to fit my custom needs for
usage while programming.

I had written some drag and drop functionality like i do with other
programs, but hey, the ActiveX doesn't support Drag and Drop. I've been
checking loads of search results, but no dice, no info on how to add
drag and drop to an activex that doesn't has it by default, or a hack
to get it to use the drag and drop of the form itself, or something
similar.

The drag&drop stuff i wrote (Get an unsupported error):
this.axWMP.Drag Drop += new
System.Windows. Forms.DragEvent Handler(axWMP_D ragDrop);
this.axWMP.Drag Enter += new
System.Windows. Forms.DragEvent Handler(axWMP_D ragEnter);

void axWMP_DragEnter (object sender,
System.Windows. Forms.DragEvent Args e)
{
if
(e.Data.GetData Present(System. Windows.Forms.D ataFormats.File Drop))
{
string[] files =
(string[])e.Data.GetData (System.Windows .Forms.DataForm ats.FileDrop);
foreach (string s in files)
{
if (s.EndsWith(".a vi") || s.EndsWith(".mp g") ||
s.EndsWith(".wm v"))
{
e.Effect =
System.Windows. Forms.DragDropE ffects.Copy;
return;
}
}
}
else
{
e.Effect = System.Windows. Forms.DragDropE ffects.None;
}
}

void axWMP_DragDrop( object sender,
System.Windows. Forms.DragEvent Args e)
{
//System.Windows. Forms.DataForma ts.FileDrop
if
(e.Data.GetData Present(System. Windows.Forms.D ataFormats.File Drop))
{
string[] files =
(string[])e.Data.GetData (System.Windows .Forms.DataForm ats.FileDrop);
try
{
foreach (string s in files)
{
if (s.EndsWith(".a vi") || s.EndsWith(".mp g") ||
s.EndsWith(".wm v"))
{

axWMP.currentPl aylist.appendIt em(axWMP.mediaC ollection.getBy Name(s).get_Ite m(0));
}
}
}
catch (System.Excepti on ex)
{
System.Windows. Forms.MessageBo x.Show(ex.Messa ge);
return;
}
if (axWMP.playStat e !=
Microsoft.Media Player.Interop. WMPPlayState.wm ppsPlaying)
{
axWMP.Ctlcontro ls.play();
}
}
}
On a different note: i also have a small question about the Alt-Enter
behaviour of this ActiveX, when in full screen modus, and you hit
alt-enter, it goes out of fullscreen modus, it does not respont to
other hotkey's, because of this matter, i cannot write support for the
alt-enter hotkey combo, because it will allow me to toggle into full
screen the first time, but after that, it will go out of, and directly
back into fullscreen again, other combo's work without a problem.
Thanks in advance,

Nick.


Dec 4 '05 #2
Please guys, i would really appreciate it...

Dec 6 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
9188
by: Grey | last post by:
I need to design a workflow application with C#. I want to design an UI with some workflow components which they can be drag & drop anywhere in order to design the workflow for the application users. Moreover, when the user double click on the component, they can define some routing rules for the process. Is it possible to have such fancy UI...
10
1686
by: Michi | last post by:
Hi Does anybody know how I can display own icons for drag & drop ? thx
3
8162
by: James Radke | last post by:
Hello, I was curious, is it possible to create drag and drop interface from listbox to listbox on a webform application (i.e. vb.net)? Basically the application would need to load multiple listboxes with values from a database, allow the user to drag and drop from a listbox to a different listbox and would 'move' the item and update the...
0
482
by: ViRi | last post by:
I am currently experimenting a bit with AxMicrosoft.MediaPlayer.Intero­p.AxWindowsMediaPlayer and so far, most has gone well. Currently, i would like to add drag-and-drop functionality to the program, but the ActiveX has no support for it, so trying to use it just causes error's. What i have done is use a small label that i use for...
0
3745
by: vsa | last post by:
Hi, i want to add axdrawingcontrol in c#. It requires reference to AxMicrosoft.Office.Interop.VisOcx.AxDrawingControl .dll. Would you please let me know where this dll can be located? Thank you, vsa
2
2082
by: Robert Zahm | last post by:
I have created a C# user control which display certain filesystem information, and allows the user to drag an drop files into and out of the control. I then placed this user form in IE using an <object> tag. Doing this has broken the drag and drop functionality from Windows Explorer into IE (it still works fine going from IE to Windows...
0
1714
by: Truevision .Net | last post by:
Hi, I have a problem with drag and drop functionality when it comes to dropping pictures from sources like for example internet explorer and the webbrowser control. Dragging and dropping from picturebox to picturebox works just fine. This part of the program is basically that it navigates to a page in a webbrowser control and on this...
2
5265
by: Andreas Mueller | last post by:
Hi All, I'm trying to show a context menu during a drag drop operation similar to the windows explorers right click drag and drop behavior (A full working sample is at the end of the post): void treeView1_DragDrop(object sender, DragEventArgs e) { ContextMenu mnu = new ContextMenu(); mnu.MenuItems.Add("Click me", OnCmClick);
0
7918
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7843
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8206
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8340
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
3840
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3875
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2353
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1452
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1185
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.