🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #13066

Re: (ATTN: Remy) Find window handle from exe file name

#13066
From: Ed Mulroy [TeamB]
Date: Sat, 25 Oct 2003 03:09
28 lines
2484 bytes
I think he needs to add a define of STRICT, the macro which Microsoft
created to be used in all Windows programs to set the expansion of the
header files for work with versions newer than the 16 bit Windows 3.0.  The
macro must be defined before the inclusion of the Windows header files and
is best placed in the IDE's Project|Options|Defines/Conditionals or if using
the command line as -DSTRICT on the compiler command line to the left of the
first file name.

Without the define the Windows header file has an empty list, a (), for the
argument list to the prototype of the EnumWindowsProc argument to
EnumWindows.

This is the same cause as you see causing people to need to cast the WinProc
name when they set the pointer value in a WNDPROC structure prior to calling
RegisterClass.

.  Ed

> Remy Lebeau wrote in message
> news:3f99d356$1@newsgroups.borland.com...
>
> > [C++ Error] Unit2.cpp(100): E2034 Cannot convert
> >  'int (__stdcall *)(void *,long)' to 'int (__stdcall *)()'
>
> You need to cast the first parameter to WNDENUMPROC.
> Even though your callback function is the correct signature,
> for whatever reason Microsoft made EnumWindows() expect
> the WNDENUMPROC signature instead.
Technical Details
Message-ID: <3f99e98a@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.media.kyoto-u.ac.jp!newsfeed.icl.net!newsfeed.fjserv.net!news-xfer2.atl.newshosting.com!63.218.45.10.MISMATCH!newshosting.com!news-xfer1.atl.newshosting.com!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <3f930de8@newsgroups.borland.com> <3f930eb2$1@newsgroups.borland.com> <3f931b5b@newsgroups.borland.com> <3f99caaa@newsgroups.borland.com> <3f99d356$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,dcd8305ed53c9568
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-10-24 20:28:31 PST
From: "Ed Mulroy [TeamB]" <dont_email_me@bitbuc.ket>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3f930de8@newsgroups.borland.com> <3f930eb2$1@newsgroups.borland.com> <3f931b5b@newsgroups.borland.com> <3f99caaa@newsgroups.borland.com> <3f99d356$1@newsgroups.borland.com>
Subject: Re: (ATTN: Remy) Find window handle from exe file name
Date: Fri, 24 Oct 2003 23:09:49 -0400
Lines: 30
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: 24.74.175.102
Message-ID: <3f99e98a@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1067051402 24.74.175.102 (24 Oct 2003 20:10:02 -0700)
X-Authenticated-User: edmulroy
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.media.kyoto-u.ac.jp!newsfeed.icl.net!newsfeed.fjserv.net!news-xfer2.atl.newshosting.com!63.218.45.10.MISMATCH!newshosting.com!news-xfer1.atl.newshosting.com!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail