Solved

Pass RECT to LPARAM in EnumWindows

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

919 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now