Solved

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

Posted on 2007-11-25
8
221 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
  • 4
  • 3
8 Comments
 
LVL 55

Assisted Solution

by:Jaime Olivares
Jaime Olivares earned 150 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 350 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 

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 350 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
 

Author Comment

by:Troudeloup
ID: 20352665
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

828 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