How to add popup in my style?

I created an application that launches in the taskbar. When a user clicks on an application, it pops up, etc. I would like the functionality to be similar to the functionality in MSN when one of my friends logs in. Apparently this is called a popup? Basically, I want something from the application on the taskbar to pop up every 20 minutes.

My existing winforms-based application is written in C # .net 3.5

+10
c # winforms
Jan 20 '09 at 12:54
source share
5 answers

It is pretty simple. You just need to set the window in an unshielded area and animate its position until it is fully visible. Here is a sample code:

public partial class Form1 : Form { private Timer timer; private int startPosX; private int startPosY; public Form1() { InitializeComponent(); // We want our window to be the top most TopMost = true; // Pop doesn't need to be shown in task bar ShowInTaskbar = false; // Create and run timer for animation timer = new Timer(); timer.Interval = 50; timer.Tick += timer_Tick; } protected override void OnLoad(EventArgs e) { // Move window out of screen startPosX = Screen.PrimaryScreen.WorkingArea.Width - Width; startPosY = Screen.PrimaryScreen.WorkingArea.Height; SetDesktopLocation(startPosX, startPosY); base.OnLoad(e); // Begin animation timer.Start(); } void timer_Tick(object sender, EventArgs e) { //Lift window by 5 pixels startPosY -= 5; //If window is fully visible stop the timer if (startPosY < Screen.PrimaryScreen.WorkingArea.Height - Height) timer.Stop(); else SetDesktopLocation(startPosX, startPosY); } } 
+23
Jan 20 '09 at 13:44
source share

Notification support in Win32 (I'm not a .net programmer), with some useful features, an old new thing explains .

There is also a semaphore in the system that you must block to prevent more than one pop-up from simultaneously appearing from any application.

There is a couple of pages on the tomato semaphore on msdn - a tomato semaphore and in a wider context of usability . I also stumbled upon some sample code to use the api balloon from C # while watching, but can't vouch for it.

+4
Jan 20 '09 at 13:56
source share
+2
Jul 25 '14 at 19:45
source share

For customizable and more convenient notifications ..

Check out this link ..

0
Nov 10 '17 at 16:54 on
source share

You move the form from the screen to the right, and then lift it. This would never lead to viewing the desktop. X axis - right and left, Y axis - up and down. Adding to the X axis leads to further law, and adding to the Y axis leads to further reduction.

-one
Apr 17 2018-10-17T00:
source share



All Articles