Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Using the GradientFill function
Validating the heap of the calling process
Drawing icons associated with the VFP main window
Reading metrics for the currently selected font
Setting properties of the window: caption and user-defined value
Animating a transition of the VFP form (a wire-frame rectangle)
Configuring DEVMODE structure for a printer
Enumerating Processes -- WinNT
Finding parameters for the region specified
How to generate GUID values
Memory usage info for current VFP session (WinNT only)
Reading and setting explicit Application User Model ID for the current process (Win7)
Terminating all running applications from a VFP program
Using an Event Object. Part A: running an application that creates an Event object
Wininet last error description
Winsock: how to retrieve the protocol information corresponding to a protocol name
Determining if an Active Network Connection is Available
How to print picture stored in enhanced-format metafile (*.emf)
List of addresses in the AutoDial mapping database
Opening access to the Microsoft Internet functions for the application
Using the GetTempFileName
Winsock: changing the byte ordering
Winsock: retrieving the host information corresponding to a network address
Enumerating Processes -- Win9*
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: 89  
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 (50.19.155.235)
4 sec.Function: 'AlphaBlend'
3.38 hrs.Example: 'How to view system icons for the classes installed on the local machine'
 Example: 'How to print FoxPro form -- II'
4.55 hrs.Example: 'Winsock: how to retrieve a service information corresponding to a port'
5.35 hrs.Function: 'DeletePort'
 Example: 'Converting command-line string to a set of Unicode argument strings (WinNT only)'
 Function: 'EndUpdateResource'
6.85 hrs.Function: 'PaintDesktop'
Function group: 'Painting and Drawing'
8.72 hrs.Function: 'GetVersion'
Function group: 'System Information'
 Example: 'Custom HttpRequest class (WinHTTP)'
Google
Advertise here!