View Full Version : [help] audio background and minimize
Shuto73
11-12-2005, 12:31 PM
Hello everybody, I got a problem I can't solve. How can I make the sound play again when I open back a menu after minimizing it? I'll try to explain myself better.
In this menu I'm making I've put on a certain background sound that starts playing when you open the menu. Then, I added a button with the commands "audio.pause" and "Window.Minimize" (Application.GetWndHandle())
So that when I push this button the audio pauses and the menu gets minimized into an icon on the bar. Now, I'd want to make possible that when I push on the icon to get the menu opened back into a regular window the background sound gets back playing, but I don't understand how to do this.
I thought that logically it had to have something to do with putting something in the tab of the page properties, like in the sections "on show" or "on enter", but whatever I tried didn't seem to work. Can anybody help me to fix this, please?
Thank you very much.
yosik
11-12-2005, 03:22 PM
check this thread.
http://www.indigorose.com/forums/showthread.php?t=13098&highlight=hotspot
Hope it helps
Yossi
rhosk
11-12-2005, 03:29 PM
Another option, maybe set a variable and have it checked during the On Size event? I've never tried it, but I think in theory it would work.
d3m0n1x
04-26-2006, 04:45 PM
I been trying to get my program to pause background audio on minimize and play background audio on restore.
Now I added a system try menu that makes it work but I still have a couple problems with it.
The main problem is when minimized audio is paused but when you double click the system tray icon the program is restored but audio stays paused.
Another problem I'm having with program is I'm trying to make it disable minimize when restored & disable restore when minimized.
Basically what I'm trying to do is have my menu work as the regular menu would but the regular menu only has Restore, Minimize and Quit and I'm planning on adding more items to it. :rolleyes
Could someone help me with this plz :huh
Here is the following code I'm using in Global Functions:
function g_OnSystemTrayMenu(X, Y)
tblMenu = {};
tblMenu[1] ={};
tblMenu[1].Text = "Restore";
tblMenu[1].ID = 1;
tblMenu[1].Checked = false;
tblMenu[1].Enabled = true;
tblMenu[2] ={};
tblMenu[2].Text = "Minimize";
tblMenu[2].ID = 2;
tblMenu[2].Checked = false;
tblMenu[2].Enabled = true;
tblMenu[3] ={};
tblMenu[3].Text = "Quit";
tblMenu[3].ID = 3;
tblMenu[3].Checked = false;
tblMenu[3].Enabled = true;
nTrayMenu = Application.ShowPopupMenu(X, Y, tblMenu, TPM_RIGHTALIGN, TPM_BOTTOMALIGN, true, false);
if nTrayMenu == 1 then
Audio.Play(CHANNEL_BACKGROUND);
Application.Restore();
end
if nTrayMenu == 2 then
Audio.Pause(CHANNEL_BACKGROUND);
Application.Minimize();
end
if nTrayMenu == 3 then
Application.Exit();
end
end
d3m0n1x
04-26-2006, 05:40 PM
Only thing I could think of is changing the follwing code from:
if nTrayMenu == 1 then
Audio.Play(CHANNEL_BACKGROUND);
Application.Restore();
end
if nTrayMenu == 2 then
Audio.Pause(CHANNEL_BACKGROUND);
Application.Minimize();
end
to
if nTrayMenu == 1 then
Audio.Play(CHANNEL_BACKGROUND);
Window.Show(Application.GetWndHandle());
end
if nTrayMenu == 2 then
Audio.Pause(CHANNEL_BACKGROUND);
Window.Hide(Application.GetWndHandle());
end
Then when you double click on the try icon the program won't even show up. But I was wondering if there was a way that you could still double click on the tray icon, have the program show and background audio play again. :huh
Joe GeTo
12-28-2008, 04:21 PM
I solved double-click:
On 1 page - On mouse move
if i==0 then
jj = String.ToNumber(DLL.CallFunction(_SystemFolder.."\\User32.dll", "IsIconic", Application.GetWndHandle(), DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL))
if jj == 0 then
Audio.Play(CHANNEL_BACKGROUND);
i=i+1;
end
end
On minimalization button - On click
Window.Minimize(Application.GetWndHandle());
Audio.Pause(CHANNEL_BACKGROUND);
i=0;
This code isnt nice but I work with this programm very short time. Thanks
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.