How to change the message icon if a message is received - django

I've built a chat app using Django Channels. To check messages I should click on the message icon (just like stackoverflow for example). I want to add the feature enabling to have these small red circles on the message icon indicating the number of messages not read and I don't even know what I should type on Google to look for this. Any suggestions ?
Thanks!

Related

Google Glass voice command send activity to background

I do an example that launch the voice command on an activity, but when the "ok glass" shown on the bottom of the screen, the activity came to background ( it's looks like my activity goes more transparent ... )
There is a way that this doen't happen? I would like to made that ... transparent, but when I say "ok glass" not when the activity load that on the bottom ...
any idea?
If I understand correctly your question, you want to customize the Contextual Voice Command, by deleting the gray overlay above your activity.
If yes, I wanted to do the same thing but with XE19 we do not have this possibility yet.
I asked a question and got a respons with a custom solution if you are interested :
Custom Voice Input
EDIT: I also find another solution customizing the Voice Input From google, but it won't work when the XE will be upgraded : Another Custom Voice Input

Show Message Bar in ribbon mfc

Probabbly i am not sure what to search for ... But the idea is to display a message bar bellow ribbon control. When user try to edit a read only file. I don't want user to click on OK to remove error message. Thats why i can't use MessageBox.
Status bar doesn't seem right place to display error messages.
Which control i should start exploring.
MSOffice normally displays such message when user opens files in protected view .
I don't want you to do research for me, I just want the right direction i will do the rest.
Thanks
You can easily use CMFCCaptionBar for such an attempt. When you create a ribbon bar SDI application you get sample code for free.
Also it is possible to hide and Show such a bar on the fly with ShowWindow. Also this code is generated by the wizard.

How I can I detect the file dragged over my window

I have window created using win32 api. How can I detect if a file is dragged (not dropped) over my window? And how to get list of filenames. I know DragAcceptFiles/WM_DROPFILES messages but they don't register for dragging. I get the message when the user drops. So I cannot show if the dragged files can be dropped to that location or the file type is valid etc... I tried with Spy++ I am definitely getting no message, however when I check explorer windows I see that they are passing custom messages (WM_USER+210).
I am searching for a winapi only solution.
To answer my question with the help of Raymond Chen,
Register your window as drop target.
http://www.catch22.net/tuts/drop-target
http://msdn.microsoft.com/en-us/library/windows/desktop/bb776904(v=vs.85).aspx
and read file drop data using
http://msdn.microsoft.com/en-us/library/windows/desktop/bb776902(v=vs.85).aspx

How to send mouse click event to a game application?

I try to send a mouse click event to a game application. First, i use Spy++ to find what message the application receive. I see something like : WM_MOUSEACTIVATE, WM_WINDOWPOSCHANGING, WM_ACTIVATEAPP, WM_ACTIVATE, WM_SETFOCUS, ...
i try to send the same as i see on Spy++ but it doesn't work. How to send mouse click to a game application without give it focus? . it's run in window mode. Thanks in advance.
You want WM_LMOUSEDOWN. You can always check MSDN for the documentation on which messages mean what.
The best way to automate applications and games is via SendInput. While in theory it should be possible to drive an application via WM_LUBTTONDOWN etc, many applications read the key state directly via lower level APIs (such as GetAsyncKeyState) which don't change their state to reflect the messages processed from the message queue.
Using SendInput requires actually setting the game to the foreground as the input events are synthesized at a low level and are thus delivered to the active/focused window.

Display Outlook icon in notification area for messages, not in inbox

I have rules set to move some email messages into different folders. I would like this to still show the envelope in the notification area but there is no option in the rules wizard to do this. It looks like I would either have to have the rule "run a script" or "perform a custom action" allowing either vba or c/c++ respectively.
Anyone else have a better solution?
You can also achieve it not by using a rule, but doing the rule-like action in code. For example:
Private Sub Application_NewMailEx(ByVal EntryIDCollection As String)
Dim mai As Object
Dim strEntryId
For Each strEntryId In Split(EntryIDCollection, ",")
Set mai = Application.Session.GetItemFromID(strEntryId)
If mai.Parent = "Inbox" Then
If mai.SenderEmailAddress = "the-email-address-the-rule-applies-to" Then
mai.Move Application.GetNamespace("MAPI").GetFolderFromID("the-entry-ID-of-the-folder-you-want-to-move-the-message-to")
End If
End If
Set mai = Nothing
Next
End Sub
How to get the folder ID (i.e., entryID of the folder):
This is just a manual way, you could make a recursive procedure but for simple purposes this is fine. For instance, I had a structure like:
Mailbox - My_Name_Here
Inbox
The Subfolder I'm Looking For
Sent Items
...
So in the Immediate window I typed:
? Application.GetNamespace("MAPI").Folders(1)
and increased the number until I got "Mailbox - My_Name_Here"
then, I typed:
? Application.GetNamespace("MAPI").Folders(the_number_of_my_mailbox).Folders(1)
increasing the number until I got "Inbox".
Then:
? Application.GetNamespace("MAPI").Folders(the_number_of_my_mailbox).Folders(the_number_of_my_Inbox).Folders(1)
increasing the number until I got "The Subfolder I'm Looking For"
Then:
? Application.GetNamespace("MAPI").Folders(the_number_of_my_mailbox).Folders(the_number_of_my_Inbox).Folders(the_number_of_the_subfolder_i_was_looking_for).EntryID
And that was it: the entryID of the folder I wanted to move the message to. You get the point, I'm sure :)
Check out MailAlert, an Outlook plug-in that does exactly that. It still works in Outlook 2007 (although I've had some instabilities since I installed it again recently, which may or may not be related).
The new version of Mail Alert, which was just released, will allow you to control the notification icon as well as the popup alert and sound alerts. Here are some of the new features in 2.0:
Audible alerts - plays a sound for incoming e-mails
Notification area alerts - displays a notification area (system tray) icon
Program alerts - runs a program and can pass information from the incoming e-mail to that program
Mute feature - to quickly suppress all alerts
Microsoft Outlook 2007 support
Multi-monitor support
Unicode Exchange server support
And more desktop alert features:
Aero Glass style alert windows (on Windows Vista)
Ability to easily dismiss the alert window
Ability to quickly open, reply [to all] or forward a message directly from the alert window's buttons
Ability to convert a message into a task, flag a message for follow up or move a message to another folder; all directly from the alert window's context menu
Ability to set the default position of alerts to be where ever you want them
Privacy option to require a click before showing the preview of the message body
there is an option "display a Desktop Alert" on the Step 1 of the Rules Wizard. it does the trick. this wizard can be run when editing the concrete rule.