SecureVee.h
/*********************************************************************
$RCSfile: SecureVee.h $
$Revision: 1.5 $
$Date: 1998/05/06 05:22:46 $
$Author: doomer $
Copyright (c) 1997 John Dumais. All rights reserved.
**********************************************************************
Description
The header file for the DLL implemented in SecureVee.c.
*********************************************************************/
#include <windows.h>
#include <windowsx.h>
#include "defines.h"
/* The identifer the file->exit menu sends */
#define VEE_FILE_EXIT 0x00000095
/* The keystroke the ctrl-e sequence sends */
#define VEE_CTRL_E 0x00000005
/* asoociate a window with its creating thread */
struct windowThreadPair{
HWND aWindow;
DWORD windowThread;
};
/* informaton saved so we can undo what we did */
struct hotKeyFlags{
unsigned short altTabInstalled :1;
unsigned short altTabAtom :1;
unsigned short altF4Installed :1;
unsigned short altF4Atom :1;
unsigned short altReturnInstalled :1;
unsigned short altReturnAtom :1;
unsigned short altEscInstalled :1;
unsigned short altEscAtom :1;
unsigned short altSpaceInstalled :1;
unsigned short altSpaceAtom :1;
};
/*
associate atoms with a window, so we can reclaim resources when we
exit
*/
struct windowAtomPair{
HWND aWindow;
ATOM altTabAtom;
ATOM altF4Atom;
ATOM altReturnAtom;
ATOM altEscAtom;
ATOM altSpaceAtom;
struct hotKeyFlags flags;
};
/*
information needed to know whether we can restore our window
to its original state;
*/
struct subclassFlags{
unsigned char windowIsSubclassed :1;
unsigned char windowPlacementValid :1;
unsigned char stylesValid :1;
};
/*
associate our window with its original event handler for
restoration when we exit
*/
struct windowSubclassPair{
HWND aWnd;
WNDPROC winProc;
WINDOWPLACEMENT windowPlacement;
LONG styleBits;
struct subclassFlags flags;
};
/*
Function prototypes.
*/
BOOL WINAPI DllMain(HINSTANCE dllInstance, DWORD reason, LPVOID reserved);
void __stdcall SecureVeeCleanup(void);
int __stdcall SecureVee(void);
HWND findVeeWindow(void);
BOOL CALLBACK enumWindowsCallback(HWND aWnd, LPARAM windowThreadInfo);
BOOL createHotKey(struct windowAtomPair *hotKeyInfo, HWND aWnd);
BOOL installHotKey(struct windowAtomPair *hotKeyInfo);
BOOL subclassVeeWindow(struct windowSubclassPair *subclassInfo, HWND aWnd);
LRESULT CALLBACK veeSubclass(
HWND aWnd,
UINT aMessage,
WPARAM wParam,
LPARAM lParam);
void cleanUp(
struct windowAtomPair *hotKeyInfo,
struct windowSubclassPair *subclassInfo);
BOOL removeDecorations(struct windowSubclassPair *subclassInfo, HWND aWnd);
BOOL coverScreen(HWND aWnd, BOOL lockPosition);
BOOL restoreWindow(struct windowSubclassPair *subclassInfo);
/*********************************************************************
$Log: SecureVee.h $
Revision 1.5 1998/05/06 05:22:46 doomer
made the two main entry points in the dll use the __stdcall calling convention.
Revision 1.4 1998/04/19 05:36:32 doomer
added facilities to put target window back the way we found it.
added fields to windowSubclassPair to accomodate this.
added new function restoreWindow() to implement this.
call restoreWindow() from cleanUp().
changed arguments to removeDecorations() to include pointer to
windowSubclassPair. needed to store information for later
use in restoring window.
Revision 1.3 1997/09/08 23:55:44 doomer
documentation.
Revision 1.2 1997/08/25 00:52:24 doomer
am using hot keys instead of a keyboard hook to trap window
navigation key strokes. Necessitated additional manifest constants,
string table entries, and atoms. Removed the keyboard hook and
associated stuff.
Revision 1.1 1997/08/17 04:58:14 doomer
Initial revision
*********************************************************************/