Using Win32 functions in Visual FoxPro Image Gallery
Message and Message Queue
..msdn
BroadcastSystemMessage
GetQueueStatus
MQCloseQueue
MQDeleteQueue
MQHandleToFormatName
MQOpenQueue
MQPathNameToFormatName
MQPurgeQueue
PeekMessage
PostMessage
PostQuitMessage
SendMessage
Code examples:
BroadcastSystemMessage
    Add comment     W32 Constants      Translate this page
Sends a message to the specified recipients. The recipients can be applications, installable drivers, network drivers, system-level device drivers, or any combination of these system components.
Code examples:
Declaration:
long BroadcastSystemMessage(
    DWORD dwFlags,
    LPDWORD lpdwRecipients,
    UINT uiMessage,
    WPARAM wParam,
    LPARAM lParam
);
FoxPro declaration:
DECLARE INTEGER BroadcastSystemMessage IN user32;
    INTEGER   dwFlags,;
    INTEGER @ lpdwRecipients,;
    INTEGER   uiMessage,;
    INTEGER   wParam,;
    INTEGER   lParam

Parameters:
dwFlags
[in] Specifies the broadcast option.

lpdwRecipients
[in] Pointer to a variable that contains and receives information about the recipients of the message.

uiMessage
[in] Specifies the message to be sent.

wParam
[in] Specifies additional message-specific information.

lParam
[in] Specifies additional message-specific information.
Return value:
If the function succeeds, the return value is a positive value.
My comment:
As an example, you can carefully try this code:
LOCAL nRecipients
nRecipients = BSM_APPLICATIONS
= BroadcastSystemMessage(BSF_POSTMESSAGE,;
        @nRecipients, WM_CLOSE, 0, 0)

Most likely, it will close all open windows including the taskbar window, leaving you with a bare empty desktop. So before running this code make sure that all critical applications are closed.

Note that nRecipients is initialized and then passed to the function by reference. For me, that does not make much sense, since the documentation for this function describes this parameter as input only. Who knows, it could be important for some modes, say for BSF_QUERY mode.

In another example we may try to minimize all reachable windows:
= BroadcastSystemMessage(BSF_POSTMESSAGE,;
        @nRecipients, WM_SYSCOMMAND, SC_MINIMIZE, 0)

The function goes far beyond of what you could expect. Everything gets minimized, including system windows and windows that were initially hidden. So be ready to restart your computer right after you try the second example.
Word Index links for the BroadcastSystemMessage :
Translate this page:
  Spanish    Portuguese    German    French    Italian  
FreeTranslation.com offers instant, free translations of text or web pages.
Created: 2005-04-28 16:42:06
Modified: 2005-04-28 17:01:46
Visited in last 7 days: 22
User Contributed Notes:
There are no notes on this subject.


Copyright 2001-2017 News2News, Inc. Before reproducing or distributing any data from this site please ask for an approval from its owner. Unless otherwise specified, this page is for your personal and non-commercial use. The information on this page is presented AS IS, meaning that you may use it at your own risk. Microsoft Visual FoxPro and Windows are trade marks of Microsoft Corp. All other trademarks are the property of their respective owners. 

Privacy policy
Credits: PHP (4.4.9), an HTML-embedded scripting language, MySQL (5.6.38), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (54.90.207.75)
12 sec.Function: 'RtlDecompressBuffer'
26 sec.Function: 'SetMonitorBrightness'
38 sec.Function: 'CeRapiInitEx'
50 sec.Function: 'WindowProc'
1.03 min.Function: 'FtpGetFile'
1.23 min.Function: 'NetShareAdd'
1.43 min.Function: 'DrawMenuBar'
1.65 min.Function: 'ResetEvent'
1.85 min.Function: 'NetSessionEnum'
2.05 min.
Function group: 'Message and Message Queue'
Google
Advertise here!