Win32 API SetClipboardData
#5
Okay workaround works!

Code: (Select All)
' To test have another QB64 IDE open and some text you want copied highlighted.
' Run this program and click the title bar of the other open IDE, so it is active. You have 4-seconds to do so.
' When you hear the beep, open notepad and do a paste. You should see the content of your IDE highlighted text.

DECLARE DYNAMIC LIBRARY "user32"
    SUB SENDKEYS ALIAS keybd_event (BYVAL bVk AS LONG, BYVAL bScan AS LONG, BYVAL dwFlags AS LONG, BYVAL dwExtraInfo AS LONG)
END DECLARE

CONST KEYEVENTF_KEYUP = &H2
CONST VK_ALT = &H12 'Alt key

SLEEP 4 ' Hurry, click on your other QB64 highlighted text IDE.

SENDKEYS VK_ALT, 0, 0, 0
SENDKEYS &H45, 0, 0, 0 ' Alt+E open IDE edit menu.
SENDKEYS &H43, 0, 0, 0 ' C

SENDKEYS &H43, 0, KEYEVENTF_KEYUP, 0
SENDKEYS &H45, 0, KEYEVENTF_KEYUP, 0
SENDKEYS VK_ALT, 0, KEYEVENTF_KEYUP, 0

BEEP ' All done, check your clipboard contents!
_DELAY 3
END

Pete
Reply


Messages In This Thread
Win32 API SetClipboardData - by Pete - 11-03-2022, 12:00 PM
RE: Win32 API SetClipboardData - by mnrvovrfc - 11-03-2022, 12:27 PM
RE: Win32 API SetClipboardData - by Pete - 11-03-2022, 04:39 PM
RE: Win32 API SetClipboardData - by Pete - 11-03-2022, 05:20 PM



Users browsing this thread: 1 Guest(s)