Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
How to retrieve information about a cache entry (Internet Explorer)
Initiating Inet connection using a modem
Locking mouse and keyboard input for the VFP application
Reading entries from Event logs
Retrieving the interface–to–IP address mapping table
Displaying hypertext links with the SysLink control (VFP9, Comctl32.dll)
How to enumerate, add and delete shares on the local computer (WinNT/XP)
Retrieving names for the registered clipboard formats
Scanning a hierarchy of child windows down from the Windows Desktop
Creating the Save dialog box to specify the drive, directory, and name of a file to save
Displaying standard progress dialog box when copying files
How to retrieve version information for the specified file
Placing an arbitrary rectangular area of main VFP window on the Clipboard
Starting a dialog box for connecting to network resources (mapping network drive)
Starting an external application in VFP using WinExec
Winsock: retrieving the host information corresponding to a network address
Adding and deleting User Accounts
How to delete IE cookies, clear IE history and delete files in Temporary Internet Files directory
How to display a dialog box with which the user can add a data source (DSN)
Obtaining list of tables stored in an ODBC Data Source
Retrieveing information about the active window (even if it is not owned by the calling process)
String representation for disk or memory capacity
Enumerating print processors and supporting data types installed on the specified server
How to browse and connect to printers on a network (WinNT)
Reading entries from Event logs

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
Versions:
click to open
Before you begin:
With Event Viewer, users can monitor events recorded in the Application, Security, and System logs.



See also:
  • How to register custom Event Log source
  • Writing entries to custom Event Log
  • Reading from INI files
  • Writing to INI files
  •  
      Members area. Log in to view this example.
     
      User name:
      Password:
     
     
      Forgot your password?
     
      Sign up for
    the Membership
     
     


    User rating: 0/10 (0 votes)
    Rate this code sample:
    • ~
    8598 bytes  
    Created: 2007-02-17 17:01:25  
    Modified: 2010-06-30 09:16:13  
    Visits in 7 days: 134  
    Listed functions:
    ClearEventLog
    CloseEventLog
    GetEventLogInformation
    GetLastError
    GetNumberOfEventLogRecords
    GetOldestEventLogRecord
    GlobalAlloc
    GlobalFree
    GlobalSize
    OpenEventLog
    ReadEventLog
    Printer friendly API declarations
    My comment:
    Test as follows:
    LOCAL welog As WindowsEventLog,;
            werecord As WindowsEventRecord, nReccount

    welog = CREATEOBJECT("WindowsEventLog",;
            NULL, "Application")

    WAIT WINDOW NOWAIT "Reading log records..."
    nReccount = welog.ReadLogRecords()
    WAIT CLEAR

    CREATE CURSOR csResult ( recordnumber I,;
            timegenerated T, timewritten T,;
            eventid I, eventtype I, numstrings I,;
            eventcategory I, stringoffset I,;
            datalength I, dataoffset I, strings M,;
            eventdata M, eventbuffer M,;
            sysname C(32), source C(200))

    FOR EACH werecord IN welog.WindowEventRecords
            WITH werecord
                    INSERT INTO csResult VALUES (.recordnumber,;
                            WE_START_DATETIME+.timegenerated,;
                            WE_START_DATETIME+.timewritten,;
                            .eventid, .eventtype, .numstrings,;
                            .eventcategory, .stringoffset,;
                            .datalength, .dataoffset,;
                            .strings, .eventdata, .eventbuffer,;
                            .sysname, .source)
            ENDWITH
    NEXT

    * * *
    Read also: Using the Windows Event Log from Visual FoxPro by Craig Berntson.
    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.17.109.248)
    10.36 hrs.Function: 'ReleaseMutex'
     Example: 'Adding user-defined items to the Control Menu of VFP form (requires VFP9)'
    10.92 hrs.Function: 'GetUserNameEx'
    Function group: 'System Information'
     Example: 'How to remove a directory that is not empty'
     Example: 'How to delete IE cookies, clear IE history and delete files in Temporary Internet Files directory'
    13.56 hrs.Example: 'Using InternetGoOnline function'
     Example: 'Retrieving configuration information for the specified workstation (Win2000/XP)'
    17.25 hrs.Example: 'Retrieving the priority class for the current process'
     Example: 'Retrieving the name of the network resource associated with a local device'
    1 day(s)Example: 'Custom HttpRequest class (WinHTTP)'
    Google
    Advertise here!