MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

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.



  • Prev by Date: Re: Vertex labeling
  • Next by Date: Re: Finding extra digit
  • Previous by thread: Web services feature in Mathematica v5.1
  • Next by thread: Problem using Evaluate[] inside a Plot command. 5.1