473,382 Members | 1,635 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,382 software developers and data experts.

C# - APP - HELP with selecting windows..

Question:
How do you put focus back in your application window programatically when another application window opens up (say,, a pop-up)? How do you put your application window on top and currently selected/active, programatically?

Alternatively, is it possible NOT TO LOSE FOCUS in the first place?


Note:
showDialog() cannot be used here.. because we cannot stop (close()) the application from running.

i have heard and read of the SetForegroundWindow function, but have no idea and confused on how to use it,, or if it will even work.


APP runs on .NET1.1 Platform, Windows CE 4.1
Sep 5 '07 #1
3 939
Shashi Sadasivan
1,435 Expert 1GB
Hi flashSiverlight,
Seems you have run into a non solvable problem!
I did try to look around for some hints.
Picked up this forum
http://support.microsoft.com/kb/186908
It does tell you how to check if your application looses focus.
Its all in VB, and i couldnt get my head around it. If you get it or not please do let me know. I would also like to figure it out

cheers

Question:
How do you put focus back in your application window programatically when another application window opens up (say,, a pop-up)? How do you put your application window on top and currently selected/active, programatically?

Alternatively, is it possible NOT TO LOSE FOCUS in the first place?


Note:
showDialog() cannot be used here.. because we cannot stop (close()) the application from running.

i have heard and read of the SetForegroundWindow function, but have no idea and confused on how to use it,, or if it will even work.


APP runs on .NET1.1 Platform, Windows CE 4.1
Sep 5 '07 #2
Shashi Sadasivan
1,435 Expert 1GB
this seems to be a code made for what you want

http://www.vbprofs.com/Source_Codes/...always_on_top/
cheers
Sep 5 '07 #3
do you know how to translate that to c#? i couldn't seem to figure it out at all... thanks in advanced!

(btw, i tried a SetForegroundWindow code,, it worked, but then it raised an error.. so i gues we can't use it either.)

this seems to be a code made for what you want

http://www.vbprofs.com/Source_Codes/...always_on_top/
cheers
Sep 6 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Guy | last post by:
I have extended the datetimepicker control to incorporate a ReadOnly property. I have used the new keyword to implement my own version of the value property, so that if readonly == true then it...
6
by: aaa | last post by:
Hi I am trying to create a read-only DataGrid that would always have current row selected. Currently, I am using method: public void SelectDataGridRow(DataGrid dg) { if (dg.CurrentRowIndex >...
2
by: David Anderson | last post by:
I'm working on a Windows app that has a ListView containing a bunch of items. When the user clicks on an item, the app displays the item'd details. The user then has the opportunity to edit these...
0
by: dicky2283 | last post by:
windows development community please help me im deepak roy , doing my final year undergrad in computer science.... im doing a project - Motion detection and Tracking in vc++( video for...
1
by: nate axtell | last post by:
In VB .Net I made a custom CheckBox column style (for the Datagrid control) that maps to two DataTable columns , one it uses for the Checked status and the other it uses for the Enabled status. I am...
1
by: clintonG | last post by:
I'm having a problem maintaining state with a Panel control in a MasterPage and I need help thinking through this process. The basic structure of the HTML in the Master looks like this... ...
1
by: relisoft | last post by:
SEATTLE, Washington. - July 12, 2006: Reliable Software® announces the upcoming release of Code Co-op® version 5.0. Code Co-op is an affordable peer-to-peer version control system for distributed...
8
by: rn5a | last post by:
I have a HTML page named Index.html which is divided into 3 frames. The URL of 2 of the frames are HTML pages but the 3rd frame houses a ASP page. Now when I go to Windows Explorer, navigate to...
7
by: Rotsey | last post by:
Hi, I am having a problem trying to select an item with the enter key. I want to work the combo with the keyboard. So when I use the down arrow to browse the list I want to then hit the...
11
by: Randy | last post by:
I have a MonthCalendar on one of my forms. I have disovered that the DateChanged event is triggered not only when the user clicks on a new date, but also if they click on the Previous or Next...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.