Re: Problems using AddClipboardFormatListener, RemoveClipboardFormatListener and WM_CLIPBOARDUPDATE
Test User <[email protected]> Tue, 26 Nov 2024 04:23:17 -0500
| Newsgroups | gmane.comp.gnu.mingw.user |
|---|---|
| Message-ID | <CAH7jLrtt0i2EV+ScPH6=+pr+ptAGp_tb7LfQOHqj+M2F-u-51Q@mail.gmail.com> |
--===============3595424958031270798== Content-Type: multipart/alternative; boundary="000000000000d47c4e0627cd66a9" --000000000000d47c4e0627cd66a9 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello Zerro, What do you mean by 'orphaned'? Regards, Test. On Mon, Nov 25, 2024, 3:00=E2=80=AFPM 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 clipboar= d. > > 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. =E2=80=93lextra > > > > 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 wh= y > > 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=3Dmailing.html#list-etiquette. > > I keep trying to view this, but Firefox reports "Unable to connect" and > > ping mingw.osdn.io reports "Request timed out." > > > > _______________________________________________ > > MinGW-Users mailing list > > [email protected] > > _______________________________________________ > MinGW-Users mailing list > [email protected] > > This list observes the Posting Etiquette, as described at > https://mingw.osdn.io/index.html?page=3Dmailing.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=3Dunsubscribe --000000000000d47c4e0627cd66a9 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div dir=3D"auto"><div>Hello Zerro,</div><div><br></div><d= iv>What do you mean by 'orphaned'?</div><div><br></div><div>Regards= ,</div><div>Test.<br><br><div class=3D"gmail_quote"><div dir=3D"ltr" class= =3D"gmail_attr">On Mon, Nov 25, 2024, 3:00=E2=80=AFPM Zerro <<a href=3D"= mailto:[email protected]" target=3D"_blank">[email protected]</a>> wrote:<= br></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;borde= r-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 cli= pboard.<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' undecla= red".=C2=A0 So I added<br> > "#define WM_CLIPBOARDUPDATE 0x031D" to the program.=C2=A0 No= w it fails to link with<br> > "undefined reference to `AddClipboardFormatListener'" an= d "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<b= r> > 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.<b= r> > I used the details for OpenClipboard as a guide because this has the<b= r> > 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. =E2=80=93lextra<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 bu= t<br> > AddClipboardFormatListener@4 is not found.=C2=A0 Using findstr /m,<br> > OpenClipboard is found<br> > in user32.dll but OpenClipboard@4 is not found.=C2=A0 I do not underst= and 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.=C2=A0 I d= on't<br> > like doing this because<br> > the calling conventions won't agree.=C2=A0 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.=C2=A0 I think it would be a big job t= o<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 libr= ary 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=3D"https://mingw.osdn.io/index.html?page=3Dmailing.html#list-e= tiquette" rel=3D"noreferrer noreferrer" target=3D"_blank">https://mingw.osd= n.io/index.html?page=3Dmailing.html#list-etiquette</a>.<br> > I keep trying to view this, but Firefox reports "Unable to connec= t" and<br> > ping <a href=3D"http://mingw.osdn.io" rel=3D"noreferrer noreferrer" ta= rget=3D"_blank">mingw.osdn.io</a> reports "Request timed out."<br= > ><br> > _______________________________________________<br> > MinGW-Users mailing list<br> > <a href=3D"mailto:[email protected]" rel=3D"noreferrer" target= =3D"_blank">[email protected]</a><br> <br> _______________________________________________<br> MinGW-Users mailing list<br> <a href=3D"mailto:[email protected]" rel=3D"noreferrer" target=3D"_= blank">[email protected]</a><br> <br> This list observes the Posting Etiquette, as described at <a href=3D"https:= //mingw.osdn.io/index.html?page=3Dmailing.html#list-etiquette" rel=3D"noref= errer noreferrer" target=3D"_blank">https://mingw.osdn.io/index.html?page= =3Dmailing.html#list-etiquette</a>.<br> We ask that you be polite and do the same.=C2=A0 Disregard for the list eti= quette may cause your account to be moderated.<br> <br> _______________________________________________<br> You may change your MinGW Account Options or unsubscribe at:<br> <a href=3D"https://lists.osdn.me/mailman/listinfo/mingw-users" rel=3D"noref= errer noreferrer" target=3D"_blank">https://lists.osdn.me/mailman/listinfo/= mingw-users</a><br> Also: mailto:<a href=3D"mailto:[email protected]" rel=3D"no= referrer" target=3D"_blank">[email protected]</a>?subject= =3Dunsubscribe</blockquote></div></div></div> </div> --000000000000d47c4e0627cd66a9-- --===============3595424958031270798== 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= --===============3595424958031270798==--