PBXB64 Clipboard & Shell

Clipboard & Shell Standard

Full clipboard and shell integration with CLIPBOARD SET/GET/RESET, SHELL, ENVIRON, and COMMAND. Real Win32 clipboard API (OpenClipboard, SetClipboardData, GetClipboardData) with atomic round-trip tests.

Clipboard Operations

Clipboard round-trip
#COMPILE EXE #DIM ALL FUNCTION PBMAIN() AS LONG LOCAL text AS STRING LOCAL result AS QUAD ' Set text to clipboard (result: 0 = success, -1 = failure) CLIPBOARD SET TEXT "Hello from PBXB64", result PRINT "Set status: "; result ' Get text back CLIPBOARD GET TEXT TO text, result PRINT "Clipboard: "; text; " (status "; result; ")" ' Clear clipboard CLIPBOARD RESET , result PRINT "Reset status: "; result FUNCTION = 0 END FUNCTION

CLIPBOARD SET TEXT places text on the clipboard. CLIPBOARD GET TEXT TO retrieves it. CLIPBOARD RESET empties the clipboard. Each statement takes a result variable (0 = success, -1 = failure). All tests run atomically in a single process (test_clipboard_combined.pb) to avoid inter-test race conditions.

SHELL, ENVIRON, COMMAND

Shell and environment
FUNCTION PBMAIN() AS LONG LOCAL path AS STRING LOCAL cmd AS STRING ' Read environment variable path = ENVIRON$("PATH") PRINT "PATH length: "; LEN(path) ' Get command line cmd = COMMAND$ PRINT "Command: "; cmd ' Launch program SHELL "notepad" FUNCTION = 0 END FUNCTION

ENVIRON$ reads environment variables via GetEnvironmentVariable. COMMAND$ returns the command line via GetCommandLine. SHELL launches programs via CreateProcess. All real Win32 API calls.

Back to feature list