DLL in windows, Palettes running procedures silently
- To: mathgroup at smc.vnet.net
- Subject: [mg54013] DLL in windows, Palettes running procedures silently
- From: Erich Neuwirth <erich.neuwirth at univie.ac.at>
- Date: Mon, 7 Feb 2005 03:13:05 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
Answering my own question: mciExecute = DefineDLLFunction["mciExecute", "winmm.dll", "LONG", {"LPSTR"}] is what I needed to be able to call WinAPI finctions from within MAthematica. Now I have SetCurrentMidi[filename_] := (CurrentMidiFile = filename;) PlayMidi[filename_] := mciExecute["play " <> filename] StopMidi[filename_] := mciExecute["stop " <> filename] PlayCurrent := (PlayMidi[CurrentMidiFile];) StopCurrent := (StopMidi[CurrentMidiFile];) and I would like to have PlayCurrent and StopCurrent on palette buttons which do put the call into the notebook, just call the functions silently and also, since there is no needed output, also do not produce anything as output. Can this be done? I have been unable to accomplish this playing with the options for buttons.