How to send a message to WIN10 action center? - winforms

In order to make a quickstar/launcher,I want to make a resident message always show in action center,that would be unable to clear this message like android moblie top notification untill close my app.
and once click this message,my function launched,and message will still show in the action center.
I would be like to use WinForm to accomplish it,it's possible?

As per my knowledge, Only balloon notifications (Toasts) end up in action center. If user doesn't respond to a notification or click "close" it ends up in action center. When user clicks on it, it is marked as "read" and goes away. I don't think it is possible to create a non-dismissable message in action center. However you can create your own custom form outside action center like in corner of desktop

Related

Service should be init in its parent controller or itself?

I have a web app layout like below screenshot.
It has several menus, and in each menu we have several tabs on the left sidebar:
if some configuration in one tab is wrong, I want to get notified even i was opening another tab.
Currently for each tabs, i have 1 service map to it, e.g. tab1 -> tab1Service, tab2 -> tab2Service.
Each service will have an init method to initial the data for each tab(tabCtrl), and it will only be called once i click that tab.
So here is the question:
If i want to got notified which tab has an error when i first go into this menu, i have to call that tabService init in the parent controller also, otherwise the error icon won't be displayed.
If i am going to do like this, once i refresh the page on a sub tab, the init method will be call twice consecutively, which isn't very good.
Does anyone know is there a better solution for this? I think it should be a common case in web development, hope someone could help me on this.

ext js accordion

http://www.myethiopia.org/QuickLinks/accordion.html
Please check this link in IE. I did not have time to figure out why it is not working in Firefox. I am trying to click on a link on the left column and have the page open in the center.
If you click on Weather Station and Oromiya Station, the title opens up fine but the link does not even open. Line No.325 under var menu1, look at the first item for the code. What am I doing wrong?
Second question. I want a round bulltein or outline type of thing (not sure what to call it) to the left of the Oromiya station. HOw can I do that?
Checkbox is not what I am looking for.
If you want to update the centerpanel html you can use the update() function.
In this small example I've added an 'id' to the center panel and then in the handler function for the menu item used this code to show an update.
var centerRegion = Ext.getCmp('centerpanel');
centerRegion.update('<iframe src="http://www.myethiopia.org/QuickLinks/Weather/EthiopiaWeatherStations/Amharastations.html" style="width:100%;height:100%"></iframe>');
I'm not exactly sure what you are trying to do but it looks like you want to load the grid into the centerpanel, you can do that directly without having to load in a separate html page.

gtk_message_dialog in a GtkCombo callback

I'm developing an app in C using Gtk. I have a GtkCombo with some restrictions that should launch an error message when user selects wrong entries in the list. The problem is that when callback launches the error message, pop-down string is still open, and if the user moves the mouse over it, the list acts as if all entries under the mouse pointer where clicked. This behavior stops if the user clicks on an empty window area or other GtkWidget. I've tried changing the focus to another widget, launching button_release signal...
Anyone knows how to prevent this bug?
Try connecting the signal with g_signal_connect_after() instead of g_signal_connect(). The callback should run after the combo popdown has finished all its reactions to the click.

WP7 - Determine where the app will go when the "back" button is pressed

I'm working on a WP7 appliation with Silverlight. When a user clicks the back button, I want to determine where they will go to. Is there a way to determine where a user will go without managing my own nav stack?
thanks!
To respond to the question that has actually been asked "Is there a way to determine where a user will go without managing my own nav stack?"
You could use the OnNavigatingFrom override the eventargs of which carries the Uri of the page being navigated to. I suspect this is only useful when the navigation is back to page within your app.
You cannot override what the back button does - the rule Derek mentioned is enforced by the system and the previous page/app will always be called.
You can, however, add an action to be executed on back key press:
this.BackKeyPress += new EventHandler<System.ComponentModel.CancelEventArgs>(MainPage_BackKeyPress);
Then just use the handler:
void MainPage_BackKeyPress(object sender, System.ComponentModel.CancelEventArgs e)
{
// Your activity goes here
}
The application will go back to the previous page when the user presses the Back button. If the user is at the last page in the application, then the application will exit and the user will be navigated to the previous application. To perform anything else would be inconsistent, confusing to the user, and almost certainly would fail certification.
In general you'll want to build your app composed of pages (similar to a website). For example a HyperlinkButton might be used like this:
<HyperlinkButton NavigateUri="/Page2.xaml" Content="Click here to enter page 2"/>
After clicking that then pressing the back button will automatically return to the previous page. There's no extra programming involved to make this happen... it just works.
But there are some circumstances where you'll want to override the back button. The one I ran into was the dialog box. If your app creates a dialog box, then the back button should close it instead of returning to the previous page. I wrote a brief article about how to accomplish this.
And here's a complete list of rules from Microsoft's certification requirements concerning the back button:
To maintain a consistent user
experience, the Back button must only
be used for backwards navigation in
the application.
a. Pressing the Back button from the
first screen of an application must
exit the application.
b. Pressing the Back button must
return the application to the previous
page.
c. If the current page displays a
context menu or a dialog, the pressing
of the Back button must close the menu
or dialog and cancel the backward
navigation to the previous page.
d. For games, when the Back button is
pressed during gameplay, the game can
choose to present a pause context menu
or dialog or navigate the user to the
prior menu screen. Pressing the Back
button again while in a paused context
menu or dialog closes the menu or
dialog.
As I found out, if you don't follow those rules they won't approve your app.

Show NotifyIcon Context Menu and Control Its Position?

I'm trying to show a context menu when I left-click a NotifyIcon. Just calling NotifyIcon.ContextMenuStrip.Show() doesn't work very well. A solution has been posted here before that calls a secret method using Reflection:
Dim mi As System.Reflection.MethodInfo = GetType(NotifyIcon).GetMethod("ShowContextMenu", Reflection.BindingFlags.Instance Or Reflection.BindingFlags.NonPublic)
mi.Invoke(Icon, Nothing)
This works great, except that I also need to control where the menu is shown. I want to wait for the SystemInformation.DoubleClickTime to elapse between receiving the NotifyIcon.MouseUp event and displaying the menu, so that I can handle single-clicks and double-clicks separately. But invoking the ShowContextMenu method displays the menu at the current mouse position when ShowContextMenu is called, not when the icon was actually clicked. Which means that if the mouse moved during the DoubleClickTime, the menu will be displayed in a different part of the screen. So if I can control where the menu is shown, I can just save the mouse coordinates when I receive the MouseUp event, and then I can ensure that the menu is displayed near the icon. Is there a way to do this?
Thanks in advance.
Well, I just discovered that there are existing programs that exhibit this same behavior. I just went through all the icons in my system tray and about half of them do it. If you left-click the icon and then move the mouse during the delay before the menu appears, the menu will appear at the last mouse location, wherever that is on the screen. Snagit is one application that does this. Outlook is the only program in my tray that always shows the menu where I clicked the icon. But Snagit looks like it's using a .NET ContextMenuStrip, while Outlook is probably using a native menu.
So either this is standard behavior, or it's a problem that no one else has been able to solve either. And as a user, I've never noticed this behavior until yesterday when I was testing my own application. So I guess it's not that big of a deal and I won't worry about it.

Resources