]>
git.saurik.com Git - wxWidgets.git/blob - src/msw/penwin.cpp
340c175dc83cff7669d8a1adb4d1c6b01206993f
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: PenWindows code
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart and Markus Holzem
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
13 #pragma implementation
16 // For compilers that support precompilation, includes "wx.h".
17 #include "wx/wxprec.h"
27 #include "wx/msw/private.h"
37 HANDLE g_hPenWin
= (HANDLE
)NULL
;
38 typedef void (CALLBACK
* PENREGPROC
)(WORD
,BOOL
);
40 // The routine below allows Windows applications (binaries) to
41 // support Pen input when running under Microsoft Windows for
42 // Pen Computing 1.0 without need of the PenPalete.
44 // Should masked edit functions be added to wxWindows we would
45 // be a new class of functions to support BEDIT controls.
47 // (The function is a NOOP for native Windows-NT)
49 static void (CALLBACK
* RegPenApp
) (WORD
, BOOL
) = NULL
;
52 // Where is this called??
53 void wxEnablePenAppHooks (bool hook
)
61 ///////////////////////////////////////////////////////////////////////
62 // If running on a Pen Windows system, register this app so all
63 // EDIT controls in dialogs are replaced by HEDIT controls.
64 if ((g_hPenWin
= (HANDLE
)GetSystemMetrics (SM_PENWINDOWS
)) != (HANDLE
) NULL
)
66 // We do this fancy GetProcAddress simply because we don't
67 // know if we're running Pen Windows.
68 if ((RegPenApp
= (PENREGPROC
)GetProcAddress (g_hPenWin
, "RegisterPenApp")) != NULL
)
69 (*RegPenApp
) (RPA_DEFAULT
, TRUE
);
74 ///////////////////////////////////////////////////////////////////////
75 // If running on a Pen Windows system, unregister
78 // Unregister this app
79 if (RegPenApp
!= NULL
)
80 (*RegPenApp
) (RPA_DEFAULT
, FALSE
);
81 g_hPenWin
= (HANDLE
) NULL
;
84 #endif /* ! Windows-NT */
88 // End wxUSE_PENWINDOWS
90 void wxRegisterPenWin(void)
93 ///////////////////////////////////////////////////////////////////////
94 // If running on a Pen Windows system, register this app so all
95 // EDIT controls in dialogs are replaced by HEDIT controls.
96 // (Notice the CONTROL statement in the RC file is "EDIT",
97 // RegisterPenApp will automatically change that control to
99 if ((g_hPenWin
= (HANDLE
)GetSystemMetrics(SM_PENWINDOWS
)) != (HANDLE
)NULL
) {
100 // We do this fancy GetProcAddress simply because we don't
101 // know if we're running Pen Windows.
102 if ( (RegPenApp
= (void (CALLBACK
*)(WORD
, BOOL
))GetProcAddress(g_hPenWin
, "RegisterPenApp"))!= NULL
)
103 (*RegPenApp
)(RPA_DEFAULT
, TRUE
);
105 ///////////////////////////////////////////////////////////////////////
109 void wxCleanUpPenWin(void)
113 // Unregister this app
114 if (RegPenApp
!= NULL
)
115 (*RegPenApp
)(RPA_DEFAULT
, FALSE
);