Article View: borland.public.cppbuilder.nativeapi
Article #2400Using EnumWindows in C++Builder
From: Dan
Date: Wed, 28 Feb 2007 17:16
Date: Wed, 28 Feb 2007 17:16
16 lines
1456 bytes
1456 bytes
Hi, I am trying to use the EnumWindows function in a VCL application,
however, I am getting an error:
"[C++ Error] Main.cpp(106): E2034 Cannot convert 'int (__stdcall *)(void
*,long)' to 'int (__stdcall *)()'"
The call looks like this:
EnumWindows(EnumWindowsProc, NULL);
My EnnumWindowsProc function looks like this:
BOOL CALLBACK EnumWindowsProc(HANDLE hWnd, LPARAM lparam);
Which, I think, matches the Win32 Programming Reference. The code
compiles if I remove the parameters from the EnumWindowsProc function;
however, then I don't know how to get a handle to the hWnd being
enumerated. What am I doing wrong?
Technical Details
Message-ID:
<45e5b922$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news.maxwell.syr.edu!panix!newsfeed.media.kyoto-u.ac.jp!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,3d6d0bffd82e483c,start X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit Date: Wed, 28 Feb 2007 11:16:14 -0600 From: Dan <Dan@do.not.spam> User-Agent: Thunderbird 1.5.0.9 (Windows/20061207) MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.nativeapi Subject: Using EnumWindows in C++Builder Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 216.174.165.174 Message-ID: <45e5b922$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1172683042 216.174.165.174 (28 Feb 2007 09:17:22 -0800) Lines: 16 Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news.maxwell.syr.edu!panix!newsfeed.media.kyoto-u.ac.jp!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail