Click here to Skip to main content
15,886,362 members
Articles / Desktop Programming / WTL

A Developer's Survival Guide to IE Protected Mode

Rate me:
Please Sign up or sign in to vote.
4.91/5 (51 votes)
20 May 200719 min read 431.2K   1.9K   125  
Busted features? APIs failing? Use this guide to get your IE plugin up and running again in protected mode!
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"

#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "atlres.h"

/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS

/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32

#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//

1 TEXTINCLUDE 
BEGIN
    "resource.h\0"
END

2 TEXTINCLUDE 
BEGIN
    "#include ""atlres.h""\r\n"
END

3 TEXTINCLUDE 
BEGIN
    "\r\n"
END

#endif    // APSTUDIO_INVOKED


/////////////////////////////////////////////////////////////////////////////
//
// Icon
//

// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDR_MAINFRAME           ICON                    "res\\DemoApp.ico"

/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//

IDD_MAINDLG DIALOGEX 0, 0, 243, 127
STYLE DS_SETFONT | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
CAPTION "DemoApp Main Dialog"
FONT 9, "Segoe UI", 0, 0, 0x0
BEGIN
    DEFPUSHBUTTON   "&Close",IDCANCEL,186,7,50,14
    PUSHBUTTON      "&About",ID_APP_ABOUT,186,24,50,14,WS_GROUP
    LTEXT           "This app doesn't do much on its own, you'll see messages below when stuff happens!  Try dragging and dropping text into this window, too.",IDC_STATIC,7,7,170,24
    CONTROL         "",IDC_LOG,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | WS_BORDER | WS_GROUP | WS_TABSTOP,7,42,229,78
END

IDD_ABOUTBOX DIALOGEX 0, 0, 219, 84
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "About IE Protected Mode Extension Demo"
FONT 9, "Segoe UI", 400, 0, 0x0
BEGIN
    DEFPUSHBUTTON   "OK",IDOK,156,63,56,14,WS_GROUP
    LTEXT           "VistaIEExtensionDemo - This EXE is part of the sample IE extension that demonstrates how to do stuff in protected mode",IDC_STATIC,7,7,205,16
    LTEXT           "Written by Michael Dunn <acidhelm@gmail.com>",IDC_STATIC,7,29,205,8
    LTEXT           "See my articles at <a>The Code Project</a>",IDC_LINK,7,43,205,8,WS_TABSTOP
END


/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//

#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO 
BEGIN
    IDD_MAINDLG, DIALOG
    BEGIN
        LEFTMARGIN, 7
        RIGHTMARGIN, 236
        TOPMARGIN, 7
        BOTTOMMARGIN, 120
    END

    IDD_ABOUTBOX, DIALOG
    BEGIN
        LEFTMARGIN, 7
        RIGHTMARGIN, 212
        TOPMARGIN, 7
        BOTTOMMARGIN, 77
    END
END
#endif    // APSTUDIO_INVOKED


/////////////////////////////////////////////////////////////////////////////
//
// Version
//

VS_VERSION_INFO VERSIONINFO
 FILEVERSION 1,0,0,0
 PRODUCTVERSION 1,0,0,0
 FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
 FILEFLAGS 0x1L
#else
 FILEFLAGS 0x0L
#endif
 FILEOS 0x4L
 FILETYPE 0x2L
 FILESUBTYPE 0x0L
BEGIN
    BLOCK "StringFileInfo"
    BEGIN
        BLOCK "040904b0"
        BEGIN
            VALUE "FileDescription", "DemoApp Module"
            VALUE "FileVersion", "1.0.0.0"
            VALUE "InternalName", "DemoApp"
            VALUE "LegalCopyright", "Written by Michael Dunn <acidhelm@gmail.com>"
            VALUE "OriginalFilename", "DemoApp.exe"
            VALUE "ProductName", "DemoApp Module"
            VALUE "ProductVersion", "1.0.0.0"
        END
    END
    BLOCK "VarFileInfo"
    BEGIN
        VALUE "Translation", 0x409, 1200
    END
END


/////////////////////////////////////////////////////////////////////////////
//
// String Table
//

STRINGTABLE 
BEGIN
    IDR_MAINFRAME           "DemoApp"
END

#endif    // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////



#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//


/////////////////////////////////////////////////////////////////////////////
#endif    // not APSTUDIO_INVOKED

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Software Developer (Senior) VMware
United States United States
Michael lives in sunny Mountain View, California. He started programming with an Apple //e in 4th grade, graduated from UCLA with a math degree in 1994, and immediately landed a job as a QA engineer at Symantec, working on the Norton AntiVirus team. He pretty much taught himself Windows and MFC programming, and in 1999 he designed and coded a new interface for Norton AntiVirus 2000.
Mike has been a a developer at Napster and at his own lil' startup, Zabersoft, a development company he co-founded with offices in Los Angeles and Odense, Denmark. Mike is now a senior engineer at VMware.

He also enjoys his hobbies of playing pinball, bike riding, photography, and Domion on Friday nights (current favorite combo: Village + double Pirate Ship). He would get his own snooker table too if they weren't so darn big! He is also sad that he's forgotten the languages he's studied: French, Mandarin Chinese, and Japanese.

Mike was a VC MVP from 2005 to 2009.

Comments and Discussions