Solved

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

Posted on 2007-11-25
8
218 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
 

Author Comment

by:Troudeloup
ID: 20346790
is it like, functions that would work only if I use visual studio c++, like express?
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
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.

758 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now