]>
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
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 // For compilers that support precompilation, includes "wx.h".
13 #include "wx/wxprec.h"
20 #include "wx/window.h"
23 #include "wx/msw/private.h"
33 HANDLE g_hPenWin
= (HANDLE
)NULL
;
34 typedef void (CALLBACK
* PENREGPROC
)(WORD
,BOOL
);
36 // The routine below allows Windows applications (binaries) to
37 // support Pen input when running under Microsoft Windows for
38 // Pen Computing 1.0 without need of the PenPalete.
40 // Should masked edit functions be added to wxWidgets we would
41 // be a new class of functions to support BEDIT controls.
43 // (The function is a NOOP for native Windows-NT)
45 static void (CALLBACK
* RegPenApp
) (WORD
, BOOL
) = NULL
;
48 // Where is this called??
49 void wxEnablePenAppHooks (bool hook
)
57 ///////////////////////////////////////////////////////////////////////
58 // If running on a Pen Windows system, register this app so all
59 // EDIT controls in dialogs are replaced by HEDIT controls.
60 if ((g_hPenWin
= (HANDLE
)::GetSystemMetrics (SM_PENWINDOWS
)) != (HANDLE
) NULL
)
62 // We do this fancy GetProcAddress simply because we don't
63 // know if we're running Pen Windows.
64 if ((RegPenApp
= (PENREGPROC
)GetProcAddress (g_hPenWin
, "RegisterPenApp")) != NULL
)
65 (*RegPenApp
) (RPA_DEFAULT
, TRUE
);
70 ///////////////////////////////////////////////////////////////////////
71 // If running on a Pen Windows system, unregister
74 // Unregister this app
75 if (RegPenApp
!= NULL
)
76 (*RegPenApp
) (RPA_DEFAULT
, FALSE
);
77 g_hPenWin
= (HANDLE
) NULL
;
80 #endif /* ! Windows-NT */
84 // End wxUSE_PENWINDOWS
86 void wxRegisterPenWin(void)
89 ///////////////////////////////////////////////////////////////////////
90 // If running on a Pen Windows system, register this app so all
91 // EDIT controls in dialogs are replaced by HEDIT controls.
92 // (Notice the CONTROL statement in the RC file is "EDIT",
93 // RegisterPenApp will automatically change that control to
95 if ((g_hPenWin
= (HANDLE
)::GetSystemMetrics(SM_PENWINDOWS
)) != (HANDLE
)NULL
) {
96 // We do this fancy GetProcAddress simply because we don't
97 // know if we're running Pen Windows.
98 if ( (RegPenApp
= (void (CALLBACK
*)(WORD
, BOOL
))GetProcAddress(g_hPenWin
, "RegisterPenApp"))!= NULL
)
99 (*RegPenApp
)(RPA_DEFAULT
, TRUE
);
101 ///////////////////////////////////////////////////////////////////////
105 void wxCleanUpPenWin(void)
109 // Unregister this app
110 if (RegPenApp
!= NULL
)
111 (*RegPenApp
)(RPA_DEFAULT
, FALSE
);