The MP3car.com Store  

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.

Go Back   MP3Car.com > Mp3Car Technical > Software & Software Development

Reply
 
Thread Tools Display Modes
Old 02-18-2008, 11:20 AM   #1
Constant Bitrate
portreathbeach's CarPC Specs
 
Join Date: Sep 2006
Location: Cornwall, England
Vehicle: 2003 VW Transporter T5
Posts: 145
My Photos: (46)
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!)
portreathbeach is offline   Reply With Quote
Sponsored Links
Old 02-28-2008, 10:50 PM   #2
Constant Bitrate
Ineffigy's CarPC Specs
 
Join Date: Apr 2006
Location: Dallas, Texas
Vehicle: 2005 Toyota Celica GTS 6
Posts: 221
My Photos: (0)
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)
Ineffigy is offline   Reply With Quote
Old 02-29-2008, 03:49 PM   #3
Constant Bitrate
portreathbeach's CarPC Specs
 
Join Date: Sep 2006
Location: Cornwall, England
Vehicle: 2003 VW Transporter T5
Posts: 145
My Photos: (46)
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!)
portreathbeach is offline   Reply With Quote
Old 02-29-2008, 08:56 PM   #4
Constant Bitrate
Ineffigy's CarPC Specs
 
Join Date: Apr 2006
Location: Dallas, Texas
Vehicle: 2005 Toyota Celica GTS 6
Posts: 221
My Photos: (0)
add

processInfo.Arguments = "/CLASS=""" & WinAmpClass & """"
Ineffigy is offline   Reply With Quote
Old 03-01-2008, 04:18 AM   #5
Constant Bitrate
portreathbeach's CarPC Specs
 
Join Date: Sep 2006
Location: Cornwall, England
Vehicle: 2003 VW Transporter T5
Posts: 145
My Photos: (46)
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.
portreathbeach is offline   Reply With Quote
Old 03-01-2008, 04:47 AM   #6
Variable Bitrate
rijk's CarPC Specs
 
Join Date: Feb 2007
Location: netherlands
Vehicle: 1994 volvo 440
Posts: 251
My Photos: (0)
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)
rijk is offline   Reply With Quote
Old 03-01-2008, 03:51 PM   #7
Constant Bitrate
Ineffigy's CarPC Specs
 
Join Date: Apr 2006
Location: Dallas, Texas
Vehicle: 2005 Toyota Celica GTS 6
Posts: 221
My Photos: (0)
You don't need to use the Win32 API command FindWindow. process.Handle is the handle. You already have it.
Ineffigy is offline   Reply With Quote
Old 03-02-2008, 05:44 AM   #8
Constant Bitrate
portreathbeach's CarPC Specs
 
Join Date: Sep 2006
Location: Cornwall, England
Vehicle: 2003 VW Transporter T5
Posts: 145
My Photos: (46)
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!)
portreathbeach is offline   Reply With Quote
Old 03-02-2008, 06:10 AM   #9
Constant Bitrate
Ineffigy's CarPC Specs
 
Join Date: Apr 2006
Location: Dallas, Texas
Vehicle: 2005 Toyota Celica GTS 6
Posts: 221
My Photos: (0)
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
Ineffigy is offline   Reply With Quote
Old 03-02-2008, 06:11 AM   #10
Constant Bitrate
Ineffigy's CarPC Specs
 
Join Date: Apr 2006
Location: Dallas, Texas
Vehicle: 2005 Toyota Celica GTS 6
Posts: 221
My Photos: (0)
Oh, and BTW. Don't use the switch /CLASS when doing this as it causes winamp.exe to error. You should notice no flicker.
Ineffigy is offline   Reply With Quote
Sponsored Links
Old 03-02-2008, 06:47 AM   #11
Constant Bitrate
portreathbeach's CarPC Specs
 
Join Date: Sep 2006
Location: Cornwall, England
Vehicle: 2003 VW Transporter T5
Posts: 145
My Photos: (46)
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.
portreathbeach is offline   Reply With Quote
Old 03-02-2008, 03:35 PM   #12
Constant Bitrate
Ineffigy's CarPC Specs
 
Join Date: Apr 2006
Location: Dallas, Texas
Vehicle: 2005 Toyota Celica GTS 6
Posts: 221
My Photos: (0)
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.
Ineffigy is offline   Reply With Quote
Old 03-02-2008, 04:08 PM   #13
Constant Bitrate
portreathbeach's CarPC Specs
 
Join Date: Sep 2006
Location: Cornwall, England
Vehicle: 2003 VW Transporter T5
Posts: 145
My Photos: (46)
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!)
portreathbeach is offline   Reply With Quote
Old 03-03-2008, 03:59 PM   #14
Constant Bitrate
Ineffigy's CarPC Specs
 
Join Date: Apr 2006
Location: Dallas, Texas
Vehicle: 2005 Toyota Celica GTS 6
Posts: 221
My Photos: (0)
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.
Ineffigy is offline   Reply With Quote
Old 03-03-2008, 05:07 PM   #15
Constant Bitrate
portreathbeach's CarPC Specs
 
Join Date: Sep 2006
Location: Cornwall, England
Vehicle: 2003 VW Transporter T5
Posts: 145
My Photos: (46)
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.
portreathbeach is offline   Reply With Quote
Sponsored Links
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
WinAMP 5 Comes to front on launch macbrando Road Runner 7 09-05-2007 08:01 PM
Locking on startup. Never had this problem.. DeadlyAP1 Road Runner 1 05-11-2007 10:18 AM
Need help with winamp dikke Software & Software Development 6 12-04-2002 02:01 AM
winamp start up problem jett98 Software & Software Development 6 10-21-2002 04:18 PM
WinAmp 3 Rob Software & Software Development 1 01-26-2002 08:00 AM


All times are GMT -5. The time now is 09:56 PM.


Sponsored Links
The MP3car.com Store

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.1.0
Copyright © 1999 - 2008 Mp3Car.com Inc.
Ad Management by RedTyger
Message Board Statistics