messages

WM_SYSCOMMAND oddities

泪湿孤枕 提交于 2020-01-15 09:54:20
问题 An application recieves the WM_SYSCOMMAND message when the user selects a menu item command on the system menu, and so wParam can be SC_CLOSE, SC_CONTEXTHELP, SC_MAXIMIZE, SC_MINIMIZE, SC_RESTORE etc. That's logical. (Of course you can also send these messages by clicking on the minimize, maximize, close buttons etc.) But one can also send the WM_SYSCOMMAND message to send commands to the Windows Shell. For instance, one can display the start menu (SC_TASKLIST), activate the screen saver (SC

Sending a message to an application started by a different windows' user session

六眼飞鱼酱① 提交于 2020-01-15 06:55:23
问题 A desktop app (made in Delphi) is started by User A. Let's call it "Instance A". User A does a "switch user" and User B logs in. User B runs the same application. Let's call it "Instance B" What I want now, is a way for the Instance B to send messages to Instance A. I tried the following: Instance A writes its handle in a file, so Instance B can open that file, read the handle, and use it to post a message to Instance A, but it doesn't work -- perhaps for security reasons Windows doesn't give

erlang processes and message passing architecture

本小妞迷上赌 提交于 2020-01-14 22:53:52
问题 The task I have in hand is to read the lines of large file, process them, and return ordered results. My algorithm is: start with master process that will evaluate the workload (written in the first line of the file) spawn worker processes: each worker will read part of the file using pread/3, process this part, and send results to master master receives all sub-results, sort, and return so basically no communication needed between workers. My questions: How to find the optimal balance

Redirect while passing message in django

不羁岁月 提交于 2020-01-13 03:59:06
问题 I'm trying to run a redirect after I check to see if the user_settings exist for a user (if they don't exist - the user is taken to the form to input and save them). I want to redirect the user to the appropriate form and give them the message that they have to 'save their settings', so they know why they are being redirected. The function looks like this: def trip_email(request): try: user_settings = Settings.objects.get(user_id=request.user.id) except Exception as e: messages.error(request,

Redirect while passing message in django

别来无恙 提交于 2020-01-13 03:59:05
问题 I'm trying to run a redirect after I check to see if the user_settings exist for a user (if they don't exist - the user is taken to the form to input and save them). I want to redirect the user to the appropriate form and give them the message that they have to 'save their settings', so they know why they are being redirected. The function looks like this: def trip_email(request): try: user_settings = Settings.objects.get(user_id=request.user.id) except Exception as e: messages.error(request,

How to get openfire chat room messages history

假如想象 提交于 2020-01-05 10:11:10
问题 I use Strophe library to connect to an OpenFire XMPP server. How can I receive the chat room messages history ? var o = {to:'roomName@conference.domain.com/youNick'}; var m = $pres(o); m.c('x', {xmlns : 'http://jabber.org/protocol/muc#user'}, null); connection.send(m.tree()); I get only 25 messages when I join room. How to get past 25 message of the chat room ? 回答1: You should add a <history/> element: https://xmpp.org/extensions/xep-0045.html#enter-managehistory. <x xmlns='http://jabber.org

How can I transfer bytes in chunks to clients?

情到浓时终转凉″ 提交于 2020-01-02 03:55:07
问题 SignalR loses many messages when I transfer chunks of bytes from client over server to client (or client to server; or server to client). I read the file into a stream and sent it over a hub or persistent connection to other client. This runs very fast, but there are always messages dropped or lost. How can I transfer large files (in chunks or not) from client to client without losing messages? 回答1: As @dfowler points out, it's not the right technology for the job. What I would recommend

Custom error messages for Groups within the jQuery Validation plugin

浪尽此生 提交于 2020-01-02 03:12:09
问题 I'm using the jQuery Validation plugin and i've started to group some of my fields together: groups: { fullName: "myFirstName myLastName" }, I've also added the fields to the rules section so that they are validated: rules: { myFirstName: { required: true }, myLastName: { required: true } }, This works great and produces an error of "This field is required" for the group. My question lies with custom error messages. I have the following setup: messages: { fullName: "Please enter both your

Observe for new System Notifications OSX

扶醉桌前 提交于 2020-01-02 02:09:15
问题 Is it possible to listen/observe for new notifications macOS receives? I mean like when a new iMessage or a Slack message is received (so basically everything that causes NotificationCenter to display a Notification) 回答1: Short answer: It is not possible. You can't observe user notifications sent by applications unless an application provides a specific API. For example the AppleScript dictionary of iMessage and Mail contains events scripts can respond to. However user notifications are

Keep track of read/unread User Messages with a MessageClicks table?

狂风中的少年 提交于 2020-01-01 12:35:11
问题 I'm trying to implement a simple Inbox system for users of my app so that can send basic messages to each other - just like in many forum systems. If User has_many :messages , how do I keep track of and notify the User of messages unread since last time they were read? I'm thinking clicks on the link to the Messages screen need to be recorded in a separate table ( MessagesClicks ). Is that the best approach here? So then I check the MessagesClicks table to see if any new messages have arrived