MCPcopy Create free account
hub / github.com/ActiveState/code / _callback

Method _callback

recipes/Python/577654_DDE_Client/recipe-577654.py:206–218  ·  view source on GitHub ↗
(self, wType, uFmt, hConv, hsz1, hsz2, hDdeData, dwData1, dwData2)

Source from the content-addressed store, hash-verified

204 print "%s: %s" % (item, value)
205
206 def _callback(self, wType, uFmt, hConv, hsz1, hsz2, hDdeData, dwData1, dwData2):
207 if wType == XTYP_ADVDATA:
208 from ctypes import byref, create_string_buffer
209
210 dwSize = DWORD(0)
211 pData = DDE.AccessData(hDdeData, byref(dwSize))
212 if pData:
213 item = create_string_buffer('\000' * 128)
214 DDE.QueryString(self._idInst, hsz2, item, 128, 1004)
215 self.callback(pData, item.value)
216 DDE.UnaccessData(hDdeData)
217 return DDE_FACK
218 return 0
219
220def WinMSGLoop():
221 """Run the main windows message loop."""

Callers 6

_set_valueMethod · 0.80
readMethod · 0.80
__init__Method · 0.80
readlinesMethod · 0.80
unwatchMethod · 0.80
readMethod · 0.80

Calls 1

callbackMethod · 0.95

Tested by

no test coverage detected