Okay i need help understanding this function. I need to know the HWND of a window. but i dont know how to get that. Also is it different for every computer? or what?

So say i execute my console program and paint is open or some other program. So when in the console program i press say... p and it switches to paint.

how would i do that? Thanks in advance!

sorry if this doesnt make very much sense...

meb111>I need to know the HWND of a window.

It's a Window data type.
CreateWindow or CreateWindowEx() function returns a window handle that uniquely identifies the window. A program uses this handle to direct their actions to that window.

>but i dont know how to get that.
Through FindWindow or FindWindowEx.

>Also is it different for every computer? or what?
Yes

>So say i execute my console program and paint is open or some other program. So when in the console program i press say... p and it switches to paint. how would i do that?

Find the HWND of Paint and use SwitchToThisWindow function.
you may also uses SetActiveWindow, and SetWindowPos.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.