Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2007-11-25
8
Medium Priority
?
228 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
Technology Partners: 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!

 

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

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…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
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.

636 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