Using Win32 functions in Visual FoxPro Image Gallery
Message and Message Queue
Code examples:
    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:
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

[in] Specifies the broadcast option.

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

[in] Specifies the message to be sent.

[in] Specifies additional message-specific information.

[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
= 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 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: 20
User Contributed Notes:
There are no notes on this subject.

Copyright 2001-2018 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.39), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (
2 sec.Function: 'GetFileSize'
3 sec.Function: 'CreateToolhelp32Snapshot'
5 sec.
Function group: 'Mailslot'
6 sec.
Function group: 'Icon'
8 sec.Function: 'CeGetSpecialFolderPath'
10 sec.Function: 'GetDefaultPrinter'
11 sec.
Function group: 'GDI+ Bitmap'
13 sec.Function: 'GetGraphicsMode'
14 sec.Function: 'EndTask'
16 sec.Function: 'DrawText'
Advertise here!