Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Detecting New Window

Status
Not open for further replies.

ViperInc

Programmer
Mar 13, 2001
24
0
0
AU
Hi fellow programmers,

I just want to write a simple program which detects when a new window pops-up, and work out/report where the window is located.
What is the easiest way to detect a new window?

Any input is appreciated!

Thank-you

VPR
 
Hi,

Thanks for API info.
I managed to work out what i need, and then figured out i needed to use C/C++ to use the API functions(not VB or java) :).

The problem now is, that i have very limited use of c/c++.
so far i have;

#include "stdafx.h"
#include "Winuser.h"
#include "Windows.h"

int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
//for(!stop) - loop until stopped, maybe with button?

typedef struct coOrd { LONG left;
LONG top;
LONG right;
LONG bottom;
} RECT, *PRECT;

BOOL GetClientRect(HWND GetForegroundWindow(VOID),LPRECT coOrd);
}


now, from what ive gathered, it will create the coOrd structure, and then put the forground co-orinated into it.

how can i access these co-ordinates, and put them into a file. how easy is it to add a go/stop button.

i am very un-skilled at c, any help would be greatly appreciated.

thank-you
VPR
 
You could always try one of the C or C++ forums
forum116
forum205
forum207

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'If we're supposed to work in Hex, why have we only got A fingers?'
 
This is (relatively) straightforward, and just requires a CBT hook. We have previously used these in examples on repurposing Input Boxes. So a keyword search of the forum against "CBT hook input box" should find some info to set you on an apprpriate path
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top