Working with muliple source files

I was wondering about working with mulitple source files. In the project that I'm working on at the moment, I have several header files and several cpp files. The only problem is that in one or two of the classes (which are in separate header files), there are a few methods I made which take the a handle to the window (really its a HWND handle, but in the example below I used a HANDLE handle), I was wondering if there is any way of making a variable visible to just a few header files? I've heard of the extern keyword being used for something similar to that, but never used it. Is there a better way to do it than just declare it as a global variable and make it visible to all source code files? Is there any way to pass source code files arguments, like functions and methods, so if I passed an argument to example.h then that would be like a global variable declaration in example.h?

In the example above, I have methods in EXAMPLE1, which take hOut as a parameter, but I wanna keep hOut local, but if I do that, I have problems with the way the methods are defined in example1.h

What kind of problems do you have?

Originally Posted by Bjarne Stroustrup (2000-10-14)

I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.