473,394 Members | 1,751 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Getting External Focus

I'm trying to get (or set) the focus on an external window but to no avail. I've imported the "GetActiveWindow" and "GetFocus" from the user32.dll but those 2 functions seem to only work for windows my application owns... I can get the hWnd of the process I want to check/set focus on. Any help would be greatly appresated.

Just to be a little more clear, say NotePad is up; I'm trying to make my program set focus to the opened Notepad Process (though its hWnd if possible?), or check when the opened NotePad process gets focus. Thanks
Nov 16 '05 #1
1 2262
To get the focus of another application use

int hwnd = FindWindow(null,"App titile");

//use this handle to set the focus or bring window to top.

Shak.
<Qu****@hotmail.com> wrote in message news:2GRAc.18170$by2.3302@edtnps84...
I'm trying to get (or set) the focus on an external window but to no avail. I've imported the "GetActiveWindow" and "GetFocus" from the
user32.dll but those 2 functions seem to only work for windows my
application owns... I can get the hWnd of the process I want to check/set
focus on. Any help would be greatly appresated.
Just to be a little more clear, say NotePad is up; I'm trying to make my program set focus to the opened Notepad Process (though its hWnd if
possible?), or check when the opened NotePad process gets focus. Thanks

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Petec | last post by:
Is there a way to prevent a form from getting focus? Thanks! - Pete
0
by: Dave | last post by:
Hello, I am writing an On-screen keyboard, similar to the one included in windows 2k and XP. The problem I am having is that I need my keyboard to never get the focus, but still be able to...
55
by: salad | last post by:
I have contained in a listbox the Window's caption, the class name for the window, and the hWND of the window. Is there a way, using the data from above, to activate/set focus to that window?
2
by: Khadim | last post by:
Hi, I am having this problem with my application that it is not getting itself in taskbar by itself.. i m working on this application for 5 months, don't know what happened at what time that its...
1
by: Prasad | last post by:
HI all, <!-- ======== This is the division with width & height set to 100% and z-index to -1 =======- --> <div...
5
by: althafexcel | last post by:
hi everyone Im trying to include an external js in my aspx page under the head tag, it doesn't load or it displays an object expected error whenver the function from the .js is called. Actually...
1
by: cvairetti | last post by:
Hi, I just write an application in C# that show an interface with five button, each button starts an external application that it comes in front of the main C# application with focus on. When the...
5
by: Ian | last post by:
I am trying to: 1. Open a form on the external database 2. Enter a value in a text box on that form I have 1 above working OK using module form “The Access Web”, the module looks like this: ...
2
by: =?Utf-8?B?VmFuZXNzYQ==?= | last post by:
Hi all! I have one combobox, two grids and nine textbox. All textbox are tab index one following another. When I press tab I go to the next textbox. How can I known if I click on another...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.