Visual Basic Core Snippet Routines
PostMessage
          
                 
   PostMessage function places (posts) a message in the message queue associated with the thread that created the specified window and returns without waiting for the thread to process the message. This is the generic declare for PostMessage - examples of call formats are listed in the Comments section below.          
           Updated:   Monday December 26, 2011   
click to copy code:  



   Applies to:   VB4-32, VB5, VB6   
OS restrictions:   None  
 Code Snippet
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Copyright 1996-2011 VBnet/Randy Birch, All Rights Reserved.
' Some pages may also contain other copyrights by the author.
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Distribution: You can freely use this code in your own
'               applications, but you may not reproduce 
'               or publish this code on any web site,
'               online service, or distribute as source 
'               on any media without express permission.
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Private Declare Function PostMessage Lib "user32" _
   Alias "PostMessageA" _
  (ByVal hwnd As Long, _
   ByVal wMsg As Long, _
   ByVal wParam As Long, _
   lParam As Long) As Long

 Calling Syntax
The calling syntax for PostMessage, like SendMessage, varies depending on the message being sent and the value passed as the lParam member of the call. For samples of syntax for SendMessage, which can be applied to the PostMessage API, see the Calling Syntax section under SendMessage. 

 Comments / Related
demo in use:  SetLocaleInfo: Change System Long and Short Date Formats
Creating a VB-Timed Message Box with SetWindowsHookEx
Creating an API-Timed Message Box with SetWindowsHookEx
Shell_NotifyIcon: Add Icon to Windows System Tray
Shell_NotifyIcon: Respond to Systray Icon/Menu Interaction in a MDI App
      
Related:  SendMessage

 
 

PayPal Link
Make payments with PayPal - it's fast, free and secure!

 
 
 
 

Copyright 1996-2011 VBnet and Randy Birch. All Rights Reserved.
Terms of Use  |  Your Privacy

 

Hit Counter