Solved

Pass RECT to LPARAM in EnumWindows

Posted on 2003-12-03
2
642 Views
Last Modified: 2013-12-03
I know I'm just missing something, but I'm trying to pass a RECT structure to LPARAM in the EnumWindows function. When I pass a reference to it, for some reason when I try to get the RECT structure again, it doesn't have the right values. I just need a little help getting the structure properly.

Here's how I'm calling EnumWindows:
EnumWindows((WNDENUMPROC)EnumWndProc, (LPARAM)&r);

Now, I can really remember how to get the value from LPARAM into a RECT. Just a simple code example is all I need.

Thanks to anyone who helps. =)
0
Comment
Question by:Veratil
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 19

Accepted Solution

by:
Dexstar earned 50 total points
ID: 9870100
@Veratil:

> Now, I can really remember how to get the value from LPARAM into a RECT. Just
> a simple code example is all I need.

Cast the LPARAM value into a RECT pointer (or LPRECT), and then dereference the members using the -> operator.

  LPRECT lpRect = (LPRECT)lParam;
  printf( "top = %d\n"), lpRect->top );

Let me know what else isn't clear.

Hope That Helps,
Dex*
0
 

Author Comment

by:Veratil
ID: 9870144
Thank you! That worked. I knew I was forgetting something, and that was it (the LPRECT).
0

Featured Post

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question