473,487 Members | 2,452 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

problem with hiding windows

3 New Member
Hello everybody!

i've got new problem (which , as i suppose , shouldn;t be a problem for you)

Here is the code:

Expand|Select|Wrap|Line Numbers
  1. protected void notify_click(Object sender, System.EventArgs e)
  2.  
  3. {
  4.  
  5. iHandle = winapi.FindWindow("Win v1.x", null);
  6.  
  7. MessageBox.Show("a" + iHandle + " ss " + winapi.GetForegroundWindow());
  8.  
  9. if (iHandle == (int)winapi.GetForegroundWindow())
  10.  
  11. {
  12.  
  13.  
  14. winapi.ShowWindow((IntPtr)iHandle, winapi.SW_HIDE);
  15.  
  16. }
  17.  
  18. else
  19.  
  20. {
  21.  
  22. winapi.SetForegroundWindow((IntPtr)iHandle);
  23.  
  24. }
  25.  
  26. }
  27.  
  28.  
winapi is static class thats import winapi functions

When i click on tray icon everything is fine, because Window ("Win v1.x") is going on top position, but when i click on tray again Window doesn't go to background position. Can you tell me why?

thanks for reply
Aug 2 '07 #1
0 955

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

Similar topics

7
2678
by: Les Juby | last post by:
I have a customer with an extensive intranet which contains a lot of sensitive company data. The client is concerned that any employee could download source code back to removable storage and...
2
9905
by: Chris Plowman | last post by:
Hi all, I was wondering if anyone can help me with a really annoying problem I have been having. I made a derived datagrid class that will select the row when a user clicks anywhere on a cell...
3
5599
by: James Spibey | last post by:
Hi, I have an MDI application which has aboout 10 child windows. The way the app needs to work is that only one window should be visible at a time and it should be maximized within the parent...
17
2894
by: Bob Weiner | last post by:
What is the purpose of hiding intead of overriding a method? I have googled the question but haven't found anything that makes any sense of it. In the code below, the only difference is that...
3
1548
by: Javaman59 | last post by:
I've spent the last 3 years programming VC++, and learnt that Windows programming is all about messages. Now I'm doing C#, and there isn't a windows message to be seen! Now, I don't miss those...
0
2562
by: Bob Davies | last post by:
Hi I have a webservice that retrieves data from a database, this is then returned to the calling client application built in windows forms within a dataset, however upon attempting to create...
1
6109
by: Phil_Cam | last post by:
Hello All On a webpage I have a standard paypal image button for purchases. I am trying to set it up so that it only shows up or is endabled when text is entered into a textbox and a button is...
7
1749
by: Steve954 | last post by:
I recently installed and started using VS2005 on a Windows XP Pro machine. When creating a new windows forms project I find that I am unable to hide any forms using the me.hide() or me.visible =...
14
2382
by: Dom | last post by:
Hi all I'm developing a control, and I need to hide some properties to the user. For example, suppose I need Text property to be completely inacessible (from a Form/Code that is into another...
162
10060
by: Sh4wn | last post by:
Hi, first, python is one of my fav languages, and i'll definitely keep developing with it. But, there's 1 one thing what I -really- miss: data hiding. I know member vars are private when you...
0
7106
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
6967
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
7137
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7349
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...
0
5442
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4565
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3071
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1381
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
267
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.