Welcome to the MP3Car.com forums.
You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. Registering will also remove advertisements. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!
If you have any problems with the registration process or your account login, please contact contact us.
|
02-18-2008, 11:20 AM
|
#1
|
|
Constant Bitrate
Join Date: Sep 2006
Location: Cornwall, England
Vehicle: 2003 VW Transporter T5
Posts: 145
|
Winamp minimize problem!
I am using Winamp 2.91 as it loads quickly and does everything I want from within my front-end.
The only problem I have is that when 'winamp.exe' is loaded from within VB.NET with the 'shell' command, it automatically minimizes it, so you get a flicker as Winamp is minimizing to the bottom left of the screen and hiding itself.
I have looked in the winamp.ini file and even if I set the minimize=1 to minimize=0, the next time I 'shell' Winamp, it minimizes again, causing an anoying flicker. I would like to 'shell' Winamp without this happening, is there a way of doing this?
__________________
ViVE - Volkswagen In Van Entertainment:
VoomPC 2, VIA C7 2GHz
7" Lilliput
120Gb Sata drive
1GB RAM
[||||||||||] 100% - Planning
[||||||||||] 100% - Software coding
[||||||||||] 100% - Built
(Always tweaking!)
|
|
|
02-28-2008, 10:50 PM
|
#2
|
|
Constant Bitrate
Join Date: Apr 2006
Location: Dallas, Texas
Vehicle: 2005 Toyota Celica GTS 6
Posts: 221
|
Try this
Dim processInfo As New System.Diagnostics.ProcessStartInfo("winamp.exe")
processInfo.WindowStyle = ProcessWindowStyle.Normal
Dim process As New System.Diagnostics.Process()
process.Start(processInfo)
|
|
|
02-29-2008, 03:49 PM
|
#3
|
|
Constant Bitrate
Join Date: Sep 2006
Location: Cornwall, England
Vehicle: 2003 VW Transporter T5
Posts: 145
|
Thanks, but I need to be able to load Winamp with the /class flasg after it, so I can get its window handle. I use this...
Shell(Chr(34) + Winamp_Path + "winamp.exe" + Chr(34) + " /CLASS=" + Chr(34) + WinampClass + Chr(34))
Can I use the way you sugested to load winamp with the /class flag also?
__________________
ViVE - Volkswagen In Van Entertainment:
VoomPC 2, VIA C7 2GHz
7" Lilliput
120Gb Sata drive
1GB RAM
[||||||||||] 100% - Planning
[||||||||||] 100% - Software coding
[||||||||||] 100% - Built
(Always tweaking!)
|
|
|
02-29-2008, 08:56 PM
|
#4
|
|
Constant Bitrate
Join Date: Apr 2006
Location: Dallas, Texas
Vehicle: 2005 Toyota Celica GTS 6
Posts: 221
|
add
processInfo.Arguments = "/CLASS=""" & WinAmpClass & """"
|
|
|
03-01-2008, 04:18 AM
|
#5
|
|
Constant Bitrate
Join Date: Sep 2006
Location: Cornwall, England
Vehicle: 2003 VW Transporter T5
Posts: 145
|
This loads Winamp as I want, but when I use the command...
hWndWinAmp = FindWindow(WinampClass, vbNullString)
...to get Winamps handle, like I did before, it doesn't get the window handle when started using the prosses start method!
But if I use the process start method to start Winamp, then use the Shell..... that I used before and then find the window it works, how weird!
__________________
ViVE - Volkswagen In Van Entertainment:
VoomPC 2, VIA C7 2GHz
7" Lilliput
120Gb Sata drive
1GB RAM
[||||||||||] 100% - Planning
[||||||||||] 100% - Software coding
[||||||||||] 100% - Built
(Always tweaking!)
Last edited by portreathbeach : 03-01-2008 at 04:39 AM.
|
|
|
03-01-2008, 04:47 AM
|
#6
|
|
Variable Bitrate
Join Date: Feb 2007
Location: netherlands
Vehicle: 1994 volvo 440
Posts: 251
|
Change it al back as it worked with the flickering and try:
Open winamp and rightclick (on winamp) than uncheck everything (main window, playlist editor, etc).
If you need to see winamp go to the taskbar and check main manu (alt w)
|
|
|
03-01-2008, 03:51 PM
|
#7
|
|
Constant Bitrate
Join Date: Apr 2006
Location: Dallas, Texas
Vehicle: 2005 Toyota Celica GTS 6
Posts: 221
|
You don't need to use the Win32 API command FindWindow. process.Handle is the handle. You already have it.
|
|
|
03-02-2008, 05:44 AM
|
#8
|
|
Constant Bitrate
Join Date: Sep 2006
Location: Cornwall, England
Vehicle: 2003 VW Transporter T5
Posts: 145
|
Thanks, but I tried this code:
Dim processInfo As New System.Diagnostics.ProcessStartInfo(Winamp_Path + "winamp.exe")
processInfo.WindowStyle = ProcessWindowStyle.Normal
processInfo.Arguments = "/CLASS=""" & WinampClass & """"
Dim process As New System.Diagnostics.Process()
process.Start(processInfo)
hWndWinAmp = process.Handle
But I keep getting an error thrown saying "No process is associated with this object", I've also tried hWndWinAmp = process.Handle.ToString, but still the sam.
__________________
ViVE - Volkswagen In Van Entertainment:
VoomPC 2, VIA C7 2GHz
7" Lilliput
120Gb Sata drive
1GB RAM
[||||||||||] 100% - Planning
[||||||||||] 100% - Software coding
[||||||||||] 100% - Built
(Always tweaking!)
|
|
|
03-02-2008, 06:10 AM
|
#9
|
|
Constant Bitrate
Join Date: Apr 2006
Location: Dallas, Texas
Vehicle: 2005 Toyota Celica GTS 6
Posts: 221
|
Sorry about that. System.Diagnostics.Process.Start is a static method and it returns the process object. Try this code. (This time I tested it.)
Dim WinAmpClass As String = ""
Dim processInfo As New System.Diagnostics.ProcessStartInfo("winamp.exe")
processInfo.FileName = "C:\Program Files\Winamp\winamp.exe"
processInfo.WorkingDirectory = "C:\Program Files\Winamp"
processInfo.WindowStyle = ProcessWindowStyle.Normal
'processInfo.Arguments = "/CLASS=""" & WinAmpClass & """"
Dim process As New System.Diagnostics.Process()
process = System.Diagnostics.Process.Start(processInfo)
Dim winampHandle As IntPtr
winampHandle = process.Handle
|
|
|
03-02-2008, 06:11 AM
|
#10
|
|
Constant Bitrate
Join Date: Apr 2006
Location: Dallas, Texas
Vehicle: 2005 Toyota Celica GTS 6
Posts: 221
|
Oh, and BTW. Don't use the switch /CLASS when doing this as it causes winamp.exe to error. You should notice no flicker.
|
|
|
03-02-2008, 06:47 AM
|
#11
|
|
Constant Bitrate
Join Date: Sep 2006
Location: Cornwall, England
Vehicle: 2003 VW Transporter T5
Posts: 145
|
Hi,
The process.handle doesn't seem to work for me.
winampHandle = process.Handle gives me a value of 1508 (or somewhere there abouts) whereas using the findwindow api command gives me a longer value, which is the actual window handle. What is the process.handle, because it isn't the window handle that I need.
I have got around this by adding a line in my 'check status' timer (runs every 250ms) which says:
if hWndWinamp = 0 then Winamp_findwindow()
this seems to work!
Thanks for the help 
__________________
ViVE - Volkswagen In Van Entertainment:
VoomPC 2, VIA C7 2GHz
7" Lilliput
120Gb Sata drive
1GB RAM
[||||||||||] 100% - Planning
[||||||||||] 100% - Software coding
[||||||||||] 100% - Built
(Always tweaking!)
Last edited by portreathbeach : 03-02-2008 at 09:23 AM.
|
|
|
03-02-2008, 03:35 PM
|
#12
|
|
Constant Bitrate
Join Date: Apr 2006
Location: Dallas, Texas
Vehicle: 2005 Toyota Celica GTS 6
Posts: 221
|
Sounds like you want process.MainWindowHandle then. That one has the handle to the window, not the process.
Last edited by Ineffigy : 03-02-2008 at 03:46 PM.
|
|
|
03-02-2008, 04:08 PM
|
#13
|
|
Constant Bitrate
Join Date: Sep 2006
Location: Cornwall, England
Vehicle: 2003 VW Transporter T5
Posts: 145
|
When I use this, I always end up with 0 as the result. I really can't seem to work it out.
I can't believe how much this is bugging me. After a year of coding my front-end such a silly thing like this is very anoying.
__________________
ViVE - Volkswagen In Van Entertainment:
VoomPC 2, VIA C7 2GHz
7" Lilliput
120Gb Sata drive
1GB RAM
[||||||||||] 100% - Planning
[||||||||||] 100% - Software coding
[||||||||||] 100% - Built
(Always tweaking!)
|
|
|
03-03-2008, 03:59 PM
|
#14
|
|
Constant Bitrate
Join Date: Apr 2006
Location: Dallas, Texas
Vehicle: 2005 Toyota Celica GTS 6
Posts: 221
|
Yeah, it's odd. Sometimes I get the WindowHandle and other times I just get 0. There are other ways to do this so that you don't get any flicker. I'll keep researching this.
|
|
|
03-03-2008, 05:07 PM
|
#15
|
|
Constant Bitrate
Join Date: Sep 2006
Location: Cornwall, England
Vehicle: 2003 VW Transporter T5
Posts: 145
|
No problem. As I said in an earlier post, I load winamp with the process.start as you suggested and then in my 250ms 'check timer', I try grabbing the handle with the findwindow command and it works. So now I have winamp loading in the bottom left corner without the flicker, my front-end in the foreground and the timer grabbing its handle. Runs smoothly and no sign of winamp loading.
I think the reason for the process.MainWindowHandle giving a 0 maybe something to do with the time it takes Winamp to load. Because technically Winamp doesn't have a handle until it is actually loaded, so when the vb.net code is trying to get the process handle, winamp hasn't actually loaded, therefore giving a 0 for the handle. Maybe.... Just a thought!
Thanks for the help
__________________
ViVE - Volkswagen In Van Entertainment:
VoomPC 2, VIA C7 2GHz
7" Lilliput
120Gb Sata drive
1GB RAM
[||||||||||] 100% - Planning
[||||||||||] 100% - Software coding
[||||||||||] 100% - Built
(Always tweaking!)
Last edited by portreathbeach : 03-03-2008 at 05:09 PM.
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 09:56 PM.
|
|