Solved

SendMessage constants

Posted on 1999-01-18
8
1,003 Views
Last Modified: 2012-08-13
Please could someone tell me of a resource on the Internet which explains the API function SendMessage including the definitions of all/ most of the constants (e.g. WM_CLOSE, WM_SETREDRAW)
0
Comment
Question by:YourMajesty
  • 3
  • 3
  • 2
8 Comments
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1469152
support.microsoft.com
0
 

Author Comment

by:YourMajesty
ID: 1469153
Please can you elaborate as I have tried the search facility with no success.
0
 

Accepted Solution

by:
Eyalt earned 50 total points
ID: 1469154
I hope this will hep U :
for any other information, just ask...

SendMessage
------------------------------

The SendMessage function sends the specified message to a window or windows. The function calls the window procedure for the specified window and does not return until the window procedure has processed the message. The PostMessage function, in contrast, posts a message to a thread's message queue and returns immediately.

LRESULT SendMessage(

    HWND hWnd,      // handle of destination window
    UINT Msg,      // message to send
    WPARAM wParam,      // first message parameter
    LPARAM lParam       // second message parameter
   );      
 

Parameters

hWnd

Identifies 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 disabled or invisible unowned windows, overlapped windows, and pop-up windows; but the message is not sent to child windows.

Msg

Specifies the message to be sent.

wParam

Specifies additional message-specific information.

lParam

Specifies additional message-specific information.

 

Return Values

The return value specifies the result of the message processing and depends on the message sent.

Remarks

Applications that need to communicate using HWND_BROADCAST should use the RegisterWindowMessage function to obtain a unique message for inter-application communication.
If the specified window was created by the calling thread, the window procedure is called immediately as a subroutine. If the specified window was created by a different thread, Windows switches to that thread and calls the appropriate window procedure. Messages sent between threads are processed only when the receiving thread executes message retrieval code. The sending thread is blocked until the receiving thread processes the message.

WM_CLOSE  
-------------------

The WM_CLOSE message is sent as a signal that a window or an application should terminate.

WM_CLOSE  
 

Parameters

This message has no parameters.

Return Values

If an application processes this message, it should return zero.

Default Action

The DefWindowProc function calls the DestroyWindow function to destroy the window.

Remarks

An application can prompt the user for confirmation, prior to destroying a window, by processing the WM_CLOSE message and calling the DestroyWindow function only if the user confirms the choice.


WM_SETREDRAW  
-------------------------------

An application sends the WM_SETREDRAW message to a window to allow changes in that window to be redrawn or to prevent changes in that window from being redrawn.

WM_SETREDRAW  
wParam = (WPARAM) fRedraw;  // state of redraw flag
lParam = 0;                 // not used; must be zero
 

Parameters

fRedraw

Value of wParam. Specifies the state of the redraw flag. If this parameter is TRUE, the redraw flag is set. If the parameter is FALSE, the flag is cleared.

 

Return Values

An application should return zero if it processes this message.

Remarks

This message sets or clears the redraw flag. If the redraw flag is cleared, the content of the given window is not updated after each change, and the window is not repainted until the redraw flag is set. For example, an application that must add several items to a list box can clear the redraw flag, add the items, and then set the redraw flag. Finally, the application can call the InvalidateRect function to cause the list box to be repainted.
0
 

Author Comment

by:YourMajesty
ID: 1469155
Eyalt,

Brilliant stuff. Can you give the definitions of all constants if it's not too much trouble ?

Thanx
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 13

Expert Comment

by:Mirkwood
ID: 1469156
You have the API text viewer, in there you can find the messages.
You can now go to support.microsoft.com and type the name of what you are looking for. e.g. WM_CLOSE or something you will find the information as Eyalt posted. That information was copied from the MSDN
0
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1469157
BTW: there are >1000 messages, nobody is going to post the entire information.
0
 

Expert Comment

by:Eyalt
ID: 1469158
I don't know about support.microsoft.co,  
I used the help file : win32.hlp (~12M)  (U can search for it
on the internet!)
0
 

Author Comment

by:YourMajesty
ID: 1469159
For anyone's information I was able to download the win32.hlp file from ftp://ftp.borland.com/pub/delphi/techpubs/delphi2/
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now