Returning Window Position Given Handle

C

Calum Maciver

Hey Guys!,

I'm very new to c++ and need to write a really simple program. I've
downloaded Visual C++ 2008, on recomendation from a friend and have
the following task to perform. I need to create a program, that given
a window name such as "Internet Explorer" maximises that specific
window and returns the top left co-ordinate. I presume that I need to
use the Windows API however after glancing over a few tutorials I feel
it is taking a long time to discover the answer and I only need a
simple solution. After I have this information I will use JNI and do
the rest in Java. Any pointers and sample code would be much
appreciated.
 
C

Christopher

Hey Guys!,

I'm very new to c++ and need to write a really simple program. I've
downloaded Visual C++ 2008, on recomendation from a friend and have
the following task to perform. I need to create a program, that given
a window name such as "Internet Explorer" maximises that specific
window and returns the top left co-ordinate. I presume that I need to
use the Windows API however after glancing over a few tutorials I feel
it is taking a long time to discover the answer and I only need a
simple solution. After I have this information I will use JNI and do
the rest in Java. Any pointers and sample code would be much
appreciated.

Not the type of thing to do at all if you are a beginner. After 6
months to a year maybe...
At any rate it is Off Topic in this newsgroup. I'd recommend one of
the microsoft.public newsgroups
 
C

Calum Maciver

How hard can it be? I've programmed in other languages I just don't
have any experience with programming for Windows. I understand the
concepts of programming just not the specific details for making a
Windows program, and it's a pretty simple program I'm looking for so I
thought you guys might give a quick example.
 
C

Christopher

How hard can it be? I've programmed in other languages I just don't
have any experience with programming for Windows.

Neither does this newsgroup. While the people on it may or may not
have programmed in Windows, the newsgroup itself does not consider
Windows Programming expertise topical. If you want someone whom may
have Windows programming expertise, than it it best to ask on a
newsgroup where Windows Programming is the topic. There are quite a
few with high traffic in the microsoft.public hierarchy. I frequent a
few myself.

I understand the
concepts of programming just not the specific details for making a
Windows program, and it's a pretty simple program I'm looking for so I
thought you guys might give a quick example.

Every topic one learns in life can be subdivided into sub-topics that
require yet another decade to master. Being good at programming
doesn't mean you will be good at Windows Programming. Being good at
Windows Programming doesn't make you good at DirectX programming.
Being good at DirectX programming, doesn't make you good at Flight
Simulation programming. etc. etc.

It may help, but it won't allow you to jump right in.

C++ does not come with insta-gui capability like some "languages". C++
has no concept of GUI. 3rd Party libraries do. They are all a task
within themselves to learn.

However, you won't learn them here. You will learn the language itself
and get answers about the language itself, because that is what we are
for. Then you can use that to dig into whatever libraries you desire
and ask about them elsewhere where you are more apt to get help and
the help will be of better quality.
 
R

Ron AF Greve

Hi,

Wel basically you do a
Create a (dialog based app) in VS.
You put in a button, add a handler for the button, in the handler do
something with
FindWindowEx
SetWindowPos

I haven't tried it and this seems an hour of work or so, but in my
experience hooking up different technoligies windows and java, doing things
with other applications (how do they react when you resize from another app)
from the outside often lead to things you don't expect. And that might
result in a lot of reading internet searching etc.

You might get lucky and get it done in a day but it is more likely that it
is going to take a lot more time.

But the above would be a could start, but also browse through the rest of
the windows functions with the link provided earlier.


Regards, Ron AF Greve

http://www.InformationSuperHighway.eu
 
R

Rui Maciel

Calum said:
I'm very new to c++ and need to write a really simple program. I've
downloaded Visual C++ 2008, on recomendation from a friend and have
the following task to perform.

Not a good friend.

I need to create a program, that given
a window name such as "Internet Explorer" maximises that specific
window and returns the top left co-ordinate. I presume that I need to
use the Windows API however after glancing over a few tutorials I feel
it is taking a long time to discover the answer and I only need a
simple solution.

That's the thing. The C++ standard does not define anything related to
window management or GUIs. Therefore, as this group is dedicated to the
discussions regarding the C++ language and the C++ standards, you won't be
able to get much help around here. On the other hand, I do believe you will
get the help you need if you put that question in any newsgroup dedicated
to your target platform and API.


Hope this helps
Rui Maciel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,184
Messages
2,570,973
Members
47,529
Latest member
JaclynShum

Latest Threads

Top