Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........
Started by KQ4TX, September 26, 2009, 09:06:04 am
0 Members and 1 Guest are viewing this topic.
Quotesuccess = LOADRESOURCE(ID, Type, Variable)
QuoteIf 'variable' is a STRING (or ISTRING) variable the contents of the resource will be copied into the string.
def snd as string
def snd as stringHANDLE= LOADRESOURCE("SH21",WAVE,SND)
DEF win:WINDOWDEF mySound:MEMORYDEF success:INTwindow win,100,100,245,202,@caption|@minbox,0,"Wave Resource Test",MainWndProccontrol win,"B,Play,84,142,72,24,0x800000,1"control win,"B,Exit,160,142,75,24,0x800000,2"centerwindow win'success will just tell you if the resource was loaded.'100 is the resource ID.'WAVE is the Custom Type.'mySound is the memory variable the sound data is loaded into.success = loadresource(100,"WAVE",mySound)if success = 0 messagebox win,"Unable to load Wave Resource", "Wave Resource Test"endifrun = 1waituntil run = 0'Make sure to free the MEMORY variablefreemem mySoundclosewindow winendMainWndProc: select @class case @idcontrol select @controlid case 1 playwave mySound,@SNDASYNC case 2 run = 0 endselect case @IDDESTROY run = 0 case @idclosewindow run = 0 endselectreturn