WMP COM Help Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Spark
Posts: 80
Joined: 04 Jan 2017, 02:22

WMP COM Help

01 Aug 2018, 21:09

hello all,
i hope i can explain better, but i have problem with english

how to embed specific song in specific WMP?
and how to set a certain volume in a particular WMP?
i try to read this but still not enough

here's my code so far :

Code: Select all

Gui, 1:Add, Button, x100 y1 w80 h40 gVolBut1Up vMusic1Up, BG Vol Up
Gui, 1:Add, Button, xp y+10 w80 h40 gVolBut1Down vMusic1Down, BG Vol Down
Gui, 1:Add, Button, x+10 y1 w80 h40 gVolBut2Up vMusic2Up, SE Vol Up
Gui, 1:Add, Button, xp y+10 w80 h40 gVolBut2Down vMusic2Down, SE Vol Down
Gui, 1:Add, Button, x1 y1 w80 h40 gMBut1 vVarBut1, BG Music
Gui, 1:Add, Button, xp y+10 w80 h40 gMBut2 vVarBut2, Sound Effect
Gui, 1:Add, ActiveX, xp y+10 w500 h100 vWMP1, WMPLayer.OCX
Gui, 1:Add, ActiveX, xp y+10 w500 h100 vWMP2, WMPLayer.OCX
Gui, 1:Show, , Window
return
GuiEscape:
GuiClose:
ExitApp

Mbut1:
	wmp := ComObjCreate("WMPlayer.OCX")
	FileSelectFile, file, 2,, Select WMP Compatable File:
	wmp.url := file
return

MBut2:
	wmp := ComObjCreate("WMPlayer.OCX")
	FileSelectFile, file, 2,, Select WMP Compatable File:
	wmp.url := file
return

VolBut1Up:
	wmp.settings.volume := 100
return
VolBut1Down:
	wmp.settings.volume := 10
return
VolBut2Up:
	wmp.settings.volume += 10
return
VolBut2Down:
	wmp.settings.volume -= 10
return
thanks in advance
User avatar
TLM
Posts: 1608
Joined: 01 Oct 2013, 07:52
Contact:

Re: WMP COM Help  Topic is solved

02 Aug 2018, 13:52

You have to point to the correct object.
Change this

Code: Select all

Mbut1:
	wmp := ComObjCreate("WMPlayer.OCX")
	FileSelectFile, file, 2,, Select WMP Compatable File:
	wmp.url := file ; points to the OCX object wmp
return
to this

Code: Select all

Mbut1:
	FileSelectFile, file, 2,, Select WMP Compatable File:
	WMP1.url := file ; points to the OCX object WMP1
return
Do the same for each player ;)
Spark
Posts: 80
Joined: 04 Jan 2017, 02:22

Re: WMP COM Help

02 Aug 2018, 22:30

TLM wrote:You have to point to the correct object.
Change this

Code: Select all

Mbut1:
	wmp := ComObjCreate("WMPlayer.OCX")
	FileSelectFile, file, 2,, Select WMP Compatable File:
	wmp.url := file ; points to the OCX object wmp
return
to this

Code: Select all

Mbut1:
	FileSelectFile, file, 2,, Select WMP Compatable File:
	WMP1.url := file ; points to the OCX object WMP1
return
Do the same for each player ;)
whoaahhh...
it's work like a charm
million thanks :bravo:

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot] and 189 guests