Re: Problems using AddClipboardFormatListener, RemoveClipboardFormatListener and WM_CLIPBOARDUPDATE
Zerro <[email protected]> Tue, 26 Nov 2024 11:14:35 +0100
| Newsgroups | gmane.comp.gnu.mingw.user |
|---|---|
| Organization | Cebuned |
| Message-ID | <[email protected]> |
This is a multi-part message in MIME format. --===============4575508882218500849== Content-Type: multipart/alternative; boundary="------------ZLYG155gulUyw0WLDYguZQNB" Content-Language: en-US This is a multi-part message in MIME format. --------------ZLYG155gulUyw0WLDYguZQNB Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hello Test, The last maintainer in the project Keith Marshall left the project more than 5 years ago. So there are no more updates to be expected. It is so to say 'orphaned'. Regards, Zerro On 11/26/24 10:23 AM, Test User wrote: > Hello Zerro, > > What do you mean by 'orphaned'? > > Regards, > Test. > > On Mon, Nov 25, 2024, 3:00 PM Zerro <[email protected]> wrote: > > Hi Paul, > > The MinGW project has been orphaned already for some time. > > Maybe you could try the MinGW-w64 project, which does seem to be > maintained well. > > Regards, ~Z > > On 11/25/24 7:24 PM, Paul Dewhirst wrote: > > I've written a simple program which reports data placed on the > clipboard. > > It uses AddClipboardFormatListener, > RemoveClipboardFormatListener and > > WM_CLIPBOARDUPDATE. > > It compiles OK with the Microsoft C/C++ compiler, but fails to > compile with gcc. > > > > The first problem is "error: 'WM_CLIPBOARDUPDATE' undeclared". > So I added > > "#define WM_CLIPBOARDUPDATE 0x031D" to the program. Now it > fails to link with > > "undefined reference to `AddClipboardFormatListener'" and "undefined > > reference to > > `RemoveClipboardFormatListener'". > > > > The winuser.h and libuser32.a in my installation of gcc do not > contain > > these items. > > Perhaps if I download the latest win32api it will have files > which do > > contain these items. > > I downloaded w32api-5.3.4-mingw32-dev.tar.xz and extracted winuser.h > > and libuser32.a, > > but these don't contain the items either. > > > > So I produced my own header and library file to include these items. > > I used the details for OpenClipboard as a guide because this has the > > same parameter > > and result profile. > > > > File listener.h: > > #define WM_CLIPBOARDUPDATE 0x031D > > WINUSERAPI BOOL WINAPI AddClipboardFormatListener (HWND); > > WINUSERAPI BOOL WINAPI RemoveClipboardFormatListener (HWND); > > > > File listener.def: > > LIBRARY user32.dll > > EXPORTS > > AddClipboardFormatListener@4 > > RemoveClipboardFormatListener@4 > > > > Then run dlltool: > > dlltool -d listener.def -l libextra.a > > > > Then compile using these files: > > gcc -g -o c:\bin\clip_view.exe clip_view.c -L. –lextra > > > > This compiles and links but it fails when run with "The > procedure entry point > > AddClipboardFormatListener@4 could not be located in the dynamic > link > > library user32.dll. > > Using findstr /m, AddClipboardFormatListener is found in > user32.dll but > > AddClipboardFormatListener@4 is not found. Using findstr /m, > > OpenClipboard is found > > in user32.dll but OpenClipboard@4 is not found. I do not > understand why > > AddClipboardFormatListener fails but OpenClipboard works. > > > > If I comment out the function declarations in listener.h and remove > > the @4 in listener.def, > > rerun dlltool and recompile, it compiles, links and runs OK. I > don't > > like doing this because > > the calling conventions won't agree. Perhaps it is OK for > > AddClipboardFormatListener > > which is only called once, but might cause problems for something > > called repeatedly. > > Can anybody work out what is going on here? > > > > I compared a user32.def generated using > pexports-0.48-mingw32-bin from > > my Windows 7 > > user32.dll with the user32.def from w32api-5.3.4-mingw32-src > (with the > > @nn stripped). > > There are about 200 differences. I think it would be a big job to > > update all the > > header files and the library file for these differences, so I don't > > expect it to happen. > > So it would be good if we could sort out using our own header > and library files > > to include the needed missing items. > > > > I'm sorry if this post does not comply with the Posting > Etiquette, as > > described at > > https://mingw.osdn.io/index.html?page=mailing.html#list-etiquette. > > I keep trying to view this, but Firefox reports "Unable to > connect" and > > ping mingw.osdn.io <http://mingw.osdn.io> reports "Request timed > out." > > _______________________________________________ > MinGW-Users mailing list > [email protected] > > This list observes the Posting Etiquette, as described athttps://mingw.osdn.io/index.html?page=mailing.html#list-etiquette. > We ask that you be polite and do the same. Disregard for the list etiquette may cause your account to be moderated. > > _______________________________________________ > You may change your MinGW Account Options or unsubscribe at: > https://lists.osdn.me/mailman/listinfo/mingw-users > Also:mailto:[email protected]?subject=unsubscribe --------------ZLYG155gulUyw0WLDYguZQNB Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> </head> <body> <div class="moz-cite-prefix">Hello Test,</div> <div class="moz-cite-prefix"><br> </div> <div class="moz-cite-prefix">The last maintainer in the project Keith Marshall left the project more than 5 years ago.</div> <div class="moz-cite-prefix">So there are no more updates to be expected.</div> <div class="moz-cite-prefix">It is so to say 'orphaned'.</div> <div class="moz-cite-prefix"><br> </div> <div class="moz-cite-prefix">Regards, Zerro<br> </div> <br> <div class="moz-cite-prefix">On 11/26/24 10:23 AM, Test User wrote:<br> </div> <blockquote type="cite" cite="mid:CAH7jLrtt0i2EV+ScPH6=+pr+ptAGp_tb7LfQOHqj+M2F-u-51Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org"> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <div dir="ltr"> <div dir="auto"> <div>Hello Zerro,</div> <div><br> </div> <div>What do you mean by 'orphaned'?</div> <div><br> </div> <div>Regards,</div> <div>Test.<br> <br> <div class="gmail_quote"> <div dir="ltr" class="gmail_attr">On Mon, Nov 25, 2024, 3:00 PM Zerro <<a href="mailto:[email protected]" target="_blank" moz-do-not-send="true" class="moz-txt-link-freetext">[email protected]</a>> wrote:<br> </div> <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Paul,<br> <br> The MinGW project has been orphaned already for some time.<br> <br> Maybe you could try the MinGW-w64 project, which does seem to be <br> maintained well.<br> <br> Regards, ~Z<br> <br> On 11/25/24 7:24 PM, Paul Dewhirst wrote:<br> > I've written a simple program which reports data placed on the clipboard.<br> > It uses AddClipboardFormatListener, RemoveClipboardFormatListener and<br> > WM_CLIPBOARDUPDATE.<br> > It compiles OK with the Microsoft C/C++ compiler, but fails to compile with gcc.<br> ><br> > The first problem is "error: 'WM_CLIPBOARDUPDATE' undeclared". So I added<br> > "#define WM_CLIPBOARDUPDATE 0x031D" to the program. Now it fails to link with<br> > "undefined reference to `AddClipboardFormatListener'" and "undefined<br> > reference to<br> > `RemoveClipboardFormatListener'".<br> ><br> > The winuser.h and libuser32.a in my installation of gcc do not contain<br> > these items.<br> > Perhaps if I download the latest win32api it will have files which do<br> > contain these items.<br> > I downloaded w32api-5.3.4-mingw32-dev.tar.xz and extracted winuser.h<br> > and libuser32.a,<br> > but these don't contain the items either.<br> ><br> > So I produced my own header and library file to include these items.<br> > I used the details for OpenClipboard as a guide because this has the<br> > same parameter<br> > and result profile.<br> ><br> > File listener.h:<br> > #define WM_CLIPBOARDUPDATE 0x031D<br> > WINUSERAPI BOOL WINAPI AddClipboardFormatListener (HWND);<br> > WINUSERAPI BOOL WINAPI RemoveClipboardFormatListener (HWND);<br> ><br> > File listener.def:<br> > LIBRARY user32.dll<br> > EXPORTS<br> > AddClipboardFormatListener@4<br> > RemoveClipboardFormatListener@4<br> ><br> > Then run dlltool:<br> > dlltool -d listener.def -l libextra.a<br> ><br> > Then compile using these files:<br> > gcc -g -o c:\bin\clip_view.exe clip_view.c -L. –lextra<br> ><br> > This compiles and links but it fails when run with "The procedure entry point<br> > AddClipboardFormatListener@4 could not be located in the dynamic link<br> > library user32.dll.<br> > Using findstr /m, AddClipboardFormatListener is found in user32.dll but<br> > AddClipboardFormatListener@4 is not found. Using findstr /m,<br> > OpenClipboard is found<br> > in user32.dll but OpenClipboard@4 is not found. I do not understand why<br> > AddClipboardFormatListener fails but OpenClipboard works.<br> ><br> > If I comment out the function declarations in listener.h and remove<br> > the @4 in listener.def,<br> > rerun dlltool and recompile, it compiles, links and runs OK. I don't<br> > like doing this because<br> > the calling conventions won't agree. Perhaps it is OK for<br> > AddClipboardFormatListener<br> > which is only called once, but might cause problems for something<br> > called repeatedly.<br> > Can anybody work out what is going on here?<br> ><br> > I compared a user32.def generated using pexports-0.48-mingw32-bin from<br> > my Windows 7<br> > user32.dll with the user32.def from w32api-5.3.4-mingw32-src (with the<br> > @nn stripped).<br> > There are about 200 differences. I think it would be a big job to<br> > update all the<br> > header files and the library file for these differences, so I don't<br> > expect it to happen.<br> > So it would be good if we could sort out using our own header and library files<br> > to include the needed missing items.<br> ><br> > I'm sorry if this post does not comply with the Posting Etiquette, as<br> > described at<br> > <a href="https://mingw.osdn.io/index.html?page=mailing.html#list-etiquette" rel="noreferrer noreferrer" target="_blank" moz-do-not-send="true" class="moz-txt-link-freetext">https://mingw.osdn.io/index.html?page=mailing.html#list-etiquette</a>.<br> > I keep trying to view this, but Firefox reports "Unable to connect" and<br> > ping <a href="http://mingw.osdn.io" rel="noreferrer noreferrer" target="_blank" moz-do-not-send="true">mingw.osdn.io</a> reports "Request timed out."<br> </blockquote> </div> </div> </div> </div> <fieldset class="moz-mime-attachment-header"></fieldset> <pre wrap="" class="moz-quote-pre">_______________________________________________ MinGW-Users mailing list <a class="moz-txt-link-abbreviated" href="mailto:[email protected]">[email protected]</a> This list observes the Posting Etiquette, as described at <a class="moz-txt-link-freetext" href="https://mingw.osdn.io/index.html?page=mailing.html#list-etiquette">https://mingw.osdn.io/index.html?page=mailing.html#list-etiquette</a>. We ask that you be polite and do the same. Disregard for the list etiquette may cause your account to be moderated. _______________________________________________ You may change your MinGW Account Options or unsubscribe at: <a class="moz-txt-link-freetext" href="https://lists.osdn.me/mailman/listinfo/mingw-users">https://lists.osdn.me/mailman/listinfo/mingw-users</a> Also: <a class="moz-txt-link-freetext" href="mailto:[email protected]?subject=unsubscribe">mailto:[email protected]?subject=unsubscribe</a></pre> </blockquote> <p><br> </p> </body> </html> --------------ZLYG155gulUyw0WLDYguZQNB-- --===============4575508882218500849== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KTWluR1ctVXNl cnMgbWFpbGluZyBsaXN0Ck1pbkdXLVVzZXJzQGxpc3RzLm9zZG4ubWUKClRoaXMgbGlzdCBvYnNl cnZlcyB0aGUgUG9zdGluZyBFdGlxdWV0dGUsIGFzIGRlc2NyaWJlZCBhdCBodHRwczovL21pbmd3 Lm9zZG4uaW8vaW5kZXguaHRtbD9wYWdlPW1haWxpbmcuaHRtbCNsaXN0LWV0aXF1ZXR0ZS4KV2Ug YXNrIHRoYXQgeW91IGJlIHBvbGl0ZSBhbmQgZG8gdGhlIHNhbWUuICBEaXNyZWdhcmQgZm9yIHRo ZSBsaXN0IGV0aXF1ZXR0ZSBtYXkgY2F1c2UgeW91ciBhY2NvdW50IHRvIGJlIG1vZGVyYXRlZC4K Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCllvdSBtYXkg Y2hhbmdlIHlvdXIgTWluR1cgQWNjb3VudCBPcHRpb25zIG9yIHVuc3Vic2NyaWJlIGF0OgpodHRw czovL2xpc3RzLm9zZG4ubWUvbWFpbG1hbi9saXN0aW5mby9taW5ndy11c2VycwpBbHNvOiBtYWls dG86bWluZ3ctdXNlcnMtcmVxdWVzdEBsaXN0cy5vc2RuLm1lP3N1YmplY3Q9dW5zdWJzY3JpYmU= --===============4575508882218500849==--