473,395 Members | 1,474 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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(Nothing, Nothing, "BaseWindow_RootWnd", "Player
Window")
x = SetParent(WinampHndl, Panel1.Handle)

I try using the MoveWindow call like this:

MoveWindow(WinampHndl, Panel1.Left, Panel1.Top, Panel1.Width, 275, True)
Or
MoveWindow(WinampHndl, 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 2195
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("BaseWindow_RootWnd", "Player
Window")

Imports System.Runtime.InteropServices

<DllImport("user32.dll", entrypoint:="FindWindowA", SetLastError:=True)>
_
Private Shared Function FindWindow(ByVal 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*********@spammeplease.comwrote in message
news:e2*************@TK2MSFTNGP06.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(WinampHndl,
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******@hotmail.comwrote in message
news:uO*************@TK2MSFTNGP06.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
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...
4
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)...
6
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...
8
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...
27
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...
5
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...
3
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...
3
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...
26
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.