Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Pass RECT to LPARAM in EnumWindows

Posted on 2003-12-03
2
Medium Priority
?
662 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 200 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

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…
This article surveys and compares options for encoding and decoding base64 data.  It includes source code in C++ as well as examples of how to use standard Windows API functions for these tasks. We'll look at the algorithms — how encoding and decodi…
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…
Integration Management Part 2

877 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