]>
git.saurik.com Git - wxWidgets.git/blob - src/msw/penwin.cpp
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: PenWindows code
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 // For compilers that support precompilation, includes "wx.h".
13 #include "wx/wxprec.h"
21 #include "wx/window.h"
24 #include "wx/msw/private.h"
34 HANDLE g_hPenWin
= (HANDLE
)NULL
;
35 typedef void (CALLBACK
* PENREGPROC
)(WORD
,BOOL
);
37 // The routine below allows Windows applications (binaries) to
38 // support Pen input when running under Microsoft Windows for
39 // Pen Computing 1.0 without need of the PenPalete.
41 // Should masked edit functions be added to wxWidgets we would
42 // be a new class of functions to support BEDIT controls.
44 // (The function is a NOOP for native Windows-NT)
46 static void (CALLBACK
* RegPenApp
) (WORD
, BOOL
) = NULL
;
49 // Where is this called??
50 void wxEnablePenAppHooks (bool hook
)
58 ///////////////////////////////////////////////////////////////////////
59 // If running on a Pen Windows system, register this app so all
60 // EDIT controls in dialogs are replaced by HEDIT controls.
61 if ((g_hPenWin
= (HANDLE
)::GetSystemMetrics (SM_PENWINDOWS
)) != (HANDLE
) NULL
)
63 // We do this fancy GetProcAddress simply because we don't
64 // know if we're running Pen Windows.
65 if ((RegPenApp
= (PENREGPROC
)GetProcAddress (g_hPenWin
, "RegisterPenApp")) != NULL
)
66 (*RegPenApp
) (RPA_DEFAULT
, TRUE
);
71 ///////////////////////////////////////////////////////////////////////
72 // If running on a Pen Windows system, unregister
75 // Unregister this app
76 if (RegPenApp
!= NULL
)
77 (*RegPenApp
) (RPA_DEFAULT
, FALSE
);
78 g_hPenWin
= (HANDLE
) NULL
;
81 #endif /* ! Windows-NT */
85 // End wxUSE_PENWINDOWS
87 void wxRegisterPenWin(void)
90 ///////////////////////////////////////////////////////////////////////
91 // If running on a Pen Windows system, register this app so all
92 // EDIT controls in dialogs are replaced by HEDIT controls.
93 // (Notice the CONTROL statement in the RC file is "EDIT",
94 // RegisterPenApp will automatically change that control to
96 if ((g_hPenWin
= (HANDLE
)::GetSystemMetrics(SM_PENWINDOWS
)) != (HANDLE
)NULL
) {
97 // We do this fancy GetProcAddress simply because we don't
98 // know if we're running Pen Windows.
99 if ( (RegPenApp
= (void (CALLBACK
*)(WORD
, BOOL
))GetProcAddress(g_hPenWin
, "RegisterPenApp"))!= NULL
)
100 (*RegPenApp
)(RPA_DEFAULT
, TRUE
);
102 ///////////////////////////////////////////////////////////////////////
106 void wxCleanUpPenWin(void)
110 // Unregister this app
111 if (RegPenApp
!= NULL
)
112 (*RegPenApp
)(RPA_DEFAULT
, FALSE
);