]>
git.saurik.com Git - wxWidgets.git/blob - src/msw/penwin.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/msw/penwin.cpp
3 // Purpose: PenWindows code
4 // Author: Julian Smart
7 // Copyright: (c) Julian Smart
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 // For compilers that support precompilation, includes "wx.h".
12 #include "wx/wxprec.h"
19 #include "wx/window.h"
22 #include "wx/msw/private.h"
32 HANDLE g_hPenWin
= (HANDLE
)NULL
;
33 typedef void (CALLBACK
* PENREGPROC
)(WORD
,BOOL
);
35 // The routine below allows Windows applications (binaries) to
36 // support Pen input when running under Microsoft Windows for
37 // Pen Computing 1.0 without need of the PenPalete.
39 // Should masked edit functions be added to wxWidgets we would
40 // be a new class of functions to support BEDIT controls.
42 // (The function is a NOOP for native Windows-NT)
44 static void (CALLBACK
* RegPenApp
) (WORD
, BOOL
) = NULL
;
47 // Where is this called??
48 void wxEnablePenAppHooks (bool hook
)
56 ///////////////////////////////////////////////////////////////////////
57 // If running on a Pen Windows system, register this app so all
58 // EDIT controls in dialogs are replaced by HEDIT controls.
59 if ((g_hPenWin
= (HANDLE
)::GetSystemMetrics (SM_PENWINDOWS
)) != (HANDLE
) NULL
)
61 // We do this fancy GetProcAddress simply because we don't
62 // know if we're running Pen Windows.
63 if ((RegPenApp
= (PENREGPROC
)GetProcAddress (g_hPenWin
, "RegisterPenApp")) != NULL
)
64 (*RegPenApp
) (RPA_DEFAULT
, TRUE
);
69 ///////////////////////////////////////////////////////////////////////
70 // If running on a Pen Windows system, unregister
73 // Unregister this app
74 if (RegPenApp
!= NULL
)
75 (*RegPenApp
) (RPA_DEFAULT
, FALSE
);
76 g_hPenWin
= (HANDLE
) NULL
;
79 #endif /* ! Windows-NT */
83 // End wxUSE_PENWINDOWS
85 void wxRegisterPenWin(void)
88 ///////////////////////////////////////////////////////////////////////
89 // If running on a Pen Windows system, register this app so all
90 // EDIT controls in dialogs are replaced by HEDIT controls.
91 // (Notice the CONTROL statement in the RC file is "EDIT",
92 // RegisterPenApp will automatically change that control to
94 if ((g_hPenWin
= (HANDLE
)::GetSystemMetrics(SM_PENWINDOWS
)) != (HANDLE
)NULL
) {
95 // We do this fancy GetProcAddress simply because we don't
96 // know if we're running Pen Windows.
97 if ( (RegPenApp
= (void (CALLBACK
*)(WORD
, BOOL
))GetProcAddress(g_hPenWin
, "RegisterPenApp"))!= NULL
)
98 (*RegPenApp
)(RPA_DEFAULT
, TRUE
);
100 ///////////////////////////////////////////////////////////////////////
104 void wxCleanUpPenWin(void)
108 // Unregister this app
109 if (RegPenApp
!= NULL
)
110 (*RegPenApp
)(RPA_DEFAULT
, FALSE
);