source: trunk/src/user32/winaccel.cpp@ 2013

Last change on this file since 2013 was 1429, checked in by sandervl, 26 years ago

MDI changes & fixes

File size: 4.6 KB
Line 
1/* $Id: winaccel.cpp,v 1.2 1999-10-24 12:30:29 sandervl Exp $ */
2/*
3 * Win32 accelartor key functions for OS/2
4 *
5 * Copyright 1999 Sander van Leeuwen
6 *
7 *
8 * Project Odin Software License can be found in LICENSE.TXT
9 *
10 */
11#include <os2win.h>
12#include <misc.h>
13#include <win32wbase.h>
14
15//******************************************************************************
16//******************************************************************************
17HACCEL WIN32API LoadAcceleratorsA(HINSTANCE hinst, LPCSTR lpszAcc)
18{
19 HACCEL rc;
20
21 rc = (HACCEL)FindResourceA(hinst, lpszAcc, RT_ACCELERATORA);
22
23 dprintf(("LoadAcceleratorsA returned %d\n", rc));
24 return(rc);
25}
26//******************************************************************************
27//******************************************************************************
28HACCEL WIN32API LoadAcceleratorsW(HINSTANCE hinst, LPCWSTR lpszAccel)
29{
30 HACCEL rc;
31
32 rc = (HACCEL)FindResourceW(hinst, lpszAccel, RT_ACCELERATORW);
33
34 dprintf(("LoadAcceleratorsW returned %d\n", rc));
35 return(rc);
36}
37//******************************************************************************
38//******************************************************************************
39BOOL WIN32API DestroyAcceleratorTable( HACCEL haccel)
40{
41 Win32Resource *winres;
42
43 if(HIWORD(haccel) == 0) {
44 dprintf(("DestroyAcceleratorTable: invalid haccel %x", haccel));
45 SetLastError(ERROR_INVALID_PARAMETER);
46 return FALSE;
47 }
48 dprintf(("DestroyAcceleratorTable %x\n", haccel));
49 winres = (Win32Resource *)haccel;
50 delete winres;
51 return TRUE;
52}
53//******************************************************************************
54//TODO: Do more than just return?
55//******************************************************************************
56int WIN32API TranslateAcceleratorA(HWND hwnd, HACCEL haccel, LPMSG lpmsg)
57{
58 Win32BaseWindow *window;
59
60 window = Win32BaseWindow::GetWindowFromHandle(hwnd);
61 if(!window) {
62//Msg for (non-client) child of our frame window
63// dprintf(("TranslateAcceleratorA, window %x not found", hwnd));
64 return FALSE;
65 }
66 if(window->GetAccelTable() != haccel) {
67 dprintf(("TranslateAcceleratorA %X %X %X", hwnd, haccel, lpmsg->hwnd));
68 window->SetAccelTable(haccel);
69 }
70
71 //SvL: OS/2 automatically translates accelerator keys
72 return FALSE;
73}
74//******************************************************************************
75//******************************************************************************
76int WIN32API TranslateAcceleratorW( HWND hwnd, HACCEL hAccel, LPMSG lpMsg)
77{
78 return TranslateAcceleratorA(hwnd, hAccel, lpMsg);
79}
80//******************************************************************************
81//******************************************************************************
82BOOL WIN32API TranslateMDISysAccel( HWND arg1, LPMSG arg2)
83{
84#ifdef DEBUG
85//// WriteLog("USER32: TranslateMDISysAccel\n");
86#endif
87 return O32_TranslateMDISysAccel(arg1, arg2);
88}
89//******************************************************************************
90//******************************************************************************
91HACCEL WIN32API CreateAcceleratorTableA( LPACCEL arg1, int arg2)
92{
93#ifdef DEBUG
94 WriteLog("USER32: CreateAcceleratorTableA\n");
95#endif
96 return O32_CreateAcceleratorTable(arg1, arg2);
97}
98//******************************************************************************
99//******************************************************************************
100HACCEL WIN32API CreateAcceleratorTableW( LPACCEL arg1, int arg2)
101{
102#ifdef DEBUG
103 WriteLog("USER32: CreateAcceleratorTableW\n");
104#endif
105 // NOTE: This will not work as is (needs UNICODE support)
106 return O32_CreateAcceleratorTable(arg1, arg2);
107}
108//******************************************************************************
109//******************************************************************************
110int WIN32API CopyAcceleratorTableA(HACCEL hAccelSrc, LPACCEL lpAccelDest,
111 int cAccelEntries)
112{
113#ifdef DEBUG
114 WriteLog("USER32: CopyAcceleratorTableA, not implemented\n");
115#endif
116 return(0);
117}
118//******************************************************************************
119//TODO:
120//******************************************************************************
121int WIN32API CopyAcceleratorTableW(HACCEL hAccelSrc, LPACCEL lpAccelDest,
122 int cAccelEntries)
123{
124#ifdef DEBUG
125 WriteLog("USER32: CopyAcceleratorTableW, not implemented\n");
126#endif
127 return(0);
128}
129//******************************************************************************
130//******************************************************************************
Note: See TracBrowser for help on using the repository browser.