?
Solved

get window handle and making window move around and making them take focus

Posted on 2007-11-25
8
Medium Priority
?
225 Views
Last Modified: 2010-04-01
how do I get window handle and move them around?

and make them take focus?
0
Comment
Question by:Troudeloup
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
8 Comments
 
LVL 55

Assisted Solution

by:Jaime Olivares
Jaime Olivares earned 600 total points
ID: 20346484
are you talking about your own window? or a 3rd-party window?
0
 

Author Comment

by:Troudeloup
ID: 20346770
any top level window,

such as notepad.exe
0
 
LVL 86

Assisted Solution

by:jkr
jkr earned 1400 total points
ID: 20346783
To get the handle, use 'FindWindow()' (http://msdn2.microsoft.com/en-us/library/ms633499.aspx), to move it, use 'MoveWindow()' (http://msdn2.microsoft.com/en-us/library/ms633534.aspx), e.g.

HWND hwnd = FindWindow(NULL,"notepad.exe");

// check for error

MoveWindow(hwnd,100,200,300,300,TRUE);
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:Troudeloup
ID: 20346790
is it like, functions that would work only if I use visual studio c++, like express?
0
 
LVL 86

Accepted Solution

by:
jkr earned 1400 total points
ID: 20346803
No, both of them work on all compilers that can create programs for teh Windows platform. All you need is

#include <windows.h>
0
 

Author Comment

by:Troudeloup
ID: 20346822
will you take  a look of the keyboard and mouse events?
0
 
LVL 86

Expert Comment

by:jkr
ID: 20346832
Done ;o)
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
Suggested Courses

765 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