Module: GAtom

Defined in:
lib/vr/sysmod.rb

Constant Summary collapse

GlobalAddAtom =

GAtom

This is for utilizing Global Atoms.

— GAtom::Add(text)

Create a new global atom whose name is ((|text|)).

— GAtom::Delete(atm)

Delete ((|atm|)) of global atom.

— GAtom::GetName(atm)

Returns name of ((|atm|)) of global atom.
Win32API.new("kernel32","GlobalAddAtom",["P"],"I")
GlobalDeleteAtom =
Win32API.new("kernel32","GlobalDeleteAtom",["I"],"I")
GlobalGetAtomName =
Win32API.new("kernel32","GlobalGetAtomName",["I","P","I"],"I")

Class Method Summary collapse

Class Method Details

.Add(text) ⇒ Object



65
# File 'lib/vr/sysmod.rb', line 65

def GAtom::Add(text) (0xffff & GlobalAddAtom.call(text.to_s)) end

.Delete(atm) ⇒ Object



66
# File 'lib/vr/sysmod.rb', line 66

def GAtom::Delete(atm) GlobalDeleteAtom.call(atm) end

.GetName(atm) ⇒ Object



68
69
70
71
72
# File 'lib/vr/sysmod.rb', line 68

def GAtom::GetName(atm)
  buffer=" "*256
  r = GlobalGetAtomName.call(atm,buffer,256)
  buffer[0,r]
end