Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Form Magnifier
How to play MIDI notes
Exporting DLL icon resources as .ICO files
Obtaining names of local and global groups for current user (WinNT/XP/2K)
System and Local Time values
Displaying icons in the system tray (VFP9)
Drawing a rectangle using Windows regular edges and borders
Drawing Windows frame controls using the DrawFrameControl function
Obtaining some properties for the Windows desktop using the GetWindowPlacement function
How to block the ALT+TAB shortcut (WinXP)
A client for testing non-blocking Winsock server
A procedure for setting file times
How to delete all print jobs for a printer
Retrieving information about the main VFP window
Using GetFileSize
Windows Shell Icons displayed and exported to ICO files (Vista)
Adding printer to the list of supported printers for the specified server
Changing system colors
Extended MessageBox Class
GDI+: saving image of FoxPro form to graphics file (BMP, GIF, JPG, PNG, TIF)
How to upload a local file to FTP server using FtpPutFile
Obtaining names and positions for shortcuts located on the Windows Desktop
Retrieving a universal form for the drive-based path for a network resource
Displaying OS Memory Status
Using the MessageBox Win32 function

User rating: 9.5/10 (2 votes)
Rate this code sample:
  • ~
More code examples    Listed functions    Add comment     W32 Constants      Translate this page Printer friendly version of this code sample
 
* MessageBox() Flags
#DEFINE MB_OK                 0
#DEFINE MB_OKCANCEL           1
#DEFINE MB_ABORTRETRYIGNORE   2
#DEFINE MB_YESNOCANCEL        3
#DEFINE MB_YESNO              4
#DEFINE MB_RETRYCANCEL        5
 
*| icons
#DEFINE MB_ICONSTOP          16
#DEFINE MB_ICONQUESTION      32
#DEFINE MB_ICONEXCLAMATION   48
#DEFINE MB_ICONINFORMATION   64
#DEFINE MB_USERICON         128
 
*| default buttons
#DEFINE MB_DEFBUTTON1 0
#DEFINE MB_DEFBUTTON2 0x100
#DEFINE MB_DEFBUTTON3 0x200
#DEFINE MB_DEFBUTTON4 0x300
 
*| modality
#DEFINE MB_APPLMODAL          0
#DEFINE MB_SYSTEMMODAL  0x1000
#DEFINE MB_TASKMODAL  0x2000
#DEFINE MB_HELP  0x4000  && Help Button
 
*| misc
#DEFINE MB_NOFOCUS  0x8000
#DEFINE MB_SETFOREGROUND  0x10000
#DEFINE MB_DEFAULT_DESKTOP_ONLY 0x20000
 
*| positioning
#DEFINE MB_TOPMOST  0x40000
#DEFINE MB_RIGHT  0x80000
#DEFINE MB_RTLREADING 0x100000
 
*| notif.
#DEFINE MB_SERVICE_NOTIFICATION   0x200000
#DEFINE MB_SERVICE_NOTIFICATION_NT3X   0x40000
 
*| masks
#DEFINE MB_TYPEMASK  0x0f
#DEFINE MB_ICONMASK 0xF0
#DEFINE MB_DEFMASK 0xF00
#DEFINE MB_MODEMASK 0x3000
#DEFINE MB_MISCMASK 0xC000
 
    DECLARE INTEGER MessageBox IN user32 As MsgBox;
        INTEGER hwnd,;
        STRING  lpText,;
        STRING  lpCaption,;
        INTEGER wType
 
    DECLARE INTEGER GetActiveWindow IN user32
 
    hwnd = GetActiveWindow()
    ? MsgBox (0, "Message Text", "Message Caption",;
        MB_ABORTRETRYIGNORE + MB_ICONEXCLAMATION +;
        MB_DEFBUTTON3 + MB_SYSTEMMODAL)
 
 
 

User rating: 9.5/10 (2 votes)
Rate this code sample:
  • ~
1496 bytes  
Created: 2001-07-18 12:00:00  
Modified: 2005-12-27 10:16:48  
Visits in 7 days: 70  
Listed functions:
GetActiveWindow
MessageBox
Printer friendly API declarations
My comment:
In this example the dialog box is placed above all open windows.

The main window of VFP is unavailable for input while the dialog exists. But all other open windows are accessible, though the dialog window keeps staying on the top.

After closing the dialog, the VFP main window may not acquire a focus automatically, depending on both OS and VFP versions in use.

Notice that HWND value used in this example is zero. That means that the dialog has no parent window. You can find HWND of the VFP Main window through the GetActiveWindow, or GetFocus (conditionally) functions.

A HWND passed to this function as a parameter -- I guess -- implies that you can take this value from any other window.
Word Index links for this example:
Translate this page:
  Spanish    Portuguese    German    French    Italian  
FreeTranslation.com offers instant, free translations of text or web pages.
User Contributed Notes:
There are no notes on this subject.


Copyright © 2001-2013 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.1.55-log), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (54.234.231.49)
7.32 min.Example: 'Converting long file names to the short format and vice versa'
7.38 min.Example: 'How to retrieve the number of print jobs queued for the printer'
1.16 hrs.Example: 'WAV file player'
6.64 hrs.Function: 'GetCurrentProcess'
Function group: 'Process and Thread'
 Function: 'mmioDescend'
 Function: 'GdipDeleteGraphics'
Function group: 'GDI+ Graphics'
10.93 hrs.Example: 'Storing screen shot of a form to bitmap file'
12.7 hrs.Example: 'Using shared memory to exchange data between two FoxPro applications'
 Example: 'Hiding mouse cursor'
 Example: 'Using the IsWindowEnabled function'
Google
Advertise here!