Solved

Pass RECT to LPARAM in EnumWindows

Posted on 2003-12-03
2
636 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article shows how to make a Windows 7 gadget that accepts files dropped from the Windows Explorer.  It also illustrates how to give your gadget a non-rectangular shape and how to add some nifty visual effects to text displayed in a your gadget.…
As more and more people are shifting to the latest .Net frameworks, the windows presentation framework is gaining importance by the day. Many people are now turning to WPF controls to provide a rich user experience. I have been using WPF controls fo…
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…

738 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