After the last time I wrote the news mechanism in the SDK, I have a netizen to leave a message.
Message,
After reading the article, I wrote a closeall program: // ------------------------ #include
I am debugging, it's true.
So I asked in the QQ group, but I still didn't get satisfied, but the harvest is not small.
Now I have a problem or like this why PostMessage and SendMessage will have different effects? ? ? ? ? ? ? ,
The master helped me answer, I am grateful! ! ! ! !
Below is the chat record ::::::::::::::::::::
:::::: :::::::::::::::::::::
This guy is lazy (76359121) 12: 21: 03Applications that need to communicate using HWND_BROADCAST should use the RegisterWindowMessage function to obtain a unique message for inter-application communication.The system only does marshalling for system messages (those in the range 0 to WM_USER To send Other Messages (Those Above WM_USER) To Another Process, You Must Do Custom Marshalling.
This guy is too lazy (76359121) 12:21:21 Who helped me translate this guy is very lazy (76359121) 12:26:34 Handsome guy, who will help Saji Huang (13859915) 12:21:01 In the application room communication, applications that need to use hwnd_broadcast should use the RegisterWindowMessage function to get a unique message. This guy is very lazy (76359121) 12:29:07 is still a bit unclear. This guy is very lazy (76359121) 12: 30: 20Inter-Application Communication. - "Interactive Program Communication Super Message (13859915) 12: 24: 41the System Only Does Marshalling for System Messages (Those In The Range 0 to WM_USER). To send Other Messages To Another Process, You Must Do Custom Marshalling. The system is only available to system messages between 0 and WM_USERs. Treatment.
If you need to send additional messages to other processes (value greater than WM_USER), you must do your own Hundreds (13859915) 12: 25: 23Inter-Application Communication. - "Interactive Program Communication is different application processes in two systems This guy is very lazy (76359121) 12:32:14 is the communication between different processes? This guy is very lazy (76359121) 12:34:23 What is the difference between SendMessage and PostMessage? Superman (13859915) 12:28:45 is Abby Process 1 If you want to send a WM_CLOSE message to the process 2, you can use it directly SendMessage Send, the system will automatically do, if you want to customize a message, you must declare the message, indicate the acceptance function in the process reception process (13859915) 12: 29: 27the dendMessage Member Function Calls the window procedure directly and does not return until that window procedure has processed the message this is in contrast to the PostMessage member function, which places the message into the window's message queue and returns immediately this guy is lazy (76,359,121) 12:36.: 49 This return refers to what to return to the window (13859915) 12: 30: 50sendMessage Send a message to the window until the window process is complete; postmessage is directly returned to Host Wood (13859915) 12: 31: 21postMessage is only responsible for sending to message queue returning to this guy is very lazy (76359121) 12: 38: 06sendMessage is not sent to message queue? Lanling laughs (64894354) 12:31:59 Not this guy is very lazy (76359121) 12:38:34 Direct return and processing after completion? Lanling laughs (64894354) 12:33:36 After the processing is completed, the call will hang a super copying (13859915) 12:35:49 Some people are in the non-stop dish SendMessage is sent to the plate , Queue, see that others have finished his tray, then leave PostMessage, just throw the plate, then understand? This guy is very lazy (76359121) 12:42:41 This understanding but the result is not all the same? This guy is very lazy (76359121) 12:43:15 That is to pay attention to distinguish between the two brother functions? This guy is very lazy (76359121) 12:43:28 Er brother - "Two Lanling laughs (64894354) 12: 37: 39postMessage Generally used in the same thread to deliver this guy is very lazy (76359121) 12:44 : 26 # include
} This guy is very lazy (76359121) 12:45:20 Executive result is Explore being closed Super Message (13859915) 12: 39: 22the Windows PostMessage Function. Lanling laughs (64894354) 12:39:47 Of course, this guy is very lazy (76359121) 12:46:34 I will see what SENDMESSAGE is very lazy (76359121) 12: 47: 47sendMessage is not angry, this guy is very lazy (76359121) 12:49:07 What is this reason? ? Hostwood Huang (13859915) 12: 43: 20THE Windows PostMessage Function Can Be Used to Access Another Application. Is this reason? This guy is very lazy (76359121) 12:50:07 Can send Message? This guy is very lazy (76359121) 12:51:31 Is the HWnd_Broadcast below used to communicate between threads? Applications that need to communicate using HWND_BROADCAST should use the RegisterWindowMessage function to obtain a unique message for inter-application communication This guy is lazy (76,359,121) 12:52:58 thread - internal processes hypertext yellow (13859915) 12:48:00 Where did you see it? This guy is very lazy (76359121) 12:54:47 In my blog, someone left this question. This guy is very lazy (76359121) 12: 55: 06Http: //blog.9cbs.net/navyblue1982/Archive/2005/03/ 24 / 328392.AaspX Hyramid (1385915) 12: 50: 50POSTMESSAGE and SENDMESSAGE What is the difference? When you control other applications, you often need to wait until a feature end, for example: Open a window-> Waiting until At this time, you can use SendMessage if you still need to set up the interface of the window after opening this window, such as EDIT's Value, such as: Open a window -> Control window of the Control at this time. Postmessage
After using a hook program to intercept the message, use sendMessage to send the message to the primary handler, but when the main handler has not completed the task, the program set the hook will enter the stopped state, and can not process WM_Paint, WM_MOVE, ....... The basic information must wait until the message sent by SendMessage can continue to run, the entire interface is blank, and the hook message is set to the message form of PostMessage, the problem is solved! I checked it. MSDN's definition of these two APIs, postmessage just puts the message into the queue, whether it is returned if other programs are handled, then continue; while SendMessage must return to other programs to return, continue. PostMessage's return value indicates whether the PostMessage function is executed correctly; and the return value of SendMessage indicates the return value after another program processes the message. The most important thing to use these two sending message functions is to see if your program is to be hysteresis, postmessage will cause the hysteresis of the message, while SendMessage will not, but if the sendMessage message failed, Cause the program stop!
Hypertext yellow (13859915) 12: 53: 02The SendMessage member function calls the window procedure directly and does not return until that window procedure has processed the message This is in contrast to the PostMessage member function, which places the message into the window's message. queue and returns immediately this guy is lazy (76359121) 13:. 00: 10hWnd: Handle to the window whose window procedure will receive the message If this parameter is HWND_BROADCAST, the message is sent to all top-level windows in the system,. INCLUDING DISABED ORIBLE UNOWNED Windows, Overlapped Windows; But The Message IS Not Sent To Child Windows. This guy is very lazy (76359121) 13:01:31 When control other applications, often need to wait Until a feature ended this sentence how to understand super copy yellow (13859915) 12:55:15 Good to understand this paragraph SendMessage is directly called the window process, then it means that it can get it directly to handle it, is it What does this news have news priority? PostMessage just returns the message to the message queue, and the details should be sent to the message loop to send the message to the window process. This guy is very lazy (76359121) 13: 03: 54 # include
This guy is very lazy (76359121) 13:08:49 Picture Do you can see it? Lanling laughing (64894354) 13:03:01 Waiting book inside the picture This guy is very lazy (76359121) 13:09:22 Laughing laughter (64894354) 13: 03: 51advanced windows Nt The book seems to have a picture than this complicated Dollands laughing, laughing (64894354) 13:04:24 The real message process is very lazy than this complex this guy (76359121) 13:10:46 What is the meaning of the meaning? PostMessage is a message queue sent to the developed window and then takes the message in the message queue to take this guy. It is too lazy (76359121) 13:11:25, it is SENDMESSAGE to proceed to the process between Lanling laughter (64894354) 13: 05: 25sendMessage is a very lazy (76359121) 13:11:42 Do you understand what I understand? ? Hundreds of Wen Huang (13859915) 13:05:56 Your program is too dark, all of me all have a window, I am lazy (76359121) 13:13:06 But change to sendMessage (hwnd_broadcast, wm_quit, 0 0); there is no effect, I don't understand why there is a difference. Hundreds of Wen Huang (1385915) 13: 07: 33sendMessage should call the window handle to send a hyperbrendy (1385915) 13: 08: 12PostMessage just send a message to the message queue front that is the message you sent to all top-level programs this guy is lazy (76,359,121) 13:14:41 but obviously on MSDN explains Applications that need to communicate using HWND_BROADCAST should use the RegisterWindowMessage function to obtain a unique message for inter -Application Communication. Super Text Huang (13859915) 13: 09: 23http://ce.szpt.edu.cn/longen/vcvb (a) / sendvspostmsg () .htm Take a look at this description. Superman (13859915) 13: 10:29sendMessage, you send a specified program form, then send the current form :) This guy is very lazy (76359121) 13:20:16 Since the specified gives a window, then this hWnd_broadcast? This guy is very lazy (76359121) 13:22:17 So broadcast in SendMessage is not necessary? Hundreds of yellow-yellow (13859915) 13:17:21 Makes wrong:) hwnd_broadcast is indicating that the send to top-level form but why SendMessage doesn't work, I don't know this guy is very lazy (76359121) 13:24:26
Super Wen Huang (13859915) 13:18:26 Can't see your picture :) This guy is very lazy (76359121) 13:25:01 is your online Lanling laughter (64894354) 13:19:31 Every thread has its own message queue. This guy is too lazy (76359121) 13:26:10 Procedure? This guy is very lazy (76359121) 13:26:17 Freedom Bird (303214605) 13:20:49 << Interrupt >> Can you ask "This guy is too lazy" Your picture is the book, I think it is very good. Clear. I want to know in depth? This guy is very lazy (76359121) 13: 27: 23http://ce.szpt.edu.cn/longen/vcvb (a) / sendvspostmsg () .htm Freedom (303214605) 13: Thanks lazy guy 23:28 (76359121) 13: 30: Applications sendmessage on 35msdn is to be noted that need to communicate using HWND_BROADCAST should use the RegisterWindowMessage function to obtain a unique message for inter-application communication is lazy guy. (76359121) 13: 31: 20Inter-Application Communication Can not be understood as the process between the process, more than one: 26:46 should be able to make the application and process a little different :::::::::::::::::::: ::::: :::::::::::::::::::::: ::::