Windows EventLog - Making a custom EventMessageFile

Posted on 2011-04-27
Last Modified: 2013-12-03
I have a Win32 service that is writing events to the windows event log,  I send a value such as "12:00:00" and it gets formatted according to a format string (defined in my custom eventmessagefile) and results in a viewable message in the event viewer that looks like this:

"Ding!  It is now 12:00:00"

It is all working fine.

What I want, however is to change my eventmessagefile format string so that the viewable message now looks like this:"


The Time is now 12:00:00"

How do I format the eventmessagefile so that it contains those two linefeeds?

I use XN Resource Editor to create my resource files, and this is what I've tried

Editing the EventMessageFile format string

It seems to work okay, but the linefeeds I enter into XN Resource Editor aren't appearing in the Event Viewer.

After editing the format string
It still appears like:

The message all appears on one line:
Question by:Brian Withun
    LVL 74

    Accepted Solution

    LVL 74

    Assisted Solution

    by:käµfm³d 👽

    You'll need two of them  : )
    LVL 13

    Author Closing Comment

    by:Brian Withun
    It was actually a "%n" that I needed.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Join & Write a Comment

    For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
    Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
    The viewer will learn how to implement Singleton Design Pattern in Java.
    This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now