Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
How to change display settings: screen resolution, screen refresh rate
Adding and deleting Scheduled Tasks using NetScheduleJob API functions
Custom GDI+ class
Capturing keyboard activity of another application with the Raw Input API (VFP9)
Converting Unicode data from the Clipboard to a character string using a given code page
How to download a file from the FTP server using FtpGetFile
Detecting changes in connections to removable drives (VFP9)
Enumerating data formats currently available on the clipboard
How to play AVI file on the _screen
Winsock: sending email messages (SMTP, port 25)
Enumerating raw input devices attached to the system (keyboard, mouse, human interface device)
Custom FTP Class for Visual FoxPro application
Custom HttpRequest class (WinHTTP)
Deleting files into the Recycle Bin
Creating the Open dialog box to specify the drive, directory, and name of a file to open
How to activate Windows Calculator
Splash Screen for the VFP application
Custom HttpRequest class (WinINet)
Using Font and Text functions
Establishing connection using the SQLDriverConnect
How to display the Properties dialog box for a file (ShellExecuteEx)
Mapping and disconnecting network drives
Dragging files from Explorer window and dropping them on FoxPro control (requires VFP9)
How to convert a bitmap file to monochrome format (1 bpp)
Using an Event Object. Part A: running an application that creates an Event object

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
More code examples    Listed functions    Add comment     W32 Constants      Translate this page Printer friendly version of this code sample
Before you begin:
Compile this code into a separate executable and test with an executable created from the Part B of this example.
This is the name of the Event Object, that links two parts.

Start Part A executable prior to the Part B.
 
PUBLIC frm, lcEventName
lcEventName = "TimeToGoHomeNotice"
 
frm = CreateObject ("Tform", lcEventName)
IF TYPE ("frm") = "O"
    frm.Visible = .T.
    READ EVENTS
ENDIF
 
DEFINE CLASS Tform As Form
    Width=300
    Height=150
    BackColor=Rgb(230,230,250)
    Caption="Firing events"
    AutoCenter=.T.
    hEvent=0
 
    ADD OBJECT cmd As CommandButton WITH;
        Height=25, Width=80, Caption="\,;
        Left=10, Top=10
 
PROCEDURE  Init (lcName)
    _SCREEN.WindowState = 2
    _SCREEN.Caption = "Push the button to set an event"
 
    DO decl
    IF Not THIS.createEvent(lcName)
        RETURN .F.
    ENDIF
 
PROCEDURE  Destroy
    QUIT
 
PROCEDURE  createEvent (lcName)
    THIS.hEvent = CreateEvent (0, 1, 0, lcName)
    IF THIS.hEvent = 0
        = MessageB ("Unable to create an Event object" + Chr(13) +;
            "with this name")
        RETURN .F.
    ENDIF
RETURN .T.
 
PROCEDURE  fire
    = SetEvent (THIS.hEvent)
 
PROCEDURE  cmd.Click
    ThisForm.fire
ENDDEFINE
 
PROCEDURE  decl
    DECLARE INTEGER CreateEvent IN kernel32;
        INTEGER lpEventAttributes, INTEGER bManualReset,;
        INTEGER bInitialState, STRING lpName
 
    DECLARE INTEGER SetEvent IN kernel32 INTEGER hEvent
 
 

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
1150 bytes  
Created: 2001-09-16 12:00:00  
Modified: 2001-09-28 16:45:43  
Visits in 7 days: 63  
Listed functions:
CreateEvent
SetEvent
Printer friendly API declarations
My comment:
This code creates an Event object.

Pushing the button on the form you set this Event object, signalling that an event has occured. Another application (Part B) uses Timer to watch the state of the Event object. When the Part B application discovers the event occured it runs some code attached.
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.226.5.29)
2.57 hrs.Example: 'Using Month Calendar Control (VFP9, Comctl32.dll)'
3.95 hrs.Function: 'SHRegCloseUSKey'
4.64 hrs.Function: 'GetDriveType'
Function group: 'File Management'
4.65 hrs.Example: 'CryptoAPI: Collection of Providers class'
14.41 hrs.Example: 'Using WM_COPYDATA for interprocess communication (VFP9)'
 Example: 'How to copy the image of a form to the Clipboard using Bitmap API functions'
14.63 hrs.Links
Page 3
19.07 hrs.Example: 'How to print FoxPro form'
 Example: 'Verifying a file using the Authenticode policy provider'
 Function: 'GetOpenFileName'
Google
Advertise here!