473,657 Members | 2,490 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Trying to "embed" winamp in my app

Here's another odd request. I want to embed the winamp window in my app. I
have a panel that I want Winamp to be locked to. Using a couple of API
calls, I can set the panel as the parent of the main Winamp window like so:

WinampHndl = FindWindowEx(No thing, Nothing, "BaseWindow_Roo tWnd", "Player
Window")
x = SetParent(Winam pHndl, Panel1.Handle)

I try using the MoveWindow call like this:

MoveWindow(Wina mpHndl, Panel1.Left, Panel1.Top, Panel1.Width, 275, True)
Or
MoveWindow(Wina mpHndl, 0, 0, Panel1.Width, 275, True)

It sets the width & height correctly, but doesn't move the window at all. It
remains at the lower-right corner of the panel. I can drag the winamp window
within the panel to the correct position, then when I move my main app
window around, Winamp stays in the correct place.

I'd like have it "docked" to "fill" the panel. Anyone got any advice?
Mar 9 '07 #1
4 2205
Terry,

What happens if the user doesn't have WinAmp on their machine or they have
it minimised to system tray? Your functions will fail because the handle
will be zero

Why are you using FindWindowEx & not FindWindow?

Dim intWinAmpHwnd As Int32 = FindWindow("Bas eWindow_RootWnd ", "Player
Window")

Imports System.Runtime. InteropServices

<DllImport("use r32.dll", entrypoint:="Fi ndWindowA", SetLastError:=T rue)>
_
Private Shared Function FindWindow(ByVa l lpClassName As String, _
ByVal lpWindowNamee As String) As Int32
End Function

In the past, I wrote a C++ application that used the WinAmp objects & used
an ini file to set the preferences... At least this way you could be sure to
have WinAmp on the clients machine...

In your code I see you have 275. Why isn't that Panel1.Height? But
personally I would say not to set the WinAmp height to say 10 less than the
panel height & then centre it meaning the starting point would be 5, 5 not
0, 0 & then do the same for the bottom plus left/right edges.

Your MoveWindow function isn't adding the WinAmp window to the container of
the frame, but just setting it to the size of the panel

What does 'x' stand for?

The newsgroup is waiting your response,

--
Newbie Coder
(It's just a name)
Mar 9 '07 #2
"Newbie Coder" <ne*********@sp ammeplease.comw rote in message
news:e2******** *****@TK2MSFTNG P06.phx.gbl...
Terry,

What happens if the user doesn't have WinAmp on their machine or they have
it minimised to system tray? Your functions will fail because the handle
will be zero
The program checks to see if Winamp is installed, informs the user that it's
required if not found and exits.
Why are you using FindWindowEx & not FindWindow?
FindWindowEx searches child windows, FindWindow does not. The player window
in Winamp is a child of the main Winamp process.
In your code I see you have 275. Why isn't that Panel1.Height? But
personally I would say not to set the WinAmp height to say 10 less than
the
panel height & then centre it meaning the starting point would be 5, 5 not
0, 0 & then do the same for the bottom plus left/right edges.
275, or actually, 280 is the perfect height for the Winamp window without
the video screen. Any other size than that and it doesn't look right.
Your MoveWindow function isn't adding the WinAmp window to the container
of
the frame, but just setting it to the size of the panel
Yes, I know that; which is why i'm using the x = SetParent(Winam pHndl,
Panel1.Handle) to do that. The MoveWindow call is supposed to be "Moving"
the window in addition to setting the window size. It sets the window size
correctly, but doesn't move the window. Why? This is my original question.
What does 'x' stand for?
It doesn't stand for anything other than to check that the SetParent call
was successful.
The newsgroup is waiting your response,
You know what? Forget it. When I ask a simple question, I don't need to
explain my motivation for what I want to do, which is all the responses have
been as of late. "Why do you want to do this?" My answer is, "Why do you
need to know?" Or the assumption in this response that I somehow hadn't
taken into consideration whether or not Winamp would be installed on the
user machine. Or even the statement that the MoveWindow call doesn't add
Winamp to the panel, when the SetParent call was in plain sight on the
previous line. This obviously shows that the responder didn't read the
question with the intent of providing an answer, only to criticize. So
really...forget it. I'll look for other resources.
Mar 9 '07 #3

"Terry Olsen" <to******@hotma il.comwrote in message
news:uO******** *****@TK2MSFTNG P06.phx.gbl...
>
You know what? Forget it. When I ask a simple question, I don't need to
explain my motivation for what I want to do, which is all the responses
have been as of late. "Why do you want to do this?" My answer is, "Why do
you need to know?" Or the assumption in this response that I somehow
hadn't taken into consideration whether or not Winamp would be installed
on the user machine. Or even the statement that the MoveWindow call
doesn't add Winamp to the panel, when the SetParent call was in plain
sight on the previous line. This obviously shows that the responder didn't
read the question with the intent of providing an answer, only to
criticize. So really...forget it. I'll look for other resources.

Terry,

I know my opinion wasn't solicited, but here it is anyway.

Lighten up! My experience in this group and other coding groups is first
that there are a lot of type A personalities out there and they are just
being direct, not being mean or spiteful. "Newbie Coder" is trying to be
helpful and make sure you have all your contingencies accounted for which is
why they asked about what if WinAmp isn't installed. They don't know your
level of coding experience and are really trying to help.

Second, people want to know your motivation for coding a function because
that may help them understand what's going on, or more specifically what you
want to have happen. This will then help them help you come up with a
viable solution for your problem.

You've gotta learn to take what people say, pull out the important stuff you
need and throw the rest away. In short, get over your bad self and let
people try to help you.

d
Mar 9 '07 #4
Well said Darhl

Terry,

You have a panel called Panel1 & then an undeclared variable 'x'. So, my
question was a valid one. As you have an attitude problem then forget it I
will delete the code project I coded for you

I wasn't saying you have to have WinAmp installed on the machine at all. If
you haven't & you run your app then it will fail. The way I was talking
about when I wrote this C++ project a few years ago is I had the WinAmp
object that I included in a setup project which I could call directly.
Therefore this application wouldn't fail as your would do if it cannot get
the handle to the WinAmp window.

Then you were using the wrong API, which is why I corrected you.

As you don't want my help I won't give it to you. You can let an MVP give
you a link to a Google search they performed, but I have the code for you.
Correction - I will delete the project I had for you & let you work it out
for yourself.

Sorry you feel the way you do about me,

--
Newbie Coder
(It's just a name)
Mar 9 '07 #5

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

Similar topics

2
9360
by: Csaba2000 | last post by:
I want to be able to embed a single quote into an INPUT element within a dynamically generated IFRAME. The example below shows how the IFRAME is generated. Challenge: I'd like the alert box to show: Mom said, "Don't" instead of the current: Mom said, "Do not". The point of the exercise is that I will be passing arbitrary strings to the IFRAME and I want to ensure that the final string is the same as the original. So I'm interested...
4
3408
by: AES/newspost | last post by:
Can anyone provide a quick tip on the html structure to link from a thumb to a movie poster and from there on to a QuickTime movie, all in one go, using EMBED? I have a number of (large) QuickTime movie files, each of them matched to a one-frame QuickTime movie poster of the same screen size and also to a much smaller JPEG thumb of the same image as the movie poster. I want to put the small thumbs into individual Table cells to serve...
6
1612
by: Tom Rahav | last post by:
Hi! I need to store some information about my application, such as trail version limits, allowed modules, etc. My question is whether it's better to store it in the windows registry, or in a binary file in the application's directory. My question is more aimed to the security issues, because I don't face performence as problem, since I need it just what the apllication starts. Thanks!
8
25381
by: Jerry | last post by:
I have an off-the-shelf app that uses an Access database as its backend. One of the tables contains a field with an "OLE Object" datatype. I'm writing some reports against this database, and I believe this field contains data I need. When I view the table in datasheet view, all I can see in this field is the string "Long binary data". So, I've got the problem of needing to extract data from this field, but I don't know what format...
27
8035
by: Tom Rodman | last post by:
I want to embed a bash script inside the c program. How could you do the below bash snippet in "c"?: cat > /tmp/foo <<\__EOD_ all kinds of nasty stuff in here including single and double quotes and bashslashes .. (note that the here doc delimiter is preceded by a "\" __EOD_
5
3068
by: | last post by:
Hoping someone can help with a simple but puzzling problem. I have some code that I want to build as a class method. The code works fine when I embed it in Page_Load. But when I try to generalize the code into the method of a class I am trying to build, it gives me strange errors: "CS0103: The name 'Server' does not exist in the current context". (Server being a call to Server.MapPath.) I'm working in ASP.NET 2.0 and VS.NET 2005. ...
3
2616
by: Jason Gogela | last post by:
Salutations, I was wondering why I get an error using the "embed" property in asp.NET when inserting Flash into my project. Though the page renders fine using it, I bothers me deeply that the use of said tag returns an error in the code view. Is there a replacement for this? I haven't been able to find anything on the subject. Macromedia says to go with the embed flow, and related forums have returned "fuggetabboutit." I was wondeing if...
3
2565
by: Anil Gupte | last post by:
I want to embed using an embed tag or object tag (like YouTube or others do) to embed a video file in a web page. I want to know if there is an event related to the video being done playing. Also are there other events? Thanx in advance, -- Anil Gupte www.keeninc.net www.icinema.com
26
3882
by: Jake Barnes | last post by:
I did a search on the newsgroup comp.lang.javascript. I was searching for "how to play a sound with Javascript". I'm somewhat suprised that the majority of entries are from the 1990s, and there are almost no posts from the last 3 years: http://groups.google.com/group/comp.lang.javascript/search?group=comp.lang.javascript&q=how+to+play+a+sound+with+Javascript&qt_g=Search+this+group Even after sorting by date, there don't appear any...
0
8325
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8742
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7354
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5643
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4173
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4330
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2743
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
2
1971
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1734
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.