Solved

Pass RECT to LPARAM in EnumWindows

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article describes how to add a user-defined command button to the Windows 7 Explorer toolbar.  In the previous article (http://www.experts-exchange.com/A_2172.html), we saw how to put the Delete button back there where it belongs.  "Delete" is …
If you have ever found yourself doing a repetitive action with the mouse and keyboard, and if you have even a little programming experience, there is a good chance that you can use a text editor to whip together a sort of macro to automate the proce…
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

758 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

20 Experts available now in Live!

Get 1:1 Help Now