]>
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 and Markus Holzem
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
13 #pragma implementation
16 // For compilers that support precompilation, includes "wx.h".
17 #define IN_WX_MAIN_CPP
18 #include "wx/wxprec.h"
20 #if defined(__BORLANDC__)
28 #include "wx/msw/private.h"
38 HANDLE g_hPenWin
= (HANDLE
)NULL
;
39 typedef void (CALLBACK
* PENREGPROC
)(WORD
,BOOL
);
41 // The routine below allows Windows applications (binaries) to
42 // support Pen input when running under Microsoft Windows for
43 // Pen Computing 1.0 without need of the PenPalete.
45 // Should masked edit functions be added to wxWindows we would
46 // be a new class of functions to support BEDIT controls.
48 // (The function is a NOOP for native Windows-NT)
50 static void (CALLBACK
* RegPenApp
) (WORD
, BOOL
) = NULL
;
53 // Where is this called??
54 void wxEnablePenAppHooks (bool hook
)
62 ///////////////////////////////////////////////////////////////////////
63 // If running on a Pen Windows system, register this app so all
64 // EDIT controls in dialogs are replaced by HEDIT controls.
65 if ((g_hPenWin
= (HANDLE
)GetSystemMetrics (SM_PENWINDOWS
)) != (HANDLE
) NULL
)
67 // We do this fancy GetProcAddress simply because we don't
68 // know if we're running Pen Windows.
69 if ((RegPenApp
= (PENREGPROC
)GetProcAddress (g_hPenWin
, "RegisterPenApp")) != NULL
)
70 (*RegPenApp
) (RPA_DEFAULT
, TRUE
);
75 ///////////////////////////////////////////////////////////////////////
76 // If running on a Pen Windows system, unregister
79 // Unregister this app
80 if (RegPenApp
!= NULL
)
81 (*RegPenApp
) (RPA_DEFAULT
, FALSE
);
82 g_hPenWin
= (HANDLE
) NULL
;
85 #endif /* ! Windows-NT */
91 void wxRegisterPenWin(void)
94 ///////////////////////////////////////////////////////////////////////
95 // If running on a Pen Windows system, register this app so all
96 // EDIT controls in dialogs are replaced by HEDIT controls.
97 // (Notice the CONTROL statement in the RC file is "EDIT",
98 // RegisterPenApp will automatically change that control to
100 if ((g_hPenWin
= (HANDLE
)GetSystemMetrics(SM_PENWINDOWS
)) != (HANDLE
)NULL
) {
101 // We do this fancy GetProcAddress simply because we don't
102 // know if we're running Pen Windows.
103 if ( (RegPenApp
= (void (CALLBACK
*)(WORD
, BOOL
))GetProcAddress(g_hPenWin
, "RegisterPenApp"))!= NULL
)
104 (*RegPenApp
)(RPA_DEFAULT
, TRUE
);
106 ///////////////////////////////////////////////////////////////////////
110 void wxCleanUpPenWin(void)
114 // Unregister this app
115 if (RegPenApp
!= NULL
)
116 (*RegPenApp
)(RPA_DEFAULT
, FALSE
);