Waitrud Weber’s blog

things and reminders for memories

Copy and Paste 003 :Problem

https://github.com/WaitrudWeber/source_zip/blob/master/winmain-20190109.zip
https://docs.microsoft.com/en-us/windows/desktop/dataxchg/using-the-clipboard

.\winmain_001.exe

1. Press Ctl+C in Explore with Selected file.

2. Press Ctl and then 'v'

 

In source code:

 IsClipboardFormatAvailable(CF_TEXT)) returns false. so, clipboard is not CF_TEXT.

And IsClipboardFormatAvailable(uLabelFormat) returns also false.

That means clipboard is not CF_TEXT and any other.

The proofment of it is you could see DefaultH on the main screen.

 

        m_replace_selection = (char*)"DefaultB";
        if (!IsClipboardFormatAvailable(CF_TEXT)) {
         flag_CF_TEXT = false;
        }

       if ( flag_CF_TEXT == true ) {

       ...

       }

...

 // the below doesn't work well, so I commented out it.
//    if (!IsClipboardFormatAvailable(uLabelFormat))
//        return;

 

        CASE WM_COMMAND:
        {
         uLabelFormat = LOWORD(wParam);

         ...

        }

 

I'm pleasure if you download the below.

https://github.com/WaitrudWeber/source_zip/blob/master/winmain-20190109.zip


Please reffer to the below for compilation.
https://waitrudweber.hatenablog.com/entry/2018/05/01/005938