MCPcopy
hub / github.com/pandas-dev/pandas / init_windows_clipboard

Function init_windows_clipboard

pandas/io/clipboard/__init__.py:339–502  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

337
338
339def init_windows_clipboard():
340 global HGLOBAL, LPVOID, DWORD, LPCSTR, INT
341 global HWND, HINSTANCE, HMENU, BOOL, UINT, HANDLE
342 from ctypes.wintypes import (
343 BOOL,
344 DWORD,
345 HANDLE,
346 HGLOBAL,
347 HINSTANCE,
348 HMENU,
349 HWND,
350 INT,
351 LPCSTR,
352 LPVOID,
353 UINT,
354 )
355
356 windll = ctypes.windll
357 msvcrt = ctypes.CDLL("msvcrt")
358
359 safeCreateWindowExA = CheckedCall(windll.user32.CreateWindowExA)
360 safeCreateWindowExA.argtypes = [
361 DWORD,
362 LPCSTR,
363 LPCSTR,
364 DWORD,
365 INT,
366 INT,
367 INT,
368 INT,
369 HWND,
370 HMENU,
371 HINSTANCE,
372 LPVOID,
373 ]
374 safeCreateWindowExA.restype = HWND
375
376 safeDestroyWindow = CheckedCall(windll.user32.DestroyWindow)
377 safeDestroyWindow.argtypes = [HWND]
378 safeDestroyWindow.restype = BOOL
379
380 OpenClipboard = windll.user32.OpenClipboard
381 OpenClipboard.argtypes = [HWND]
382 OpenClipboard.restype = BOOL
383
384 safeCloseClipboard = CheckedCall(windll.user32.CloseClipboard)
385 safeCloseClipboard.argtypes = []
386 safeCloseClipboard.restype = BOOL
387
388 safeEmptyClipboard = CheckedCall(windll.user32.EmptyClipboard)
389 safeEmptyClipboard.argtypes = []
390 safeEmptyClipboard.restype = BOOL
391
392 safeGetClipboardData = CheckedCall(windll.user32.GetClipboardData)
393 safeGetClipboardData.argtypes = [UINT]
394 safeGetClipboardData.restype = HANDLE
395
396 safeSetClipboardData = CheckedCall(windll.user32.SetClipboardData)

Callers 1

determine_clipboardFunction · 0.85

Calls 1

CheckedCallClass · 0.85

Tested by

no test coverage detected