771
|
1 /* Unicode-encapsulation of Win32 library functions.
|
|
2 Copyright (C) 2000, 2001, 2002 Ben Wing.
|
|
3
|
|
4 This file is part of XEmacs.
|
|
5
|
|
6 XEmacs is free software; you can redistribute it and/or modify it
|
|
7 under the terms of the GNU General Public License as published by the
|
|
8 Free Software Foundation; either version 2, or (at your option) any
|
|
9 later version.
|
|
10
|
|
11 XEmacs is distributed in the hope that it will be useful, but WITHOUT
|
|
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
14 for more details.
|
|
15
|
|
16 You should have received a copy of the GNU General Public License
|
|
17 along with XEmacs; see the file COPYING. If not, write to
|
|
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
19 Boston, MA 02111-1307, USA. */
|
|
20
|
|
21 /* Synched up with: Not in FSF. */
|
|
22
|
|
23 /* Authorship:
|
|
24
|
|
25 Current primary author: Ben Wing <ben@xemacs.org>
|
|
26
|
|
27 Created summer 2000 by Ben Wing. Completed August 2001. Completely
|
|
28 written by Ben Wing.
|
|
29 */
|
|
30
|
|
31 #define NEED_MSWINDOWS_COMMCTRL
|
|
32 #define NEED_MSWINDOWS_SHLOBJ
|
|
33
|
|
34 #include <config.h>
|
|
35 #include "lisp.h"
|
|
36
|
|
37 #include "console-msw.h"
|
|
38
|
|
39 int no_mswin_unicode_lib_calls;
|
|
40
|
|
41 /* The golden rules of writing Unicode-safe code:
|
|
42
|
|
43 -- There are no preprocessor games going on.
|
|
44
|
|
45 -- Do not set the UNICODE constant.
|
|
46
|
|
47 -- You need to change your code to call the Windows API prefixed with "qxe"
|
|
48 functions (when they exist) and use the ...W structs instead of the
|
|
49 generic ones. String arguments in the qxe functions are of type Extbyte
|
|
50 *.
|
|
51
|
|
52 -- You code is responsible for conversion of text arguments. We try to
|
|
53 handle everything else -- the argument differences, the copying back and
|
|
54 forth of structures, etc. Use Qmswindows_tstr and macros such as
|
|
55 C_STRING_TO_TSTR. You are also responsible for interpreting and
|
|
56 specifying string sizes, which have not been changed. Usually these are
|
|
57 in characters, meaning you need to divide by XETCHAR_SIZE. (But, some
|
|
58 functions want sizes in bytes, even with Unicode strings. Look in the
|
|
59 documentation.) Use XETEXT when specifying string constants, so that
|
|
60 they show up in Unicode as necessary.
|
|
61
|
|
62 -- If you need to process external strings (in general you should not do
|
|
63 this; do all your manipulations in internal format and convert at the
|
|
64 point of entry into or exit from the function), use the xet...()
|
|
65 functions.
|
|
66
|
|
67 more specifically:
|
|
68
|
|
69 Unicode support is important for supporting many languages under
|
|
70 Windows, such as Cyrillic, without resorting to translation tables for
|
|
71 particular Windows-specific code pages. Internally, all characters in
|
|
72 Windows can be represented in two encodings: code pages and Unicode.
|
|
73 With Unicode support, we can seamlessly support all Windows
|
|
74 characters. Currently, the test in the drive to support Unicode is if
|
|
75 IME input works properly, since it is being converted from Unicode.
|
|
76
|
|
77 Unicode support also requires that the various Windows API's be
|
|
78 "Unicode-encapsulated", so that they automatically call the ANSI or
|
|
79 Unicode version of the API call appropriately and handle the size
|
|
80 differences in structures. What this means is:
|
|
81
|
|
82 -- first, note that Windows already provides a sort of encapsulation
|
|
83 of all API's that deal with text. All such API's are underlyingly
|
|
84 provided in two versions, with an A or W suffix (ANSI or "wide"
|
|
85 i.e. Unicode), and the compile-time constant UNICODE controls which is
|
|
86 selected by the unsuffixed API. Same thing happens with structures, and
|
|
87 also with types, where the generic types have names beginning with T --
|
|
88 TCHAR, LPTSTR, etc.. Unfortunately, this is compile-time only, not
|
|
89 run-time, so not sufficient. (Creating the necessary run-time encoding
|
|
90 is not conceptually difficult, but very time-consuming to write. It
|
|
91 adds no significant overhead, and the only reason it's not standard in
|
|
92 Windows is conscious marketing attempts by Microsoft to cripple Windows
|
|
93 95. FUCK MICROSOFT! They even describe in a KnowledgeBase article
|
|
94 exactly how to create such an API [although we don't exactly follow
|
|
95 their procedure], and point out its usefulness; the procedure is also
|
|
96 described more generally in Nadine Kano's book on Win32
|
|
97 internationalization -- written SIX YEARS AGO! Obviously Microsoft has
|
|
98 such an API available internally.)
|
|
99
|
|
100 -- what we do is provide an encapsulation of each standard Windows API call
|
|
101 that is split into A and W versions. current theory is to avoid all
|
|
102 preprocessor games; so we name the function with a prefix -- "qxe"
|
|
103 currently -- and require callers to use the prefixed name. Callers need
|
|
104 to explicitly use the W version of all structures, and convert text
|
|
105 themselves using Qmswindows_tstr. the qxe encapsulated version will
|
|
106 automatically call the appropriate A or W version depending on whether
|
|
107 we're running on 9x or NT (you can force use of the A calls on NT,
|
|
108 e.g. for testing purposes, using the command- line switch -nuni aka
|
|
109 -no-unicode-lib-calls), and copy data between W and A versions of the
|
|
110 structures as necessary.
|
|
111
|
|
112 -- We require the caller to handle the actual translation of text to
|
|
113 avoid possible overflow when dealing with fixed-size Windows
|
|
114 structures. There are no such problems when copying data between
|
|
115 the A and W versions because ANSI text is never larger than its
|
|
116 equivalent Unicode representation.
|
|
117
|
|
118 NOTE NOTE NOTE: As of August 2001, Microsoft (finally! See my nasty
|
|
119 comment above) released their own Unicode-encapsulation library, called
|
|
120 Microsoft Layer for Unicode on Windows 95/98/Me Systems. It tries to be
|
|
121 more transparent than we are, in that
|
|
122
|
|
123 -- its routines do ANSI/Unicode string translation, while we don't, for
|
|
124 efficiency (we already have to do internal/external conversion so it's
|
|
125 no extra burden to do the proper conversion directly rather than always
|
|
126 converting to Unicode and then doing a second conversion to ANSI as
|
|
127 necessary)
|
|
128
|
|
129 -- rather than requiring separately-named routines (qxeFooBar), they
|
|
130 physically override the existing routines at the link level. it also
|
|
131 appears that they do this BADLY, in that if you link with the MLU, you
|
|
132 get an application that runs ONLY on Win9x!!! (hint -- use
|
|
133 GetProcAddress()). there's still no way to create a single binary!
|
|
134 fucking losers.
|
|
135
|
|
136 -- they assume you compile with UNICODE defined, so there's no need for the
|
|
137 application to explicitly use ...W structures, as we require.
|
|
138
|
|
139 -- they also intercept windows procedures to deal with notify messages as
|
|
140 necessary, which we don't do yet.
|
|
141
|
|
142 -- they (of course) don't use Extbyte.
|
|
143
|
|
144 at some point (especially when they fix the single-binary problem!), we
|
|
145 should consider switching. for the meantime, we'll stick with what i've
|
|
146 already written. perhaps we should think about adopting some of the
|
|
147 greater transparency they have; but i opted against transparency on
|
|
148 purpose, to make the code easier to follow for someone who's not familiar
|
|
149 with it. until our library is really complete and bug-free, we should
|
|
150 think twice before doing this.
|
|
151 */
|
|
152
|
|
153
|
|
154 /************************************************************************/
|
|
155 /* auto-generation */
|
|
156 /************************************************************************/
|
|
157
|
|
158 /* we use a simple script to control the auto-generation.
|
|
159
|
|
160 \(The following is copied from lib-src/make-mswin-unicode.pl.)
|
|
161
|
|
162 file specifies a file to start reading from.
|
|
163 yes indicates a function to be automatically Unicode-encapsulated.
|
|
164 (All parameters either need no special processing or are LPTSTR or
|
|
165 LPCTSTR.)
|
|
166 soon indicates a function that should be automatically Unicode-encapsulated,
|
|
167 but we're not ready to process it yet.
|
|
168 no indicates a function we don't support (it will be #defined to cause
|
|
169 a compile error, with the text after the function included in the
|
|
170 erroneous definition to indicate why we don't support it).
|
|
171 skip indicates a function we support manually; only a comment about this
|
|
172 will be generated.
|
|
173 split indicates a function with a split structure (different versions
|
|
174 for Unicode and ANSI), but where the only difference is in pointer
|
|
175 types, and the actual size does not differ. The structure name
|
|
176 should follow the function name, and it will be automatically
|
|
177 Unicode-encapsulated with appropriate casts.
|
|
178 begin-bracket indicates a #if statement to be inserted here.
|
|
179 end-bracket indicates the corresponding #endif statement.
|
|
180 blank lines and lines beginning with // are ignored.
|
|
181
|
|
182 The generated files go into intl-auto-encap-win32.[ch].
|
|
183
|
|
184 To regenerate, go to the nt/ subdirectory and type
|
|
185
|
|
186 nmake -f xemacs.mak unicode-encapsulate
|
|
187
|
|
188 This does the following:
|
|
189
|
|
190 cd $(SRC)
|
|
191 perl ../lib-src/make-mswin-unicode.pl --c-output intl-auto-encap-win32.c --h-output intl-auto-encap-win32.h intl-encap-win32.c
|
|
192
|
|
193 */
|
|
194
|
|
195 /*
|
|
196
|
|
197 terminology used below:
|
|
198
|
|
199 "split-simple" means a structure where the A and W versions are the same
|
|
200 size, and the only differences are string pointer arguments. (This does NOT
|
|
201 include structures with a pointer to a split-sized structure within them.)
|
|
202 This can also refer to a function pointer whose only split arguments are
|
|
203 string pointers or split-simple structures.
|
|
204
|
|
205 "split-sized" means a structure where the A and W versions are different
|
|
206 sizes (typically because of an inline string argument), or where there's a
|
|
207 pointer to another split-sized structure.
|
|
208
|
|
209 "split-complex"
|
|
210
|
|
211 begin-unicode-encapsulation-script
|
|
212
|
|
213 file WINBASE.H
|
|
214
|
|
215 yes GetBinaryType
|
|
216 yes GetShortPathName
|
|
217 yes GetLongPathName
|
|
218 yes GetEnvironmentStrings
|
|
219 yes FreeEnvironmentStrings
|
|
220 yes FormatMessage
|
|
221 yes CreateMailslot
|
|
222 begin-bracket !defined (CYGWIN_HEADERS)
|
778
|
223 no EncryptFile Win2K+ only
|
|
224 no DecryptFile Win2K+ only
|
771
|
225 end-bracket
|
|
226 no OpenRaw error "The procedure entry point OpenRawW could not be located in the dynamic link library ADVAPI32.dll."
|
|
227 no QueryRecoveryAgents split-sized LPRECOVERY_AGENT_INFORMATION
|
|
228 yes lstrcmp
|
|
229 yes lstrcmpi
|
|
230 yes lstrcpyn
|
|
231 yes lstrcpy
|
|
232 yes lstrcat
|
|
233 yes lstrlen
|
|
234 yes CreateMutex
|
|
235 yes OpenMutex
|
|
236 yes CreateEvent
|
|
237 yes OpenEvent
|
|
238 yes CreateSemaphore
|
|
239 yes OpenSemaphore
|
|
240 yes CreateWaitableTimer
|
|
241 yes OpenWaitableTimer
|
|
242 yes CreateFileMapping
|
|
243 yes OpenFileMapping
|
|
244 yes GetLogicalDriveStrings
|
|
245 yes LoadLibrary
|
|
246 yes LoadLibraryEx
|
|
247 yes GetModuleFileName
|
|
248 yes GetModuleHandle
|
|
249 split CreateProcess LPSTARTUPINFO
|
|
250 yes FatalAppExit
|
|
251 split GetStartupInfo LPSTARTUPINFO
|
|
252 yes GetCommandLine
|
|
253 yes GetEnvironmentVariable
|
|
254 yes SetEnvironmentVariable
|
|
255 yes ExpandEnvironmentStrings
|
|
256 yes OutputDebugString
|
|
257 yes FindResource
|
|
258 yes FindResourceEx
|
|
259 yes EnumResourceTypes
|
|
260 yes EnumResourceNames
|
|
261 yes EnumResourceLanguages
|
|
262 yes BeginUpdateResource
|
|
263 yes UpdateResource
|
|
264 yes EndUpdateResource
|
|
265 yes GlobalAddAtom
|
|
266 yes GlobalFindAtom
|
|
267 yes GlobalGetAtomName
|
|
268 yes AddAtom
|
|
269 yes FindAtom
|
|
270 yes GetAtomName
|
|
271 yes GetProfileInt
|
|
272 yes GetProfileString
|
|
273 yes WriteProfileString
|
|
274 yes GetProfileSection
|
|
275 yes WriteProfileSection
|
|
276 yes GetPrivateProfileInt
|
|
277 yes GetPrivateProfileString
|
|
278 yes WritePrivateProfileString
|
|
279 yes GetPrivateProfileSection
|
|
280 yes WritePrivateProfileSection
|
|
281 yes GetPrivateProfileSectionNames
|
|
282 yes GetPrivateProfileStruct
|
|
283 yes WritePrivateProfileStruct
|
|
284 yes GetDriveType
|
|
285 yes GetSystemDirectory
|
|
286 yes GetTempPath
|
|
287 yes GetTempFileName
|
|
288 yes GetWindowsDirectory
|
|
289 yes SetCurrentDirectory
|
|
290 yes GetCurrentDirectory
|
|
291 yes GetDiskFreeSpace
|
|
292 yes GetDiskFreeSpaceEx
|
|
293 yes CreateDirectory
|
|
294 yes CreateDirectoryEx
|
|
295 yes RemoveDirectory
|
|
296 yes GetFullPathName
|
|
297 yes DefineDosDevice
|
|
298 yes QueryDosDevice
|
|
299 yes CreateFile
|
|
300 yes SetFileAttributes
|
|
301 yes GetFileAttributes
|
|
302 yes GetFileAttributesEx
|
|
303 yes GetCompressedFileSize
|
|
304 yes DeleteFile
|
|
305 no FindFirstFileEx split-sized LPWIN32_FIND_DATA; not used, NT 4.0+ only
|
|
306 skip FindFirstFile split-sized LPWIN32_FIND_DATA
|
|
307 skip FindNextFile split-sized LPWIN32_FIND_DATA
|
|
308 yes SearchPath
|
|
309 yes CopyFile
|
|
310 yes CopyFileEx NT 4.0+ only
|
|
311 yes MoveFile
|
|
312 yes MoveFileEx
|
|
313 no MoveFileWithProgress NT 5.0+ only
|
|
314 no CreateHardLink NT 5.0+ only
|
|
315 yes CreateNamedPipe
|
|
316 yes GetNamedPipeHandleState
|
|
317 yes CallNamedPipe
|
|
318 yes WaitNamedPipe
|
|
319 yes SetVolumeLabel
|
|
320 yes GetVolumeInformation
|
|
321 yes ClearEventLog
|
|
322 yes BackupEventLog
|
|
323 yes OpenEventLog
|
|
324 yes RegisterEventSource
|
|
325 yes OpenBackupEventLog
|
|
326 yes ReadEventLog
|
|
327 yes ReportEvent
|
|
328 yes AccessCheckAndAuditAlarm
|
|
329 no AccessCheckByTypeAndAuditAlarm NT 5.0+ only
|
|
330 no AccessCheckByTypeResultListAndAuditAlarm NT 5.0+ only
|
|
331 yes ObjectOpenAuditAlarm
|
|
332 yes ObjectPrivilegeAuditAlarm
|
|
333 yes ObjectCloseAuditAlarm
|
|
334 yes ObjectDeleteAuditAlarm
|
|
335 yes PrivilegedServiceAuditAlarm
|
|
336 yes SetFileSecurity
|
|
337 yes GetFileSecurity
|
|
338 yes FindFirstChangeNotification
|
|
339 no ReadDirectoryChanges Unicode-only
|
|
340 yes IsBadStringPtr
|
|
341 yes LookupAccountSid
|
|
342 yes LookupAccountName
|
|
343 yes LookupPrivilegeValue
|
|
344 yes LookupPrivilegeName
|
|
345 yes LookupPrivilegeDisplayName
|
|
346 yes BuildCommDCB
|
|
347 yes BuildCommDCBAndTimeouts
|
|
348 yes CommConfigDialog
|
|
349 yes GetDefaultCommConfig
|
|
350 yes SetDefaultCommConfig
|
|
351 yes GetComputerName
|
|
352 yes SetComputerName
|
|
353 yes GetUserName
|
|
354 yes LogonUser
|
|
355 split CreateProcessAsUser LPSTARTUPINFO
|
|
356 no GetCurrentHwProfile split-sized LPHW_PROFILE_INFO; NT 4.0+ only
|
|
357 no GetVersionEx split-sized LPOSVERSIONINFO
|
|
358 no CreateJobObject NT 5.0+ only
|
|
359 no OpenJobObject NT 5.0+ only
|
|
360
|
|
361 file WINUSER.H
|
|
362
|
|
363 skip MAKEINTRESOURCE macro
|
|
364 yes wvsprintf
|
|
365 no wsprintf varargs
|
|
366 yes LoadKeyboardLayout
|
|
367 yes GetKeyboardLayoutName
|
|
368 no CreateDesktop split-sized LPDEVMODE
|
|
369 yes OpenDesktop
|
|
370 split EnumDesktops DESKTOPENUMPROC // callback fun differs only in string pointer type
|
|
371 yes CreateWindowStation
|
|
372 yes OpenWindowStation
|
|
373 split EnumWindowStations WINSTAENUMPROC // callback fun differs only in string pointer type
|
|
374 yes GetUserObjectInformation
|
|
375 yes SetUserObjectInformation
|
|
376 yes RegisterWindowMessage
|
|
377 yes GetMessage
|
|
378 yes DispatchMessage
|
|
379 yes PeekMessage
|
|
380 skip SendMessage split messages and structures
|
|
381 yes SendMessageTimeout
|
|
382 yes SendNotifyMessage
|
|
383 yes SendMessageCallback
|
|
384 no BroadcastSystemMessage win95 version not split; NT 4.0+ only
|
|
385 no RegisterDeviceNotification NT 5.0+ only
|
|
386 yes PostMessage
|
|
387 yes PostThreadMessage
|
|
388 no PostAppMessage macro
|
|
389 skip DefWindowProc return value is conditionalized on _MAC, messes up parser
|
|
390 no CallWindowProc two versions, STRICT and non-STRICT
|
|
391 skip RegisterClass need to intercept so we can provide our own window procedure and handle split notify messages; split-simple WNDCLASS
|
|
392 skip UnregisterClass need to intercept for reasons related to RegisterClass
|
|
393 split GetClassInfo LPWNDCLASS
|
|
394 skip RegisterClassEx need to intercept so we can provide our own window procedure and handle split notify messages; split-simple WNDCLASSEX; NT 4.0+ only
|
|
395 split GetClassInfoEx LPWNDCLASSEX NT 4.0+ only
|
|
396 yes CreateWindowEx
|
|
397 skip CreateWindow macro
|
|
398 yes CreateDialogParam
|
|
399 split CreateDialogIndirectParam LPCDLGTEMPLATE error in Cygwin prototype (no split) but fixable with typedef
|
|
400 no CreateDialog macro
|
|
401 no CreateDialogIndirect macro w/split LPCDLGTEMPLATE
|
|
402 yes DialogBoxParam
|
|
403 split DialogBoxIndirectParam LPCDLGTEMPLATE error in Cygwin prototype (no split) but fixable with typedef
|
|
404 no DialogBox macro
|
|
405 no DialogBoxIndirect macro w/split LPCDLGTEMPLATE
|
|
406 yes SetDlgItemText
|
|
407 yes GetDlgItemText
|
|
408 yes SendDlgItemMessage
|
|
409 no DefDlgProc return value is conditionalized on _MAC, messes up parser
|
|
410 begin-bracket !defined (CYGWIN_HEADERS)
|
|
411 yes CallMsgFilter
|
|
412 end-bracket
|
|
413 yes RegisterClipboardFormat
|
|
414 yes GetClipboardFormatName
|
|
415 yes CharToOem
|
|
416 yes OemToChar
|
|
417 yes CharToOemBuff
|
|
418 yes OemToCharBuff
|
|
419 yes CharUpper
|
|
420 yes CharUpperBuff
|
|
421 yes CharLower
|
|
422 yes CharLowerBuff
|
|
423 yes CharNext
|
|
424 yes CharPrev
|
|
425 no IsCharAlpha split CHAR
|
|
426 no IsCharAlphaNumeric split CHAR
|
|
427 no IsCharUpper split CHAR
|
|
428 no IsCharLower split CHAR
|
|
429 yes GetKeyNameText
|
|
430 skip VkKeyScan split CHAR
|
|
431 no VkKeyScanEx split CHAR; NT 4.0+ only
|
|
432 yes MapVirtualKey
|
|
433 yes MapVirtualKeyEx NT 4.0+ only
|
|
434 yes LoadAccelerators
|
|
435 yes CreateAcceleratorTable
|
|
436 yes CopyAcceleratorTable
|
|
437 yes TranslateAccelerator
|
|
438 yes LoadMenu
|
|
439 split LoadMenuIndirect MENUTEMPLATE
|
|
440 yes ChangeMenu
|
|
441 yes GetMenuString
|
|
442 yes InsertMenu
|
|
443 yes AppendMenu
|
|
444 yes ModifyMenu
|
|
445 split InsertMenuItem LPCMENUITEMINFO NT 4.0+ only
|
|
446 split GetMenuItemInfo LPMENUITEMINFO NT 4.0+ only
|
|
447 split SetMenuItemInfo LPCMENUITEMINFO NT 4.0+ only
|
|
448 yes DrawText
|
|
449 yes DrawTextEx NT 4.0+ only
|
|
450 yes GrayString
|
|
451 yes DrawState NT 4.0+ only
|
|
452 yes TabbedTextOut
|
|
453 yes GetTabbedTextExtent
|
|
454 yes SetProp
|
|
455 yes GetProp
|
|
456 yes RemoveProp
|
|
457 split EnumPropsEx PROPENUMPROCEX // callback fun differs only in string pointer type
|
|
458 split EnumProps PROPENUMPROC // callback fun differs only in string pointer type
|
|
459 yes SetWindowText
|
|
460 yes GetWindowText
|
|
461 yes GetWindowTextLength
|
|
462 yes MessageBox
|
|
463 yes MessageBoxEx
|
|
464 split MessageBoxIndirect LPMSGBOXPARAMS NT 4.0+ only
|
|
465 yes GetWindowLong
|
|
466 yes SetWindowLong
|
|
467 yes GetClassLong
|
|
468 yes SetClassLong
|
|
469 yes FindWindow
|
|
470 yes FindWindowEx NT 4.0+ only
|
|
471 yes GetClassName
|
|
472 no SetWindowsHook obsolete; two versions, STRICT and non-STRICT
|
|
473 yes SetWindowsHookEx
|
|
474 yes LoadBitmap
|
|
475 yes LoadCursor
|
|
476 yes LoadCursorFromFile
|
|
477 yes LoadIcon
|
|
478 yes LoadImage NT 4.0+ only
|
|
479 yes LoadString
|
|
480 yes IsDialogMessage
|
|
481 yes DlgDirList
|
|
482 yes DlgDirSelectEx
|
|
483 yes DlgDirListComboBox
|
|
484 yes DlgDirSelectComboBoxEx
|
|
485 yes DefFrameProc
|
|
486 no DefMDIChildProc return value is conditionalized on _MAC, messes up parser
|
|
487
|
|
488 yes CreateMDIWindow
|
|
489 yes WinHelp
|
|
490 no ChangeDisplaySettings split-sized LPDEVMODE
|
|
491 no ChangeDisplaySettingsEx split-sized LPDEVMODE; NT 5.0/Win98+ only
|
|
492 no EnumDisplaySettings split-sized LPDEVMODE
|
|
493 no EnumDisplayDevices split-sized PDISPLAY_DEVICE; NT 5.0+ only, no Win98
|
|
494 yes SystemParametersInfo probs w/ICONMETRICS, NONCLIENTMETRICS
|
|
495 no GetMonitorInfo NT 5.0/Win98+ only
|
|
496 no GetWindowModuleFileName NT 5.0+ only
|
|
497 no RealGetWindowClass NT 5.0+ only
|
|
498 no GetAltTabInfo NT 5.0+ only
|
|
499
|
|
500 file WINGDI.H
|
|
501
|
|
502 // split-sized LOGCOLORSPACE
|
|
503 // split-sized TEXTMETRIC
|
|
504 // split-sized NEWTEXTMETRIC
|
|
505 // split-sized NEWTEXTMETRICEX
|
|
506 // split-sized LOGFONT
|
|
507 // split-sized ENUMLOGFONT
|
|
508 // split-sized ENUMLOGFONTEX
|
|
509 // split-sized EXTLOGFONT, used in EMREXTCREATEFONTINDIRECTW (Unicode-only) and (???) in DEVINFO (DDK structure)
|
|
510 // split-sized DEVMODE
|
|
511 // split-sized DISPLAY_DEVICE, used in EnumDisplayDevices
|
|
512 // split-sized OUTLINETEXTMETRIC
|
|
513 // split-simple POLYTEXT
|
|
514 // split-simple GCP_RESULTS
|
|
515 // split-sized function pointer OLDFONTENUMPROC, same as FONTENUMPROC
|
|
516 // split-sized function pointer FONTENUMPROC
|
|
517 yes AddFontResource
|
|
518 yes CopyMetaFile
|
|
519 skip CreateDC split-sized DEVMODE
|
|
520 skip CreateFontIndirect split-sized LOGFONT
|
|
521 yes CreateFont
|
|
522 skip CreateIC split-sized DEVMODE
|
|
523 yes CreateMetaFile
|
|
524 yes CreateScalableFontResource
|
|
525 skip DeviceCapabilities split-sized DEVMODE
|
|
526 skip EnumFontFamiliesEx split-complex FONTENUMPROC; NT 4.0+ only
|
|
527 no EnumFontFamilies split-complex FONTENUMPROC
|
|
528 no EnumFonts split-complex FONTENUMPROC
|
|
529 yes GetCharWidth
|
|
530 yes GetCharWidth32
|
|
531 yes GetCharWidthFloat
|
|
532 yes GetCharABCWidths
|
|
533 yes GetCharABCWidthsFloat
|
|
534 yes GetGlyphOutline
|
|
535 yes GetMetaFile
|
|
536 no GetOutlineTextMetrics split-sized LPOUTLINETEXTMETRIC
|
|
537 yes GetTextExtentPoint
|
|
538 yes GetTextExtentPoint32
|
|
539 yes GetTextExtentExPoint
|
|
540 split GetCharacterPlacement LPGCP_RESULTS NT 4.0+ only
|
|
541 no GetGlyphIndices NT 5.0+ only
|
|
542 no AddFontResourceEx NT 5.0+ only
|
|
543 no RemoveFontResourceEx NT 5.0+ only
|
|
544 // split-sized AXISINFO, used in AXESLIST; NT 5.0+ only
|
|
545 // split-sized AXESLIST, used in ENUMLOGFONTEXDV; NT 5.0+ only
|
|
546 // split-sized ENUMLOGFONTEXDV; NT 5.0+ only
|
|
547 no CreateFontIndirectEx split-sized ENUMLOGFONTEXDV; NT 5.0+ only
|
|
548 // split-sized ENUMTEXTMETRIC, returned in EnumFontFamExProc, on NT 5.0+; NT 5.0+ only
|
|
549 skip ResetDC split-sized DEVMODE
|
|
550 yes RemoveFontResource
|
|
551 yes CopyEnhMetaFile
|
|
552 yes CreateEnhMetaFile
|
|
553 yes GetEnhMetaFile
|
|
554 yes GetEnhMetaFileDescription
|
|
555 skip GetTextMetrics split-sized LPTEXTMETRIC
|
|
556 // split-simple DOCINFO
|
|
557 split StartDoc DOCINFO
|
|
558 skip GetObject split-sized LOGFONT
|
|
559 yes TextOut
|
|
560 yes ExtTextOut
|
|
561 split PolyTextOut POLYTEXT
|
|
562 yes GetTextFace
|
|
563 yes GetKerningPairs
|
|
564 // split-simple function pointer ICMENUMPROC
|
|
565 no GetLogColorSpace split-sized LPLOGCOLORSPACE; NT 4.0+ only
|
|
566 no CreateColorSpace split-sized LPLOGCOLORSPACE; NT 4.0+ only
|
|
567 skip GetICMProfile NT 4.0+ only, error in Cygwin prototype
|
|
568 yes SetICMProfile NT 4.0+ only
|
|
569 split EnumICMProfiles ICMENUMPROC NT 4.0+ only
|
|
570 skip UpdateICMRegKey NT 4.0+ only, error in Cygwin prototype
|
|
571 // non-split EMREXTTEXTOUT (A and W versions identical)
|
|
572 // non-split EMRPOLYTEXTOUT (A and W versions identical)
|
|
573 // Unicode-only EMREXTCREATEFONTINDIRECTW
|
|
574 no wglUseFontBitmaps causes link error
|
|
575 no wglUseFontOutlines causes link error
|
|
576
|
|
577 file WINSPOOL.H
|
|
578
|
|
579 begin-bracket defined (HAVE_MS_WINDOWS)
|
|
580 yes EnumPrinters #### problems with DEVMODE pointer in PRINTER_INFO_2
|
|
581 skip OpenPrinter split-sized DEVMODE pointer in split PRINTER_DEFAULTS
|
|
582 no ResetPrinter split-sized DEVMODE pointer in split PRINTER_DEFAULTS
|
|
583 no SetJob split-sized DEVMODE pointer in split JOB_INFO_2
|
|
584 no GetJob split-sized DEVMODE pointer in split JOB_INFO_2
|
|
585 no EnumJobs split-sized DEVMODE pointer in split JOB_INFO_2
|
|
586 no AddPrinter split-sized DEVMODE pointer in split PRINTER_INFO_2
|
|
587 no SetPrinter split-sized DEVMODE pointer in split PRINTER_INFO_2
|
|
588 no GetPrinter split-sized DEVMODE pointer in split PRINTER_INFO_2
|
|
589 // other than DocumentProperties below, we don't use any of the others,
|
|
590 // and they all pretty much have complicated interfaces with lots of
|
|
591 // split structures, etc.
|
|
592 no AddPrinterDriver not used, complicated interface with split structures
|
|
593 no AddPrinterDriverEx not used, complicated interface with split structures
|
|
594 no EnumPrinterDrivers not used, complicated interface with split structures
|
|
595 no GetPrinterDriver not used, complicated interface with split structures
|
|
596 no GetPrinterDriverDirectory not used, complicated interface with split structures
|
|
597 no DeletePrinterDriver not used, complicated interface with split structures
|
|
598 no DeletePrinterDriverEx not used, complicated interface with split structures
|
|
599 no AddPerMachineConnection not used, complicated interface with split structures
|
|
600 no DeletePerMachineConnection not used, complicated interface with split structures
|
|
601 no EnumPerMachineConnections not used, complicated interface with split structures
|
|
602 no AddPrintProcessor not used, complicated interface with split structures
|
|
603 no EnumPrintProcessors not used, complicated interface with split structures
|
|
604 no GetPrintProcessorDirectory not used, complicated interface with split structures
|
|
605 no EnumPrintProcessorDatatypes not used, complicated interface with split structures
|
|
606 no DeletePrintProcessor not used, complicated interface with split structures
|
|
607 no StartDocPrinter not used, complicated interface with split structures
|
|
608 no AddJob not used, complicated interface with split structures
|
|
609 skip DocumentProperties split-sized DEVMODE, error in Cygwin prototype
|
|
610 no AdvancedDocumentProperties not used, complicated interface with split structures
|
|
611 no GetPrinterData not used, complicated interface with split structures
|
|
612 no GetPrinterDataEx not used, complicated interface with split structures
|
|
613 no EnumPrinterData not used, complicated interface with split structures
|
|
614 no EnumPrinterDataEx not used, complicated interface with split structures
|
|
615 no EnumPrinterKey not used, complicated interface with split structures
|
|
616 no SetPrinterData not used, complicated interface with split structures
|
|
617 no SetPrinterDataEx not used, complicated interface with split structures
|
|
618 no DeletePrinterData not used, complicated interface with split structures
|
|
619 no DeletePrinterDataEx not used, complicated interface with split structures
|
|
620 no DeletePrinterKey not used, complicated interface with split structures
|
|
621 no PrinterMessageBox not used, complicated interface with split structures
|
|
622 no AddForm not used, complicated interface with split structures
|
|
623 no DeleteForm not used, complicated interface with split structures
|
|
624 no GetForm not used, complicated interface with split structures
|
|
625 no SetForm not used, complicated interface with split structures
|
|
626 no EnumForms not used, complicated interface with split structures
|
|
627 no EnumMonitors not used, complicated interface with split structures
|
|
628 no AddMonitor not used, complicated interface with split structures
|
|
629 no DeleteMonitor not used, complicated interface with split structures
|
|
630 no EnumPorts not used, complicated interface with split structures
|
|
631 no AddPort not used, complicated interface with split structures
|
|
632 no ConfigurePort not used, complicated interface with split structures
|
|
633 no DeletePort not used, complicated interface with split structures
|
|
634 no XcvData not used, complicated interface with split structures
|
|
635 no SetPort not used, complicated interface with split structures
|
|
636 no AddPrinterConnection not used, complicated interface with split structures
|
|
637 no DeletePrinterConnection not used, complicated interface with split structures
|
|
638 no AddPrintProvidor not used, complicated interface with split structures
|
|
639 no DeletePrintProvidor not used, complicated interface with split structures
|
|
640 no SetPrinterHTMLView not used, complicated interface with split structures
|
|
641 no GetPrinterHTMLView not used, complicated interface with split structures
|
|
642 end-bracket
|
|
643
|
|
644 file SHELLAPI.H
|
|
645
|
|
646 yes DragQueryFile
|
|
647 yes ShellExecute
|
|
648 yes FindExecutable
|
|
649 no CommandLineToArgv Unicode-only
|
|
650 yes ShellAbout
|
|
651 yes ExtractAssociatedIcon
|
|
652 yes ExtractIcon
|
|
653 // split-simple DRAGINFO, used ??? (docs say "Not currently supported")
|
|
654 begin-bracket !defined (CYGWIN_HEADERS)
|
|
655 yes DoEnvironmentSubst NT 4.0+ only
|
|
656 end-bracket
|
|
657 no FindEnvironmentString causes link error; NT 4.0+ only
|
|
658 skip ExtractIconEx NT 4.0+ only, error in Cygwin prototype
|
|
659 // split-simple SHFILEOPSTRUCT, used in SHFileOperation
|
|
660 // split-simple SHNAMEMAPPING, used in SHFileOperation
|
|
661 split SHFileOperation LPSHFILEOPSTRUCT NT 4.0+ only
|
|
662 // split-simple SHELLEXECUTEINFO, used in ShellExecuteEx
|
|
663 split ShellExecuteEx LPSHELLEXECUTEINFO NT 4.0+ only
|
|
664 no WinExecError causes link error; NT 4.0+ only
|
|
665 begin-bracket !defined (CYGWIN_HEADERS)
|
|
666 yes SHQueryRecycleBin NT 4.0+ only
|
|
667 yes SHEmptyRecycleBin NT 4.0+ only
|
|
668 end-bracket
|
|
669 // split-sized NOTIFYICONDATA, used in Shell_NotifyIcon
|
|
670 no Shell_NotifyIcon split-sized NOTIFYICONDATA, NT 4.0+ only
|
|
671 // split-sized SHFILEINFO, used in SHGetFileInfo
|
|
672 skip SHGetFileInfo split-sized SHFILEINFO, NT 4.0+ only
|
|
673 no SHGetDiskFreeSpace causes link error; NT 4.0+ only
|
|
674 begin-bracket !defined (CYGWIN_HEADERS)
|
|
675 yes SHGetNewLinkInfo NT 4.0+ only
|
|
676 yes SHInvokePrinterCommand NT 4.0+ only
|
|
677 end-bracket
|
|
678
|
|
679 end-unicode-encapsulation-script
|
|
680
|
|
681 file COMMCTRL.H
|
|
682
|
|
683 yes ImageList_LoadImage
|
|
684 WC_HEADER
|
|
685 HDITEM
|
|
686 LPHDITEM
|
|
687 HDM_INSERTITEM
|
|
688 HDM_GETITEM
|
|
689 HDM_SETITEM
|
|
690 HDN_ITEMCHANGING
|
|
691 HDN_ITEMCHANGED
|
|
692 HDN_ITEMCLICK
|
|
693 HDN_ITEMDBLCLICK
|
|
694 HDN_DIVIDERDBLCLICK
|
|
695 HDN_BEGINTRACK
|
|
696 HDN_ENDTRACK
|
|
697 HDN_TRACK
|
|
698 HDN_GETDISPINFO
|
|
699 NMHEADER
|
|
700 LPNMHEADER
|
|
701 NMHDDISPINFO
|
|
702 LPNMHDDISPINFO
|
|
703 TOOLBARCLASSNAME
|
|
704 TBSAVEPARAMS
|
|
705 LPTBSAVEPARAMS
|
|
706 TB_GETBUTTONTEXT
|
|
707 TB_SAVERESTORE
|
|
708 TB_ADDSTRING
|
|
709 TBBUTTONINFO
|
|
710 LPTBBUTTONINFO
|
|
711 TB_GETBUTTONINFO
|
|
712 TB_SETBUTTONINFO
|
|
713 TB_INSERTBUTTON
|
|
714 TB_ADDBUTTONS
|
|
715 TBN_GETINFOTIP
|
|
716 NMTBGETINFOTIP
|
|
717 LPNMTBGETINFOTIP
|
|
718 TBN_GETDISPINFO
|
|
719 LPNMTBDISPINFO
|
|
720 TBN_GETBUTTONINFO
|
|
721 NMTOOLBAR
|
|
722 LPNMTOOLBAR
|
|
723 REBARCLASSNAME
|
|
724 REBARBANDINFO
|
|
725 LPREBARBANDINFO
|
|
726 LPCREBARBANDINFO
|
|
727 RB_INSERTBAND
|
|
728 RB_SETBANDINFO
|
|
729 RB_GETBANDINFO
|
|
730 TOOLTIPS_CLASS
|
|
731 TTTOOLINFO
|
|
732 PTOOLINFO
|
|
733 LPTTTOOLINFO
|
|
734 TTM_ADDTOOL
|
|
735 TTM_DELTOOL
|
|
736 TTM_NEWTOOLRECT
|
|
737 TTM_GETTOOLINFO
|
|
738 TTM_SETTOOLINFO
|
|
739 TTM_HITTEST
|
|
740 TTM_GETTEXT
|
|
741 TTM_UPDATETIPTEXT
|
|
742 TTM_ENUMTOOLS
|
|
743 TTM_GETCURRENTTOOL
|
|
744 TTHITTESTINFO
|
|
745 LPTTHITTESTINFO
|
|
746 TTN_GETDISPINFO
|
|
747 NMTTDISPINFO
|
|
748 LPNMTTDISPINFO
|
|
749 CreateStatusWindow
|
|
750 DrawStatusText
|
|
751 STATUSCLASSNAME
|
|
752 SB_GETTEXT
|
|
753 SB_SETTEXT
|
|
754 SB_GETTEXTLENGTH
|
|
755 SB_SETTIPTEXT
|
|
756 SB_GETTIPTEXT
|
|
757 TRACKBAR_CLASS
|
|
758 UPDOWN_CLASS
|
|
759 PROGRESS_CLASS
|
|
760 HOTKEY_CLASS
|
|
761 WC_LISTVIEW
|
|
762 LVITEM
|
|
763 LPLVITEM
|
|
764 LPSTR_TEXTCALLBACK
|
|
765 LVM_GETITEM
|
|
766 LVM_SETITEM
|
|
767 LVM_INSERTITEM
|
|
768 LVFINDINFO
|
|
769 LVM_FINDITEM
|
|
770 LVM_GETSTRINGWIDTH
|
|
771 LVM_EDITLABEL
|
|
772 LVCOLUMN
|
|
773 LPLVCOLUMN
|
|
774 LVM_GETCOLUMN
|
|
775 LVM_SETCOLUMN
|
|
776 LVM_GETITEMTEXT
|
|
777 LVM_SETITEMTEXT
|
|
778 LVM_GETISEARCHSTRING
|
|
779 LVBKIMAGE
|
|
780 LPLVBKIMAGE
|
|
781 LVM_SETBKIMAGE
|
|
782 LVM_GETBKIMAGE
|
|
783 LVN_ODFINDITEM
|
|
784 LVN_BEGINLABELEDIT
|
|
785 LVN_ENDLABELEDIT
|
|
786 LVN_GETDISPINFO
|
|
787 LVN_SETDISPINFO
|
|
788 NMLVDISPINFO
|
|
789 LVN_GETINFOTIP
|
|
790 NMLVGETINFOTIP
|
|
791 LPNMLVGETINFOTIP
|
|
792 WC_TREEVIEW
|
|
793 TVITEM
|
|
794 LPTVITEM
|
|
795 TVINSERTSTRUCT
|
|
796 LPTVINSERTSTRUCT
|
|
797 TVM_INSERTITEM
|
|
798 TVM_GETITEM
|
|
799 TVM_SETITEM
|
|
800 TVM_EDITLABEL
|
|
801 TVM_GETISEARCHSTRING
|
|
802 NMTREEVIEW
|
|
803 LPNMTREEVIEW
|
|
804 NMTVDISPINFO
|
|
805 LPNMTVDISPINFO
|
|
806 TVN_SELCHANGING
|
|
807 TVN_SELCHANGED
|
|
808 TVN_GETDISPINFO
|
|
809 TVN_SETDISPINFO
|
|
810 TVN_ITEMEXPANDING
|
|
811 TVN_ITEMEXPANDED
|
|
812 TVN_BEGINDRAG
|
|
813 TVN_BEGINRDRAG
|
|
814 TVN_DELETEITEM
|
|
815 TVN_BEGINLABELEDIT
|
|
816 TVN_ENDLABELEDIT
|
|
817 TVN_GETINFOTIP
|
|
818 NMTVGETINFOTIP
|
|
819 LPNMTVGETINFOTIP
|
|
820 WC_COMBOBOXEX
|
|
821 COMBOBOXEXITEM
|
|
822 PCOMBOBOXEXITEM
|
|
823 PCCOMBOBOXEXITEM
|
|
824 CBEM_INSERTITEM
|
|
825 CBEM_SETITEM
|
|
826 CBEM_GETITEM
|
|
827 NMCOMBOBOXEX
|
|
828 PNMCOMBOBOXEX
|
|
829 CBEN_GETDISPINFO
|
|
830 CBEN_DRAGBEGIN
|
|
831 CBEN_ENDEDIT
|
|
832 NMCBEDRAGBEGIN
|
|
833 LPNMCBEDRAGBEGIN
|
|
834 PNMCBEDRAGBEGIN
|
|
835 NMCBEENDEDIT
|
|
836 LPNMCBEENDEDIT
|
|
837 PNMCBEENDEDIT
|
|
838 WC_TABCONTROL
|
|
839 TCITEMHEADER
|
|
840 LPTCITEMHEADER
|
|
841 TCITEM
|
|
842 LPTCITEM
|
|
843 TCM_GETITEM
|
|
844 TCM_SETITEM
|
|
845 TCM_INSERTITEM
|
|
846 ANIMATE_CLASS
|
|
847 ACM_OPEN
|
|
848 MONTHCAL_CLASS
|
|
849 DATETIMEPICK_CLASS
|
|
850 DTM_SETFORMAT
|
|
851 DTN_USERSTRING
|
|
852 NMDATETIMESTRING
|
|
853 LPNMDATETIMESTRING
|
|
854 DTN_WMKEYDOWN
|
|
855 NMDATETIMEWMKEYDOWN
|
|
856 LPNMDATETIMEWMKEYDOWN
|
|
857 DTN_FORMAT
|
|
858 NMDATETIMEFORMAT
|
|
859 LPNMDATETIMEFORMAT
|
|
860 DTN_FORMATQUERY
|
|
861 NMDATETIMEFORMATQUERY
|
|
862 LPNMDATETIMEFORMATQUERY
|
|
863 WC_IPADDRESS
|
|
864 WC_PAGESCROLLER
|
|
865 WC_NATIVEFONTCTL
|
|
866
|
|
867 begin-unicode-encapsulation-script
|
|
868
|
|
869 file COMMDLG.H
|
|
870
|
|
871 split GetOpenFileName LPOPENFILENAME
|
|
872 split GetSaveFileName LPOPENFILENAME
|
|
873 yes GetFileTitle
|
|
874 no CommDlg_OpenSave_GetSpec macro
|
|
875 no CommDlg_OpenSave_GetFilePath macro
|
|
876 no CommDlg_OpenSave_GetFolderPath macro
|
|
877 split ChooseColor LPCHOOSECOLOR
|
|
878 split FindText LPFINDREPLACE
|
|
879 split ReplaceText LPFINDREPLACE
|
|
880 no AfxReplaceText mac only
|
|
881 no ChooseFont split-sized LPLOGFONT in LPCHOOSEFONT
|
|
882 // LBSELCHSTRING
|
|
883 // SHAREVISTRING
|
|
884 // FILEOKSTRING
|
|
885 // COLOROKSTRING
|
|
886 // SETRGBSTRING
|
|
887 // HELPMSGSTRING
|
|
888 // FINDMSGSTRING
|
|
889 skip PrintDlg LPPRINTDLG with split-sized DEVMODE handle
|
|
890 skip PageSetupDlg LPPAGESETUPDLG with split-sized DEVMODE handle
|
|
891
|
|
892 file DDE.H
|
|
893
|
|
894 // nothing
|
|
895
|
|
896 file DDEML.H
|
|
897
|
|
898 yes DdeInitialize
|
|
899 yes DdeCreateStringHandle
|
|
900 yes DdeQueryString
|
|
901 // #### split-sized (or split-simple??? not completely obvious) structure MONHSZSTRUCT, used when DDE event MF_HSZ_INFO is sent as part of the XTYP_MONITOR transaction sent to a DDE callback; not yet handled
|
|
902
|
|
903 file IMM.H
|
|
904
|
|
905 begin-bracket defined (HAVE_MS_WINDOWS)
|
|
906 yes ImmInstallIME
|
|
907 yes ImmGetDescription
|
|
908 yes ImmGetIMEFileName
|
|
909 yes ImmGetCompositionString
|
|
910 yes ImmSetCompositionString
|
|
911 yes ImmGetCandidateListCount
|
|
912 yes ImmGetCandidateList
|
|
913 yes ImmGetGuideLine
|
|
914 skip ImmGetCompositionFont split-sized LOGFONT
|
|
915 skip ImmSetCompositionFont split-sized LOGFONT
|
|
916 yes ImmConfigureIME // split-simple REGISTERWORD
|
|
917 yes ImmEscape // strings of various sorts
|
|
918 yes ImmGetConversionList
|
|
919 yes ImmIsUIMessage
|
|
920 yes ImmRegisterWord
|
|
921 yes ImmUnregisterWord
|
|
922 no ImmGetRegisterWordStyle split-sized STYLEBUF
|
|
923 split ImmEnumRegisterWord REGISTERWORDENUMPROC
|
|
924 no ImmGetImeMenuItems split-sized IMEMENUITEMINFO
|
|
925 end-bracket
|
|
926
|
|
927 file MMSYSTEM.H
|
|
928
|
|
929 yes sndPlaySound
|
|
930 yes PlaySound
|
|
931 no waveOutGetDevCaps split-sized LPWAVEOUTCAPS
|
|
932 yes waveOutGetErrorText
|
|
933 no waveInGetDevCaps split-sized LPWAVEINCAPS
|
|
934 yes waveInGetErrorText
|
|
935 no midiOutGetDevCaps split-sized LPMIDIOUTCAPS
|
|
936 yes midiOutGetErrorText
|
|
937 no midiInGetDevCaps split-sized LPMIDIOUTCAPS
|
|
938 yes midiInGetErrorText
|
|
939 no auxGetDevCaps split-sized LPAUXCAPS
|
|
940 no mixerGetDevCaps split-sized LPMIXERCAPS
|
|
941 no mixerGetLineInfo split-sized LPMIXERLINE
|
|
942 no mixerGetLineControls split-sized LPMIXERCONTROL
|
|
943 no mixerGetControlDetails split-sized LPMIXERCONTROL in LPMIXERLINECONTROLS in LPMIXERCONTROLDETAILS
|
|
944 no joyGetDevCaps split-sized LPJOYCAPS
|
|
945 yes mmioStringToFOURCC
|
|
946 yes mmioInstallIOProc
|
|
947 yes mmioOpen
|
|
948 yes mmioRename
|
|
949 yes mciSendCommand
|
|
950 yes mciSendString
|
|
951 yes mciGetDeviceID
|
|
952 begin-bracket !defined (MINGW)
|
778
|
953 no mciGetDeviceIDFromElementID missing from Win98se version of ADVAPI32.dll
|
771
|
954 end-bracket
|
|
955 yes mciGetErrorString
|
|
956
|
|
957 file WINNETWK.H
|
|
958
|
|
959 begin-bracket defined (HAVE_MS_WINDOWS)
|
|
960 yes WNetAddConnection
|
|
961 split WNetAddConnection2 LPNETRESOURCE
|
|
962 split WNetAddConnection3 LPNETRESOURCE
|
|
963 yes WNetCancelConnection
|
|
964 yes WNetCancelConnection2
|
|
965 yes WNetGetConnection
|
|
966 split WNetUseConnection LPNETRESOURCE
|
|
967 split WNetConnectionDialog1 LPCONNECTDLGSTRUCT contains split-simple LPNETRESOURCE
|
|
968 split WNetDisconnectDialog1 LPDISCDLGSTRUCT
|
|
969 split WNetOpenEnum LPNETRESOURCE
|
|
970 yes WNetEnumResource
|
|
971 yes WNetGetUniversalName
|
|
972 yes WNetGetUser
|
|
973 yes WNetGetProviderName
|
|
974 yes WNetGetNetworkInformation
|
|
975 // split-simple function pointer PFNGETPROFILEPATH
|
|
976 // split-simple function pointer PFNRECONCILEPROFILE
|
|
977 // split-simple function pointer PFNPROCESSPOLICIES
|
|
978 yes WNetGetLastError
|
|
979 split MultinetGetConnectionPerformance LPNETRESOURCE
|
|
980 end-bracket
|
|
981
|
|
982 file IME.H
|
|
983
|
|
984 no SendIMEMessageEx obsolete, no docs available
|
|
985
|
|
986 file OBJBASE.H
|
|
987
|
|
988 // nothing
|
|
989
|
|
990 file SHLOBJ.H
|
|
991
|
|
992 // #### split code for IContextMenu not yet written
|
|
993 // split flag constant GCS_VERB of IContextMenu::GetCommandString
|
|
994 // split flag constant GCS_HELPTEXT of IContextMenu::GetCommandString
|
|
995 // split flag constant GCS_VALIDATE of IContextMenu::GetCommandString
|
|
996 // split string constant CMDSTR_NEWFOLDER of CMINVOKECOMMANDINFO.lpVerb or CMINVOKECOMMANDINFOEX.lpVerbW of IContextMenu::InvokeCommand
|
|
997 // split string constant CMDSTR_VIEWLIST of same
|
|
998 // split string constant CMDSTR_VIEWDETAILS of same
|
|
999 // #### split code for IExtractIcon, IShellLink, IShellExecuteHook, INewShortcutHook, ICopyHook, IFileViewer not yet written
|
|
1000 // split interface IExtractIcon
|
|
1001 // split interface IShellLink
|
|
1002 // split interface IShellExecuteHook
|
|
1003 // split interface INewShortcutHook
|
|
1004 // split interface ICopyHook
|
|
1005 // split interface IFileViewer
|
|
1006 yes SHGetPathFromIDList
|
|
1007 skip SHGetSpecialFolderPath error in Cygwin prototype, missing from Cygwin libraries
|
|
1008 // split-simple structure BROWSEINFO used in SHBrowseForFolder
|
|
1009 skip SHBrowseForFolder need to intercept callback for SendMessage
|
|
1010 // split message BFFM_SETSTATUSTEXT handled in qxeSendMessage
|
|
1011 // split message BFFM_SETSELECTION handled in qxeSendMessage
|
|
1012 // split message BFFM_VALIDATEFAILED handled in qxeSHBrowseForFolder intercept proc
|
|
1013 // #### code to handle split clipboard formats not yet written. this will
|
|
1014 // #### be tricky -- all functions that use such clipboard formats need to
|
|
1015 // #### be split, and the data itself munged. this may be too much effort,
|
|
1016 // #### and we may just need to require that the app itself does the
|
|
1017 // #### splitting.
|
|
1018 // split clipboard format CFSTR_FILEDESCRIPTOR
|
|
1019 // split clipboard format CFSTR_FILENAME
|
|
1020 // split clipboard format CFSTR_FILENAMEMAP
|
|
1021 // split-sized structure FILEDESCRIPTOR
|
|
1022 // split-sized structure FILEGROUPDESCRIPTOR
|
|
1023 // split flag SHCNF_PATH; we intercept SHChangeNotify
|
|
1024 // split flag SHCNF_PRINTER; we intercept SHChangeNotify
|
|
1025 // split flag SHARD_PATH; we intercept SHAddToRecentDocs
|
|
1026 skip SHGetDataFromIDList split-sized WIN32_FIND_DATA or split-simple NETRESOURCE, missing from Cygwin libraries
|
|
1027
|
|
1028 end-unicode-encapsulation-script
|
|
1029
|
|
1030 file WINNLS.H
|
|
1031
|
|
1032 LOCALE_ENUMPROC
|
|
1033 CODEPAGE_ENUMPROC
|
|
1034 DATEFMT_ENUMPROC
|
|
1035 DATEFMT_ENUMPROCEX
|
|
1036 TIMEFMT_ENUMPROC
|
|
1037 CALINFO_ENUMPROC
|
|
1038 CALINFO_ENUMPROCEX
|
|
1039 GetCPInfoEx
|
|
1040 CompareString
|
|
1041 LCMapString
|
|
1042 GetLocaleInfo
|
|
1043 SetLocaleInfo
|
|
1044 GetTimeFormat
|
|
1045 GetDateFormat
|
|
1046 GetNumberFormat
|
|
1047 GetCurrencyFormat
|
|
1048 EnumCalendarInfo
|
|
1049 EnumCalendarInfoEx
|
|
1050 EnumTimeFormats
|
|
1051 EnumDateFormats
|
|
1052 EnumDateFormatsEx
|
|
1053 GetStringTypeEx
|
|
1054 FoldString
|
|
1055 EnumSystemLocales
|
|
1056 EnumSystemCodePages
|
|
1057
|
|
1058 file WINVER.H
|
|
1059
|
|
1060 VerFindFile
|
|
1061 VerInstallFile
|
|
1062 GetFileVersionInfoSize
|
|
1063 GetFileVersionInfo
|
|
1064 VerLanguageName
|
|
1065 VerQueryValue
|
|
1066
|
|
1067 begin-unicode-encapsulation-script
|
|
1068
|
|
1069 file WINCON.H
|
|
1070
|
|
1071 yes PeekConsoleInput
|
|
1072 yes ReadConsoleInput
|
|
1073 yes WriteConsoleInput
|
|
1074 yes ReadConsoleOutput
|
|
1075 yes WriteConsoleOutput
|
|
1076 yes ReadConsoleOutputCharacter
|
|
1077 yes WriteConsoleOutputCharacter
|
|
1078 no FillConsoleOutputCharacter split CHAR
|
|
1079 yes ScrollConsoleScreenBuffer
|
|
1080 yes GetConsoleTitle
|
|
1081 yes SetConsoleTitle
|
|
1082 yes ReadConsole
|
|
1083 yes WriteConsole
|
|
1084
|
|
1085 file WINREG.H
|
|
1086
|
|
1087 skip RegConnectRegistry error in Cygwin prototype
|
|
1088 yes RegCreateKey
|
|
1089 yes RegCreateKeyEx
|
|
1090 yes RegDeleteKey
|
|
1091 yes RegDeleteValue
|
|
1092 yes RegEnumKey
|
|
1093 yes RegEnumKeyEx
|
|
1094 yes RegEnumValue
|
|
1095 yes RegLoadKey
|
|
1096 yes RegOpenKey
|
|
1097 yes RegOpenKeyEx
|
|
1098 yes RegQueryInfoKey
|
|
1099 yes RegQueryValue
|
|
1100 split RegQueryMultipleValues PVALENT
|
|
1101 yes RegQueryValueEx
|
|
1102 yes RegReplaceKey
|
|
1103 yes RegRestoreKey
|
|
1104 yes RegSaveKey
|
|
1105 yes RegSetValue
|
|
1106 yes RegSetValueEx
|
|
1107 yes RegUnLoadKey
|
|
1108 yes InitiateSystemShutdown
|
|
1109 yes AbortSystemShutdown
|
|
1110
|
|
1111 end-unicode-encapsulation-script
|
|
1112
|
|
1113 file EXCPT.H
|
|
1114
|
|
1115 // nothing
|
|
1116
|
|
1117 file STDARG.H
|
|
1118
|
|
1119 // nothing
|
|
1120
|
|
1121 file CDERR.H
|
|
1122
|
|
1123 // nothing
|
|
1124
|
|
1125 file WINPERF.H
|
|
1126
|
|
1127 // nothing
|
|
1128
|
|
1129 file RPC.H
|
|
1130
|
|
1131 // nothing
|
|
1132
|
|
1133 file NB30.H
|
|
1134
|
|
1135 // nothing
|
|
1136
|
|
1137 file WINSOCK2.H
|
|
1138
|
|
1139 SO_PROTOCOL_INFO
|
|
1140 SERVICE_TYPE_VALUE_SAPID
|
|
1141 SERVICE_TYPE_VALUE_TCPPORT
|
|
1142 SERVICE_TYPE_VALUE_UDPPORT
|
|
1143 SERVICE_TYPE_VALUE_OBJECTID
|
|
1144 WSADuplicateSocket
|
|
1145 LPFN_WSADUPLICATESOCKET
|
|
1146 WSAEnumProtocols
|
|
1147 LPFN_WSAENUMPROTOCOLS
|
|
1148 WSASocket
|
|
1149 LPFN_WSASOCKET
|
|
1150 WSAAddressToString
|
|
1151 LPFN_WSAADDRESSTOSTRING
|
|
1152 WSAStringToAddress
|
|
1153 LPFN_WSASTRINGTOADDRESS
|
|
1154 WSALookupServiceBegin
|
|
1155 LPFN_WSALOOKUPSERVICEBEGIN
|
|
1156 WSALookupServiceNext
|
|
1157 LPFN_WSALOOKUPSERVICENEXT
|
|
1158 WSAInstallServiceClass
|
|
1159 LPFN_WSAINSTALLSERVICECLASS
|
|
1160 WSAGetServiceClassInfo
|
|
1161 LPFN_WSAGETSERVICECLASSINFO
|
|
1162 WSAEnumNameSpaceProviders
|
|
1163 LPFN_WSAENUMNAMESPACEPROVIDERS
|
|
1164 WSAGetServiceClassNameByClassId
|
|
1165 LPFN_WSAGETSERVICECLASSNAMEBYCLASSID
|
|
1166 WSASetService
|
|
1167 LPFN_WSASETSERVICE
|
|
1168
|
|
1169 file WINCRYPT.H
|
|
1170
|
|
1171 MS_DEF_PROV_
|
|
1172 MS_ENHANCED_PROV_
|
|
1173 MS_DEF_RSA_SIG_PROV_
|
|
1174 MS_DEF_RSA_SCHANNEL_PROV_
|
|
1175 MS_ENHANCED_RSA_SCHANNEL_PROV_
|
|
1176 MS_DEF_DSS_PROV_
|
|
1177 MS_DEF_DSS_DH_PROV_
|
|
1178 CryptAcquireContext
|
|
1179 CryptSignHash
|
|
1180 CryptVerifySignature
|
|
1181 CryptSetProvider
|
|
1182 CryptSetProviderEx
|
|
1183 CryptGetDefaultProvider
|
|
1184 CryptEnumProviderTypes
|
|
1185 CryptEnumProviders
|
|
1186 CERT_STORE_PROV_FILENAME_
|
|
1187 CERT_STORE_PROV_SYSTEM_
|
|
1188 sz_CERT_STORE_PROV_FILENAME_
|
|
1189 sz_CERT_STORE_PROV_SYSTEM_
|
|
1190 CERT_STORE_SAVE_TO_FILENAME_
|
|
1191 CERT_FIND_SUBJECT_STR_
|
|
1192 CERT_FIND_ISSUER_STR_
|
|
1193 CertRDNValueToStr
|
|
1194 CertNameToStr
|
|
1195 CertStrToName
|
|
1196 CertOpenSystemStore
|
|
1197 CertAddEncodedCertificateToSystemStore
|
|
1198
|
|
1199 */
|
|
1200
|
|
1201 /* the functions below are examples of hand-written Unicode-splitting
|
|
1202 code. note that it needs to be written very carefully and with
|
|
1203 intimate knowledge of the structures involved, and can sometimes be
|
|
1204 very hairy (EnumFontFamiliesEx is the most extreme example). it can
|
|
1205 be argued with some justification that this behind-the-scenes magic
|
|
1206 is confusing and potentially dangerous, and shouldn't be done. but
|
|
1207 making the calling code deal with the results in extremely hard-to-
|
|
1208 read code and is very error-prone. */
|
|
1209
|
|
1210
|
|
1211 /************************************************************************/
|
|
1212 /* would be encapsulatable but for parsing problems */
|
|
1213 /************************************************************************/
|
|
1214
|
|
1215 /* NOTE: return value is conditionalized on _MAC, messes up parser */
|
|
1216 LRESULT
|
|
1217 qxeDefWindowProc (HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
|
1218 {
|
|
1219 if (XEUNICODE_P)
|
|
1220 return DefWindowProcW (hWnd, Msg, wParam, lParam);
|
|
1221 else
|
|
1222 return DefWindowProcA (hWnd, Msg, wParam, lParam);
|
|
1223 }
|
|
1224
|
|
1225
|
|
1226 /* NOTE: two versions, STRICT and non-STRICT */
|
|
1227 LRESULT
|
|
1228 qxeCallWindowProc (WNDPROC lpPrevWndFunc, HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
|
1229 {
|
|
1230 if (XEUNICODE_P)
|
|
1231 return CallWindowProcW (lpPrevWndFunc, hWnd, Msg, wParam, lParam);
|
|
1232 else
|
|
1233 return CallWindowProcA (lpPrevWndFunc, hWnd, Msg, wParam, lParam);
|
|
1234 }
|
|
1235
|
|
1236 /* NOTE: return value is conditionalized on _MAC, messes up parser */
|
|
1237 LRESULT
|
|
1238 qxeDefDlgProc (HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
|
|
1239 {
|
|
1240 if (XEUNICODE_P)
|
|
1241 return DefDlgProcW (hDlg, Msg, wParam, lParam);
|
|
1242 else
|
|
1243 return DefDlgProcA (hDlg, Msg, wParam, lParam);
|
|
1244 }
|
|
1245
|
|
1246 /* NOTE: return value is conditionalized on _MAC, messes up parser */
|
|
1247 LRESULT
|
|
1248 qxeDefMDIChildProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|
1249 {
|
|
1250 if (XEUNICODE_P)
|
|
1251 return DefMDIChildProcW (hWnd, uMsg, wParam, lParam);
|
|
1252 else
|
|
1253 return DefMDIChildProcA (hWnd, uMsg, wParam, lParam);
|
|
1254 }
|
|
1255
|
|
1256
|
|
1257 /************************************************************************/
|
|
1258 /* would be encapsulatable but for Cygwin problems */
|
|
1259 /************************************************************************/
|
|
1260
|
|
1261 LONG
|
|
1262 qxeRegConnectRegistry (const Extbyte * lpMachineName, HKEY hKey, PHKEY phkResult)
|
|
1263 {
|
|
1264 /* Cygwin mistakenly omits const in first argument. */
|
|
1265 if (XEUNICODE_P)
|
|
1266 return RegConnectRegistryW ((LPWSTR) lpMachineName, hKey, phkResult);
|
|
1267 else
|
|
1268 return RegConnectRegistryA ((LPSTR) lpMachineName, hKey, phkResult);
|
|
1269 }
|
|
1270
|
|
1271 /* NOTE: NT 4.0+ only */
|
|
1272 UINT
|
|
1273 qxeExtractIconEx (const Extbyte * lpszFile, int nIconIndex, HICON FAR * phiconLarge, HICON FAR * phiconSmall, UINT nIcons)
|
|
1274 {
|
|
1275 /* Cygwin mistakenly declares the return type as HICON. */
|
|
1276 if (XEUNICODE_P)
|
|
1277 return (UINT) ExtractIconExW ((LPCWSTR) lpszFile, nIconIndex, phiconLarge, phiconSmall, nIcons);
|
|
1278 else
|
|
1279 return (UINT) ExtractIconExA ((LPCSTR) lpszFile, nIconIndex, phiconLarge, phiconSmall, nIcons);
|
|
1280 }
|
|
1281
|
|
1282 /* NOTE: NT 4.0+ only */
|
|
1283 BOOL
|
|
1284 qxeGetICMProfile (HDC arg1, LPDWORD arg2, Extbyte * arg3)
|
|
1285 {
|
|
1286 #ifdef CYGWIN_HEADERS
|
|
1287 /* Cygwin mistakenly declares the second argument as DWORD. */
|
|
1288 if (XEUNICODE_P)
|
|
1289 return GetICMProfileW (arg1, (DWORD) arg2, (LPWSTR) arg3);
|
|
1290 else
|
|
1291 return GetICMProfileA (arg1, (DWORD) arg2, (LPSTR) arg3);
|
|
1292 #else
|
|
1293 if (XEUNICODE_P)
|
|
1294 return GetICMProfileW (arg1, arg2, (LPWSTR) arg3);
|
|
1295 else
|
|
1296 return GetICMProfileA (arg1, arg2, (LPSTR) arg3);
|
|
1297 #endif /* CYGWIN_HEADERS */
|
|
1298 }
|
|
1299
|
|
1300 /* NOTE: NT 4.0+ only */
|
|
1301 BOOL
|
|
1302 qxeUpdateICMRegKey (DWORD arg1, Extbyte * arg2, Extbyte * arg3, UINT arg4)
|
|
1303 {
|
|
1304 #ifdef CYGWIN_HEADERS
|
|
1305 /* Cygwin mistakenly declares the second argument as DWORD. */
|
|
1306 if (XEUNICODE_P)
|
|
1307 return UpdateICMRegKeyW (arg1, (DWORD) arg2, (LPWSTR) arg3, arg4);
|
|
1308 else
|
|
1309 return UpdateICMRegKeyA (arg1, (DWORD) arg2, (LPSTR) arg3, arg4);
|
|
1310 #else
|
|
1311 if (XEUNICODE_P)
|
|
1312 return UpdateICMRegKeyW (arg1, (LPWSTR) arg2, (LPWSTR) arg3, arg4);
|
|
1313 else
|
|
1314 return UpdateICMRegKeyA (arg1, (LPSTR) arg2, (LPSTR) arg3, arg4);
|
|
1315 #endif /* CYGWIN_HEADERS */
|
|
1316 }
|
|
1317
|
|
1318 #ifndef CYGWIN /* present in headers but missing in shell32.a */
|
|
1319
|
|
1320 BOOL
|
|
1321 qxeSHGetSpecialFolderPath (HWND hwndOwner, Extbyte * lpszPath, int nFolder, BOOL fCreate)
|
|
1322 {
|
|
1323 #ifdef CYGWIN_HEADERS
|
|
1324 /* Cygwin mistakenly declares the second argument as LPSTR in both
|
|
1325 versions. */
|
|
1326 if (XEUNICODE_P)
|
|
1327 return SHGetSpecialFolderPathW (hwndOwner, (LPSTR) lpszPath, nFolder, fCreate);
|
|
1328 else
|
|
1329 return SHGetSpecialFolderPathA (hwndOwner, (LPSTR) lpszPath, nFolder, fCreate);
|
|
1330 #else
|
|
1331 if (XEUNICODE_P)
|
|
1332 return SHGetSpecialFolderPathW (hwndOwner, (LPWSTR) lpszPath, nFolder, fCreate);
|
|
1333 else
|
|
1334 return SHGetSpecialFolderPathA (hwndOwner, (LPSTR) lpszPath, nFolder, fCreate);
|
|
1335 #endif
|
|
1336 }
|
|
1337
|
|
1338 #endif /* not CYGWIN */
|
|
1339
|
|
1340
|
|
1341 /************************************************************************/
|
|
1342 /* files */
|
|
1343 /************************************************************************/
|
|
1344
|
|
1345 static void
|
|
1346 copy_win32_find_dataa_to_win32_find_dataw (const WIN32_FIND_DATAA *pa,
|
|
1347 WIN32_FIND_DATAW *pw)
|
|
1348 {
|
|
1349 /* the layout of WIN32_FIND_DATA is
|
|
1350
|
|
1351 non-split fields;
|
|
1352 TCHAR cFileName[...];
|
|
1353 TCHAR cAlternateFileName[...];
|
|
1354 */
|
|
1355
|
|
1356 xzero (*pw);
|
|
1357 memcpy (pw, pa, offsetof (WIN32_FIND_DATAA, cFileName));
|
|
1358 memcpy (pw->cFileName, pa->cFileName, sizeof (pa->cFileName));
|
|
1359 memcpy (pw->cAlternateFileName, pa->cAlternateFileName,
|
|
1360 sizeof (pa->cAlternateFileName));
|
|
1361 }
|
|
1362
|
|
1363 HANDLE
|
|
1364 qxeFindFirstFile (const Extbyte *lpFileName,
|
|
1365 WIN32_FIND_DATAW *lpFindFileData)
|
|
1366 {
|
|
1367 if (XEUNICODE_P)
|
|
1368 return FindFirstFileW ((LPCWSTR) lpFileName, lpFindFileData);
|
|
1369 else
|
|
1370 {
|
|
1371 WIN32_FIND_DATAA ansidat;
|
|
1372 HANDLE retval;
|
|
1373
|
|
1374 retval = FindFirstFileA ((LPCSTR) lpFileName, &ansidat);
|
|
1375 if (retval != INVALID_HANDLE_VALUE)
|
|
1376 copy_win32_find_dataa_to_win32_find_dataw (&ansidat, lpFindFileData);
|
|
1377 return retval;
|
|
1378 }
|
|
1379 }
|
|
1380
|
|
1381 BOOL
|
|
1382 qxeFindNextFile (HANDLE hFindFile, WIN32_FIND_DATAW *lpFindFileData)
|
|
1383 {
|
|
1384 if (XEUNICODE_P)
|
|
1385 return FindNextFileW (hFindFile, lpFindFileData);
|
|
1386 else
|
|
1387 {
|
|
1388 WIN32_FIND_DATAA ansidat;
|
|
1389 BOOL retval;
|
|
1390
|
|
1391 retval = FindNextFileA (hFindFile, &ansidat);
|
|
1392 if (retval)
|
|
1393 copy_win32_find_dataa_to_win32_find_dataw (&ansidat, lpFindFileData);
|
|
1394 return retval;
|
|
1395 }
|
|
1396 }
|
|
1397
|
|
1398
|
|
1399 /************************************************************************/
|
|
1400 /* shell */
|
|
1401 /************************************************************************/
|
|
1402
|
|
1403 static void
|
|
1404 copy_shfileinfoa_to_shfileinfow (const SHFILEINFOA *pa,
|
778
|
1405 SHFILEINFOW *pw, UINT sz)
|
771
|
1406 {
|
|
1407 /* the layout of SHFILEINFO is
|
|
1408
|
|
1409 non-split fields;
|
|
1410 TCHAR szDisplayName[...];
|
|
1411 TCHAR szTypeName[...];
|
|
1412 */
|
|
1413
|
778
|
1414 assert (sz >= sizeof (SHFILEINFOW));
|
771
|
1415 xzero (*pw);
|
|
1416 memcpy (pw, pa, offsetof (SHFILEINFOA, szDisplayName));
|
|
1417 memcpy (pw->szDisplayName, pa->szDisplayName, sizeof (pa->szDisplayName));
|
|
1418 memcpy (pw->szTypeName, pa->szTypeName, sizeof (pa->szTypeName));
|
|
1419 }
|
|
1420
|
|
1421 DWORD
|
|
1422 qxeSHGetFileInfo (const Extbyte *pszPath, DWORD dwFileAttributes,
|
|
1423 SHFILEINFOW *psfi, UINT cbFileInfo, UINT uFlags)
|
|
1424 {
|
|
1425 if (XEUNICODE_P)
|
|
1426 return SHGetFileInfoW ((LPCWSTR) pszPath, dwFileAttributes,
|
|
1427 psfi, cbFileInfo, uFlags);
|
|
1428 else
|
|
1429 {
|
|
1430 SHFILEINFOA ansidat;
|
|
1431 BOOL retval;
|
|
1432
|
|
1433 retval = SHGetFileInfoA ((LPCSTR) pszPath, dwFileAttributes,
|
778
|
1434 (SHFILEINFOA FAR *) &ansidat,
|
|
1435 cbFileInfo ? sizeof (ansidat) : 0, uFlags);
|
|
1436 if (retval && cbFileInfo)
|
|
1437 copy_shfileinfoa_to_shfileinfow (&ansidat, psfi, cbFileInfo);
|
771
|
1438 return retval;
|
|
1439 }
|
|
1440 }
|
|
1441
|
|
1442 struct intercepted_SHBrowseForFolder
|
|
1443 {
|
|
1444 BFFCALLBACK lpfn;
|
|
1445 LPARAM lParam;
|
|
1446 HWND hwnd;
|
|
1447 struct intercepted_SHBrowseForFolder *next;
|
|
1448 };
|
|
1449
|
|
1450 static struct intercepted_SHBrowseForFolder *SHBrowseForFolder_list;
|
|
1451
|
|
1452 static int
|
|
1453 CALLBACK intercepted_SHBrowseForFolder_proc (HWND hwnd, UINT msg,
|
|
1454 LPARAM lParam, LPARAM lpData)
|
|
1455 {
|
|
1456 struct intercepted_SHBrowseForFolder *s =
|
|
1457 (struct intercepted_SHBrowseForFolder *) lpData;
|
|
1458
|
|
1459 if (s->hwnd == 0)
|
|
1460 s->hwnd = hwnd;
|
|
1461 if (s->lpfn)
|
|
1462 {
|
|
1463 /* see below */
|
|
1464 if (XEUNICODE_P && msg == BFFM_VALIDATEFAILEDW)
|
|
1465 msg = BFFM_VALIDATEFAILEDA;
|
|
1466 else if (!XEUNICODE_P && msg == BFFM_VALIDATEFAILEDA)
|
|
1467 msg = BFFM_VALIDATEFAILEDW;
|
|
1468 return (s->lpfn) (hwnd, msg, lParam, s->lParam);
|
|
1469 }
|
|
1470 else
|
|
1471 return 0;
|
|
1472 }
|
|
1473
|
|
1474 static int
|
|
1475 is_SHBrowseForFolder (HWND hwnd)
|
|
1476 {
|
|
1477 struct intercepted_SHBrowseForFolder *s;
|
|
1478
|
|
1479 for (s = SHBrowseForFolder_list; s; s = s->next)
|
|
1480 if (s->hwnd == hwnd)
|
|
1481 return 1;
|
|
1482 return 0;
|
|
1483 }
|
|
1484
|
|
1485 LPITEMIDLIST
|
|
1486 qxeSHBrowseForFolder (LPBROWSEINFOW lpbi)
|
|
1487 {
|
|
1488 struct intercepted_SHBrowseForFolder s;
|
|
1489 LPITEMIDLIST retval;
|
|
1490
|
|
1491 /* There are two outgoing Unicode-split messages:
|
|
1492
|
|
1493 BFFM_SETSELECTION
|
|
1494 BFFM_SETSTATUSTEXT
|
|
1495
|
|
1496 and one incoming:
|
|
1497
|
|
1498 BFFM_VALIDATEFAILED
|
|
1499
|
|
1500 To handle this, we need to intercept the callback. We handle the
|
|
1501 incoming message in the callback, and record the window; when
|
|
1502 qxeSendMessage() is called, we handle the outgoing messages. None of
|
|
1503 the messages have split-sized structures so we don't need to do
|
|
1504 anything complicated there. */
|
|
1505
|
|
1506 s.lParam = lpbi->lParam;
|
|
1507 s.lpfn = lpbi->lpfn;
|
|
1508 s.next = SHBrowseForFolder_list;
|
|
1509 s.hwnd = 0;
|
|
1510 SHBrowseForFolder_list = &s;
|
|
1511
|
|
1512 lpbi->lpfn = intercepted_SHBrowseForFolder_proc;
|
|
1513 lpbi->lParam = (LPARAM) &s;
|
|
1514
|
|
1515 if (XEUNICODE_P)
|
|
1516 retval = SHBrowseForFolderW (lpbi);
|
|
1517 else
|
|
1518 retval = SHBrowseForFolderA ((LPBROWSEINFOA) lpbi);
|
|
1519 SHBrowseForFolder_list = SHBrowseForFolder_list->next;
|
|
1520 return retval;
|
|
1521 }
|
|
1522
|
|
1523 VOID
|
|
1524 qxeSHAddToRecentDocs (UINT uFlags, LPCVOID pv)
|
|
1525 {
|
|
1526 /* pv can be a string pointer; this is handled by Unicode-splitting the
|
|
1527 flag SHARD_PATH rather than the function itself. Fix up the flag to
|
|
1528 be correct. We write it symmetrically so it doesn't matter whether
|
|
1529 UNICODE is defined. */
|
|
1530 if (XEUNICODE_P)
|
|
1531 {
|
|
1532 if (uFlags & SHARD_PATHA)
|
|
1533 {
|
|
1534 uFlags |= SHARD_PATHW;
|
|
1535 uFlags &= ~SHARD_PATHA;
|
|
1536 }
|
|
1537 }
|
|
1538 else
|
|
1539 {
|
|
1540 if (uFlags & SHARD_PATHW)
|
|
1541 {
|
|
1542 uFlags |= SHARD_PATHA;
|
|
1543 uFlags &= ~SHARD_PATHW;
|
|
1544 }
|
|
1545 }
|
|
1546 SHAddToRecentDocs (uFlags, pv);
|
|
1547 }
|
|
1548
|
|
1549 VOID
|
|
1550 qxeSHChangeNotify (LONG wEventId, UINT uFlags, LPCVOID dwItem1,
|
|
1551 LPCVOID dwItem2)
|
|
1552 {
|
|
1553 /* works like SHAddToRecentDocs */
|
|
1554 if (XEUNICODE_P)
|
|
1555 {
|
|
1556 if (uFlags & SHCNF_PATHA)
|
|
1557 {
|
|
1558 uFlags |= SHCNF_PATHW;
|
|
1559 uFlags &= ~SHCNF_PATHA;
|
|
1560 }
|
|
1561 if (uFlags & SHCNF_PRINTERA)
|
|
1562 {
|
|
1563 uFlags |= SHCNF_PRINTERW;
|
|
1564 uFlags &= ~SHCNF_PRINTERA;
|
|
1565 }
|
|
1566 }
|
|
1567 else
|
|
1568 {
|
|
1569 if (uFlags & SHCNF_PATHW)
|
|
1570 {
|
|
1571 uFlags |= SHCNF_PATHA;
|
|
1572 uFlags &= ~SHCNF_PATHW;
|
|
1573 }
|
|
1574 if (uFlags & SHCNF_PRINTERW)
|
|
1575 {
|
|
1576 uFlags |= SHCNF_PRINTERA;
|
|
1577 uFlags &= ~SHCNF_PRINTERW;
|
|
1578 }
|
|
1579 }
|
|
1580 SHChangeNotify (wEventId, uFlags, dwItem1, dwItem2);
|
|
1581 }
|
|
1582
|
|
1583 #ifndef CYGWIN /* present in headers but missing in shell32.a */
|
|
1584
|
|
1585 HRESULT
|
|
1586 qxeSHGetDataFromIDList (IShellFolder *psf, LPCITEMIDLIST pidl, int nFormat,
|
|
1587 PVOID pv, int cb)
|
|
1588 {
|
|
1589 if (XEUNICODE_P)
|
|
1590 return SHGetDataFromIDListW (psf, pidl, nFormat, pv, cb);
|
|
1591 else if (nFormat == SHGDFIL_FINDDATA)
|
|
1592 {
|
|
1593 WIN32_FIND_DATAA ansidat;
|
|
1594 BOOL retval;
|
|
1595
|
|
1596 retval = SHGetDataFromIDListA (psf, pidl, nFormat, &ansidat, cb);
|
|
1597 if (retval == NOERROR)
|
|
1598 copy_win32_find_dataa_to_win32_find_dataw (&ansidat, pv);
|
|
1599 return retval;
|
|
1600 }
|
|
1601 else
|
|
1602 /* nFormat == SHGDFIL_NETRESOURCE, and pv is split-simple NETRESOURCE
|
|
1603 structure, but we don't need to worry about that currently since we
|
|
1604 don't translate strings */
|
|
1605 return SHGetDataFromIDListA (psf, pidl, nFormat, pv, cb);
|
|
1606 }
|
|
1607
|
|
1608 #endif /* not CYGWIN */
|
|
1609
|
|
1610
|
|
1611
|
|
1612 #ifdef HAVE_MS_WINDOWS
|
|
1613
|
|
1614 /************************************************************************/
|
|
1615 /* devmode */
|
|
1616 /************************************************************************/
|
|
1617
|
|
1618 /* These functions return globally allocated blocks because some
|
|
1619 callers (e.g. qxePrintDlg) want this. */
|
|
1620
|
|
1621 static HGLOBAL
|
|
1622 copy_devmodew_to_devmodea (const DEVMODEW *src, DEVMODEA *dst)
|
|
1623 {
|
|
1624 /* the layout of DEVMODE is
|
|
1625
|
|
1626 TCHAR dmDeviceName[...];
|
|
1627 non-split fields, including dmSize (size of structure; differs between
|
|
1628 Unicode and ANSI) and dmDriverExtra;
|
|
1629 TCHAR dmFormName[...];
|
|
1630 non-split fields;
|
|
1631 extra data, of size DEVMODE->dmDriverExtra
|
|
1632 */
|
|
1633 HGLOBAL hdst = NULL;
|
|
1634
|
|
1635 if (!dst)
|
|
1636 {
|
|
1637 hdst = GlobalAlloc (GHND, src->dmSize + src->dmDriverExtra -
|
|
1638 (sizeof (DEVMODEW) - sizeof (DEVMODEA)));
|
|
1639 dst = (DEVMODEA *) GlobalLock (hdst);
|
|
1640 }
|
|
1641
|
|
1642 memcpy (dst->dmDeviceName, src->dmDeviceName, sizeof (dst->dmDeviceName));
|
|
1643 memcpy ((char *) dst + sizeof (dst->dmDeviceName),
|
|
1644 (char *) src + sizeof (src->dmDeviceName),
|
|
1645 offsetof (DEVMODEA, dmFormName) - sizeof (dst->dmDeviceName));
|
|
1646 dst->dmSize -= sizeof (DEVMODEW) - sizeof (DEVMODEA);
|
|
1647 memcpy (dst->dmFormName, src->dmFormName, sizeof (dst->dmFormName));
|
|
1648 memcpy ((char *) dst + offsetof (DEVMODEA, dmFormName) +
|
|
1649 sizeof (dst->dmFormName),
|
|
1650 (char *) src + offsetof (DEVMODEW, dmFormName) +
|
|
1651 sizeof (src->dmFormName),
|
|
1652 dst->dmSize + dst->dmDriverExtra -
|
|
1653 (offsetof (DEVMODEA, dmFormName) + sizeof (dst->dmFormName)));
|
|
1654
|
|
1655 if (hdst)
|
|
1656 GlobalUnlock (hdst);
|
|
1657 return hdst;
|
|
1658 }
|
|
1659
|
|
1660 static HGLOBAL
|
|
1661 copy_devmodea_to_devmodew (const DEVMODEA *src, DEVMODEW *dst)
|
|
1662 {
|
|
1663 HGLOBAL hdst = NULL;
|
|
1664
|
|
1665 if (!dst)
|
|
1666 {
|
|
1667 hdst = GlobalAlloc (GHND, src->dmSize + src->dmDriverExtra +
|
|
1668 (sizeof (DEVMODEW) - sizeof (DEVMODEA)));
|
|
1669 dst = (DEVMODEW *) GlobalLock (hdst);
|
|
1670 }
|
|
1671
|
|
1672 memcpy (dst->dmDeviceName, src->dmDeviceName, sizeof (src->dmDeviceName));
|
|
1673 memcpy ((char *) dst + sizeof (dst->dmDeviceName),
|
|
1674 (char *) src + sizeof (src->dmDeviceName),
|
|
1675 offsetof (DEVMODEA, dmFormName) - sizeof (src->dmDeviceName));
|
|
1676 dst->dmSize += sizeof (DEVMODEW) - sizeof (DEVMODEA);
|
|
1677 memcpy (dst->dmFormName, src->dmFormName, sizeof (src->dmFormName));
|
|
1678 memcpy ((char *) dst + offsetof (DEVMODEW, dmFormName) +
|
|
1679 sizeof (dst->dmFormName),
|
|
1680 (char *) src + offsetof (DEVMODEA, dmFormName) +
|
|
1681 sizeof (src->dmFormName),
|
|
1682 src->dmSize + src->dmDriverExtra -
|
|
1683 (offsetof (DEVMODEA, dmFormName) + sizeof (src->dmFormName)));
|
|
1684
|
|
1685 if (hdst)
|
|
1686 GlobalUnlock (hdst);
|
|
1687 return hdst;
|
|
1688 }
|
|
1689
|
|
1690 HDC
|
|
1691 qxeCreateDC (const Extbyte *lpszDriver, const Extbyte *lpszDevice,
|
|
1692 const Extbyte *lpszOutput, CONST DEVMODEW *lpInitData)
|
|
1693 {
|
|
1694 if (XEUNICODE_P)
|
|
1695 return CreateDCW ((LPCWSTR) lpszDriver, (LPCWSTR) lpszDevice,
|
|
1696 (LPCWSTR) lpszOutput, lpInitData);
|
|
1697 else
|
|
1698 {
|
|
1699 HGLOBAL hInitData = NULL;
|
|
1700 DEVMODEA *lpInitDataa = NULL;
|
|
1701 HDC retval;
|
|
1702
|
|
1703 if (lpInitData)
|
|
1704 {
|
|
1705 hInitData = copy_devmodew_to_devmodea (lpInitData, NULL);
|
|
1706 lpInitDataa = (DEVMODEA *) GlobalLock (hInitData);
|
|
1707 }
|
|
1708 retval = CreateDCA ((LPCSTR) lpszDriver, (LPCSTR) lpszDevice,
|
|
1709 (LPCSTR) lpszOutput, lpInitDataa);
|
|
1710
|
|
1711 if (hInitData)
|
|
1712 {
|
|
1713 GlobalUnlock (hInitData);
|
|
1714 GlobalFree (hInitData);
|
|
1715 }
|
|
1716
|
|
1717 return retval;
|
|
1718 }
|
|
1719 }
|
|
1720
|
|
1721 HDC
|
|
1722 qxeResetDC (HDC hdc, CONST DEVMODEW *lpInitData)
|
|
1723 {
|
|
1724 if (XEUNICODE_P)
|
|
1725 return ResetDCW (hdc, lpInitData);
|
|
1726 else
|
|
1727 {
|
|
1728 HGLOBAL hInitData = NULL;
|
|
1729 DEVMODEA *lpInitDataa = NULL;
|
|
1730 HDC retval;
|
|
1731
|
|
1732 if (lpInitData)
|
|
1733 {
|
|
1734 hInitData = copy_devmodew_to_devmodea (lpInitData, NULL);
|
|
1735 lpInitDataa = (DEVMODEA *) GlobalLock (hInitData);
|
|
1736 }
|
|
1737 retval = ResetDCA (hdc, lpInitDataa);
|
|
1738
|
|
1739 if (hInitData)
|
|
1740 {
|
|
1741 GlobalUnlock (hInitData);
|
|
1742 GlobalFree (hInitData);
|
|
1743 }
|
|
1744
|
|
1745 return retval;
|
|
1746 }
|
|
1747 }
|
|
1748
|
|
1749 DWORD
|
|
1750 qxeOpenPrinter (Extbyte *pPrinterName, LPHANDLE phPrinter,
|
|
1751 LPPRINTER_DEFAULTSW pDefaultconst)
|
|
1752 {
|
|
1753 assert (!pDefaultconst); /* we don't split it, so let's make sure we
|
|
1754 don't try. */
|
|
1755 if (XEUNICODE_P)
|
|
1756 return OpenPrinterW ((LPWSTR) pPrinterName, phPrinter,
|
|
1757 pDefaultconst);
|
|
1758 else
|
|
1759 return OpenPrinterA ((LPSTR) pPrinterName, phPrinter,
|
|
1760 (LPPRINTER_DEFAULTSA) pDefaultconst);
|
|
1761 }
|
|
1762
|
|
1763 LONG
|
|
1764 qxeDocumentProperties (HWND hWnd, HANDLE hPrinter, Extbyte *pDeviceName,
|
|
1765 DEVMODEW *pDevModeOutput, DEVMODEW *pDevModeInput,
|
|
1766 DWORD fMode)
|
|
1767 {
|
|
1768 if (XEUNICODE_P)
|
|
1769 #ifdef CYGWIN_HEADERS
|
|
1770 /* Cygwin mistakenly declares the fourth and fifth arguments as
|
|
1771 PDEVMODEA. */
|
|
1772 return DocumentPropertiesW (hWnd, hPrinter, (LPWSTR) pDeviceName,
|
|
1773 (DEVMODEA *) pDevModeOutput,
|
|
1774 (DEVMODEA *) pDevModeInput, fMode);
|
|
1775 #else
|
|
1776 return DocumentPropertiesW (hWnd, hPrinter, (LPWSTR) pDeviceName,
|
|
1777 pDevModeOutput, pDevModeInput, fMode);
|
|
1778 #endif /* CYGWIN_HEADERS */
|
|
1779 else
|
|
1780 {
|
|
1781 HGLOBAL hDevModeInput = NULL;
|
|
1782 DEVMODEA *pDevModeInputa = NULL;
|
|
1783 LONG retval;
|
|
1784
|
|
1785 if (pDevModeInput)
|
|
1786 {
|
|
1787 hDevModeInput = copy_devmodew_to_devmodea (pDevModeInput, NULL);
|
|
1788 pDevModeInputa = (DEVMODEA *) GlobalLock (hDevModeInput);
|
|
1789 }
|
|
1790
|
|
1791 /* Here we cheat a bit to avoid a problem: If the output
|
|
1792 structure is given but not the input one, how do we know how
|
|
1793 big to allocate our shadow output structure? Since the
|
|
1794 shadow structure is ANSI and the original Unicode, we know
|
|
1795 the shadow structure is smaller than what's given, so we just
|
|
1796 write into the given structure and then fix. */
|
|
1797 retval = DocumentPropertiesA (hWnd, hPrinter, (LPSTR) pDeviceName,
|
|
1798 pDevModeOutput ?
|
|
1799 (DEVMODEA *) pDevModeOutput : 0,
|
|
1800 pDevModeInput ? pDevModeInputa : 0,
|
|
1801 fMode);
|
|
1802
|
|
1803 if (hDevModeInput)
|
|
1804 {
|
|
1805 GlobalUnlock (hDevModeInput);
|
|
1806 GlobalFree (hDevModeInput);
|
|
1807 }
|
|
1808
|
|
1809 if (retval >= 0 && pDevModeOutput)
|
|
1810 {
|
|
1811 /* copy the shadow structure out of the way and then put the
|
|
1812 right contents back. */
|
|
1813 DEVMODEA *shadow = (DEVMODEA *) pDevModeOutput;
|
|
1814 DEVMODEA *newshadow = alloca_array (DEVMODEA, shadow->dmSize +
|
|
1815 shadow->dmDriverExtra);
|
|
1816
|
|
1817 memcpy (newshadow, shadow, shadow->dmSize + shadow->dmDriverExtra);
|
|
1818 copy_devmodea_to_devmodew (newshadow, pDevModeOutput);
|
|
1819 }
|
|
1820
|
|
1821 if (fMode == 0)
|
|
1822 retval += (sizeof (DEVMODEW) - sizeof (DEVMODEA));
|
|
1823 return retval;
|
|
1824 }
|
|
1825 }
|
|
1826
|
|
1827 static BOOL
|
|
1828 ansi_printer_dialog_1 (void *strucked, HGLOBAL *devmode_inout, int do_PrintDlg)
|
|
1829 {
|
|
1830 HGLOBAL hdma = NULL;
|
|
1831 HGLOBAL hdmw = *devmode_inout;
|
|
1832 DEVMODEW *dmw = NULL;
|
|
1833 BOOL retval;
|
|
1834
|
|
1835 if (hdmw != NULL)
|
|
1836 {
|
|
1837 /* copy to shadow in structure if needed */
|
|
1838 dmw = (DEVMODEW *) GlobalLock (hdmw);
|
|
1839 hdma = copy_devmodew_to_devmodea (dmw, NULL);
|
|
1840 *devmode_inout = hdma;
|
|
1841 }
|
|
1842
|
|
1843 if (do_PrintDlg)
|
|
1844 retval = PrintDlgA ((PRINTDLGA *) strucked);
|
|
1845 else
|
|
1846 retval = PageSetupDlgA ((PAGESETUPDLGA *) strucked);
|
|
1847
|
|
1848 if (retval)
|
|
1849 {
|
|
1850 /* copy the shadow output structure back to original, or
|
|
1851 allocate new one. */
|
|
1852 if (*devmode_inout)
|
|
1853 {
|
|
1854 DEVMODEA *newdma = (DEVMODEA *) GlobalLock (*devmode_inout);
|
|
1855 if (dmw)
|
|
1856 {
|
|
1857 copy_devmodea_to_devmodew (newdma, dmw);
|
|
1858 GlobalUnlock (hdmw);
|
|
1859 }
|
|
1860 else
|
|
1861 hdmw = copy_devmodea_to_devmodew (newdma, NULL);
|
|
1862 GlobalUnlock (*devmode_inout);
|
|
1863 GlobalFree (*devmode_inout);
|
|
1864 *devmode_inout = hdmw;
|
|
1865 }
|
|
1866 else if (hdma)
|
|
1867 /* #### can this happen? */
|
|
1868 GlobalFree (hdma);
|
|
1869 }
|
|
1870
|
|
1871 return retval;
|
|
1872 }
|
|
1873
|
|
1874 BOOL
|
|
1875 qxePrintDlg (PRINTDLGW *lppd)
|
|
1876 {
|
|
1877 if (XEUNICODE_P)
|
|
1878 return PrintDlgW (lppd);
|
|
1879 else
|
|
1880 return ansi_printer_dialog_1 (lppd, &lppd->hDevMode, 1);
|
|
1881 }
|
|
1882
|
|
1883 BOOL
|
|
1884 qxePageSetupDlg (PAGESETUPDLGW *lppd)
|
|
1885 {
|
|
1886 if (XEUNICODE_P)
|
|
1887 return PageSetupDlgW (lppd);
|
|
1888 else
|
|
1889 return ansi_printer_dialog_1 (lppd, &lppd->hDevMode, 0);
|
|
1890 }
|
|
1891
|
|
1892
|
|
1893 /************************************************************************/
|
|
1894 /* fonts */
|
|
1895 /************************************************************************/
|
|
1896
|
|
1897 static void
|
|
1898 copy_logfonta_to_logfontw (const LOGFONTA *src, LOGFONTW *dst)
|
|
1899 {
|
|
1900 /* the layout of LOGFONT is
|
|
1901
|
|
1902 non-split fields;
|
|
1903 TCHAR lfFaceName[...];
|
|
1904 */
|
|
1905 memcpy (dst, src, sizeof (LOGFONTA));
|
|
1906 }
|
|
1907
|
|
1908 static void
|
|
1909 copy_logfontw_to_logfonta (const LOGFONTW *src, LOGFONTA *dst)
|
|
1910 {
|
|
1911 memcpy (dst, src, sizeof (LOGFONTA));
|
|
1912 }
|
|
1913
|
|
1914 static void
|
|
1915 copy_enumlogfonta_to_enumlogfontw (const ENUMLOGFONTA *src, ENUMLOGFONTW *dst)
|
|
1916 {
|
|
1917 /* the layout of ENUMLOGFONT is
|
|
1918
|
|
1919 LOGFONT elfLogFont;
|
|
1920 TCHAR elfFullName[...];
|
|
1921 TCHAR elfStyle[...];
|
|
1922 */
|
|
1923 xzero (*dst);
|
|
1924 copy_logfonta_to_logfontw (&src->elfLogFont, &dst->elfLogFont);
|
|
1925 memcpy (dst->elfFullName, src->elfFullName, sizeof (src->elfFullName));
|
|
1926 memcpy (dst->elfStyle, src->elfStyle, sizeof (src->elfStyle));
|
|
1927 }
|
|
1928
|
|
1929 static void
|
|
1930 copy_enumlogfontexa_to_enumlogfontexw (const ENUMLOGFONTEXA *src,
|
|
1931 ENUMLOGFONTEXW *dst)
|
|
1932 {
|
|
1933 /* the layout of ENUMLOGFONT is
|
|
1934
|
|
1935 LOGFONT elfLogFont;
|
|
1936 TCHAR elfFullName[...];
|
|
1937 TCHAR elfStyle[...];
|
|
1938 TCHAR elfScript[...];
|
|
1939 */
|
|
1940 xzero (*dst);
|
|
1941 copy_logfonta_to_logfontw (&src->elfLogFont, &dst->elfLogFont);
|
|
1942 memcpy (dst->elfFullName, src->elfFullName, sizeof (src->elfFullName));
|
|
1943 memcpy (dst->elfStyle, src->elfStyle, sizeof (src->elfStyle));
|
|
1944 memcpy (dst->elfScript, src->elfScript, sizeof (src->elfScript));
|
|
1945 }
|
|
1946
|
|
1947 static void
|
|
1948 copy_newtextmetrica_to_newtextmetricw (const NEWTEXTMETRICA *src,
|
|
1949 NEWTEXTMETRICW *dst)
|
|
1950 {
|
|
1951 /* the layout of NEWTEXTMETRIC is
|
|
1952
|
|
1953 non-split fields;
|
|
1954 WCHAR/BYTE tmFirstChar;
|
|
1955 WCHAR/BYTE tmLastChar;
|
|
1956 WCHAR/BYTE tmDefaultChar;
|
|
1957 WCHAR/BYTE tmBreakChar;
|
|
1958 BYTE tmItalic;
|
|
1959 non-split fields;
|
|
1960 */
|
|
1961 xzero (*dst);
|
|
1962 memcpy ((char *) dst, (char *) src,
|
|
1963 offsetof (NEWTEXTMETRICA, tmFirstChar));
|
|
1964 memcpy ((char *) dst + offsetof (NEWTEXTMETRICW, tmItalic),
|
|
1965 (char *) src + offsetof (NEWTEXTMETRICA, tmItalic),
|
|
1966 sizeof (NEWTEXTMETRICA) - offsetof (NEWTEXTMETRICA, tmItalic));
|
|
1967 dst->tmFirstChar = (WCHAR) src->tmFirstChar;
|
|
1968 dst->tmLastChar = (WCHAR) src->tmLastChar;
|
|
1969 dst->tmDefaultChar = (WCHAR) src->tmDefaultChar;
|
|
1970 dst->tmBreakChar = (WCHAR) src->tmBreakChar;
|
|
1971 }
|
|
1972
|
|
1973 static void
|
|
1974 copy_newtextmetricexa_to_newtextmetricexw (const NEWTEXTMETRICEXA *src,
|
|
1975 NEWTEXTMETRICEXW *dst)
|
|
1976 {
|
|
1977 /* the layout of NEWTEXTMETRICEX is
|
|
1978
|
|
1979 NEWTEXTMETRICA/W ntmTm;
|
|
1980 FONTSIGNATURE ntmFontSig;
|
|
1981 */
|
|
1982 copy_newtextmetrica_to_newtextmetricw (&src->ntmTm, &dst->ntmTm);
|
|
1983 dst->ntmFontSig = src->ntmFontSig;
|
|
1984 }
|
|
1985
|
|
1986 static void
|
|
1987 copy_textmetricw_to_textmetrica (const TEXTMETRICW *src,
|
|
1988 TEXTMETRICA *dst)
|
|
1989 {
|
|
1990 /* the layout of TEXTMETRIC is like NEWTEXTMETRIC; see above. */
|
|
1991 xzero (*dst);
|
|
1992 memcpy ((char *) dst, (char *) src,
|
|
1993 offsetof (TEXTMETRICA, tmFirstChar));
|
|
1994 memcpy ((char *) dst + offsetof (TEXTMETRICA, tmItalic),
|
|
1995 (char *) src + offsetof (TEXTMETRICW, tmItalic),
|
|
1996 sizeof (TEXTMETRICA) - offsetof (TEXTMETRICA, tmItalic));
|
|
1997 dst->tmFirstChar = (BYTE) src->tmFirstChar;
|
|
1998 dst->tmLastChar = (BYTE) src->tmLastChar;
|
|
1999 dst->tmDefaultChar = (BYTE) src->tmDefaultChar;
|
|
2000 dst->tmBreakChar = (BYTE) src->tmBreakChar;
|
|
2001 }
|
|
2002
|
|
2003 static void
|
|
2004 copy_textmetrica_to_textmetricw (const TEXTMETRICA *src,
|
|
2005 TEXTMETRICW *dst)
|
|
2006 {
|
|
2007 /* the layout of TEXTMETRIC is like NEWTEXTMETRIC; see above. */
|
|
2008 xzero (*dst);
|
|
2009 memcpy ((char *) dst, (char *) src,
|
|
2010 offsetof (TEXTMETRICA, tmFirstChar));
|
|
2011 memcpy ((char *) dst + offsetof (TEXTMETRICW, tmItalic),
|
|
2012 (char *) src + offsetof (TEXTMETRICA, tmItalic),
|
|
2013 sizeof (TEXTMETRICA) - offsetof (TEXTMETRICA, tmItalic));
|
|
2014 dst->tmFirstChar = (WCHAR) src->tmFirstChar;
|
|
2015 dst->tmLastChar = (WCHAR) src->tmLastChar;
|
|
2016 dst->tmDefaultChar = (WCHAR) src->tmDefaultChar;
|
|
2017 dst->tmBreakChar = (WCHAR) src->tmBreakChar;
|
|
2018 }
|
|
2019
|
|
2020 typedef int (CALLBACK *qxeEnumFontFamExProcW) (ENUMLOGFONTEXW *lpelfe,
|
|
2021 NEWTEXTMETRICEXW *lpntme,
|
|
2022 DWORD FontType,
|
|
2023 LPARAM lParam);
|
|
2024
|
|
2025 struct qxeEnumFontFamExProcA_wrapper_t
|
|
2026 {
|
|
2027 qxeEnumFontFamExProcW orig_proc;
|
|
2028 LPARAM orig_lparam;
|
|
2029 };
|
|
2030
|
|
2031 static int CALLBACK
|
|
2032 qxeEnumFontFamExProcA_wrapper (ENUMLOGFONTEXA *lpelfe,
|
|
2033 NEWTEXTMETRICEXA *lpntme,
|
|
2034 DWORD fontType,
|
|
2035 struct qxeEnumFontFamExProcA_wrapper_t
|
|
2036 *closure)
|
|
2037 {
|
|
2038 ENUMLOGFONTEXW lpelfew;
|
|
2039 NEWTEXTMETRICEXW lpntmew;
|
|
2040
|
|
2041 /* #### if we're on Windows 2000 or above, lpelfe is actually an
|
|
2042 ENUMLOGFONTEXDV structure, and lpntme is an ENUMTEXTMETRIC structure
|
|
2043 when TRUETYPE_FONTTYPE. both are split-sized and need their own copy
|
|
2044 functions. need to handle. */
|
|
2045 copy_enumlogfontexa_to_enumlogfontexw (lpelfe, &lpelfew);
|
|
2046 if (fontType & TRUETYPE_FONTTYPE)
|
|
2047 copy_newtextmetricexa_to_newtextmetricexw (lpntme, &lpntmew);
|
|
2048 else
|
|
2049 {
|
|
2050 /* see docs of EnumFontFamExProc */
|
|
2051 xzero (lpntmew);
|
|
2052 copy_textmetrica_to_textmetricw ((TEXTMETRICA *) lpntme,
|
|
2053 (TEXTMETRICW *) &lpntmew);
|
|
2054 }
|
|
2055 return (closure->orig_proc) (&lpelfew, &lpntmew, fontType,
|
|
2056 closure->orig_lparam);
|
|
2057 }
|
|
2058
|
|
2059 int
|
|
2060 qxeEnumFontFamiliesEx (HDC hdc, LOGFONTW *lpLogfont,
|
|
2061 FONTENUMPROCW lpEnumFontFamProc, LPARAM lParam,
|
|
2062 DWORD dwFlags)
|
|
2063 {
|
|
2064 if (XEUNICODE_P)
|
|
2065 return EnumFontFamiliesExW (hdc, lpLogfont, lpEnumFontFamProc, lParam,
|
|
2066 dwFlags);
|
|
2067 else
|
|
2068 {
|
|
2069 struct qxeEnumFontFamExProcA_wrapper_t closure;
|
|
2070 LOGFONTA lfa;
|
|
2071
|
|
2072 closure.orig_proc = (qxeEnumFontFamExProcW) lpEnumFontFamProc;
|
|
2073 closure.orig_lparam = lParam;
|
|
2074 copy_logfontw_to_logfonta (lpLogfont, &lfa);
|
|
2075 return EnumFontFamiliesExA (hdc, &lfa,
|
|
2076 (FONTENUMPROCA)
|
|
2077 qxeEnumFontFamExProcA_wrapper,
|
|
2078 (LPARAM) &closure, dwFlags);
|
|
2079 }
|
|
2080 }
|
|
2081
|
|
2082 HFONT
|
|
2083 qxeCreateFontIndirect (CONST LOGFONTW *lplf)
|
|
2084 {
|
|
2085 if (XEUNICODE_P)
|
|
2086 return CreateFontIndirectW (lplf);
|
|
2087 else
|
|
2088 {
|
|
2089 LOGFONTA lfa;
|
|
2090
|
|
2091 copy_logfontw_to_logfonta (lplf, &lfa);
|
|
2092 return CreateFontIndirectA (&lfa);
|
|
2093 }
|
|
2094 }
|
|
2095
|
|
2096 BOOL
|
|
2097 qxeImmSetCompositionFont (HIMC imc, LOGFONTW *lplf)
|
|
2098 {
|
|
2099 if (XEUNICODE_P)
|
|
2100 return ImmSetCompositionFontW (imc, lplf);
|
|
2101 else
|
|
2102 {
|
|
2103 LOGFONTA lfa;
|
|
2104
|
|
2105 copy_logfontw_to_logfonta (lplf, &lfa);
|
|
2106 return ImmSetCompositionFontA (imc, &lfa);
|
|
2107 }
|
|
2108 }
|
|
2109
|
|
2110 BOOL
|
|
2111 qxeImmGetCompositionFont (HIMC imc, LOGFONTW *lplf)
|
|
2112 {
|
|
2113 if (XEUNICODE_P)
|
|
2114 return ImmGetCompositionFontW (imc, lplf);
|
|
2115 else
|
|
2116 {
|
|
2117 LOGFONTA lfa;
|
|
2118 BOOL retval = ImmGetCompositionFontA (imc, &lfa);
|
|
2119
|
|
2120 if (retval)
|
|
2121 copy_logfonta_to_logfontw (&lfa, lplf);
|
|
2122 return retval;
|
|
2123 }
|
|
2124 }
|
|
2125
|
|
2126 int
|
|
2127 qxeGetObject (HGDIOBJ hgdiobj, int cbBuffer, LPVOID lpvObject)
|
|
2128 {
|
|
2129 if (XEUNICODE_P)
|
|
2130 return GetObjectW (hgdiobj, cbBuffer, lpvObject);
|
|
2131 else
|
|
2132 {
|
|
2133 if (cbBuffer == sizeof (LOGFONTW))
|
|
2134 {
|
|
2135 LOGFONTA lfa;
|
|
2136 int retval = GetObjectA (hgdiobj, sizeof (LOGFONTA), &lfa);
|
|
2137
|
|
2138 if (!retval)
|
|
2139 return retval;
|
|
2140 copy_logfonta_to_logfontw (&lfa, (LOGFONTW *) lpvObject);
|
|
2141 return retval;
|
|
2142 }
|
|
2143 else
|
|
2144 return GetObjectA (hgdiobj, cbBuffer, lpvObject);
|
|
2145 }
|
|
2146 }
|
|
2147
|
|
2148 BOOL
|
|
2149 qxeGetTextMetrics (HDC hdc, LPTEXTMETRICW lptm)
|
|
2150 {
|
|
2151 if (XEUNICODE_P)
|
|
2152 return GetTextMetricsW (hdc, lptm);
|
|
2153 else
|
|
2154 {
|
|
2155 TEXTMETRICA tma;
|
|
2156 BOOL retval = GetTextMetricsA (hdc, &tma);
|
|
2157
|
|
2158 if (retval)
|
|
2159 copy_textmetrica_to_textmetricw (&tma, lptm);
|
|
2160 return retval;
|
|
2161 }
|
|
2162 }
|
|
2163
|
|
2164
|
|
2165 /************************************************************************/
|
|
2166 /* windows */
|
|
2167 /************************************************************************/
|
|
2168
|
|
2169 typedef struct Intercepted_wnd_proc
|
|
2170 {
|
|
2171 WNDPROC proc;
|
|
2172 Extbyte *name;
|
|
2173 int is_ansi;
|
|
2174 } Intercepted_wnd_proc;
|
|
2175
|
|
2176 typedef struct
|
|
2177 {
|
|
2178 Dynarr_declare (Intercepted_wnd_proc);
|
|
2179 } Intercepted_wnd_proc_dynarr;
|
|
2180
|
|
2181 static Intercepted_wnd_proc_dynarr *intercepted_wnd_procs;
|
|
2182
|
|
2183 static Intercepted_wnd_proc *
|
|
2184 find_window_class (const Extbyte *name, int is_ansi)
|
|
2185 {
|
|
2186 int i;
|
|
2187
|
|
2188 if (!intercepted_wnd_procs)
|
|
2189 intercepted_wnd_procs = Dynarr_new (Intercepted_wnd_proc);
|
|
2190
|
|
2191 for (i = 0; i < Dynarr_length (intercepted_wnd_procs); i++)
|
|
2192 {
|
|
2193 Intercepted_wnd_proc *s = Dynarr_atp (intercepted_wnd_procs, i);
|
|
2194
|
|
2195 if (s->is_ansi == is_ansi && (is_ansi ? !strcmp (s->name, name) :
|
|
2196 !wcscmp ((wchar_t *) s->name,
|
|
2197 (wchar_t *) name)))
|
|
2198 return s;
|
|
2199 }
|
|
2200
|
|
2201 return 0;
|
|
2202 }
|
|
2203
|
|
2204 /* ####
|
|
2205
|
|
2206 check problem with cutting and pasting in my current mule -- if i cut,
|
|
2207 then go to another application, then switch back to this one and
|
|
2208 paste, it seems to get confused -- loses the size or something?
|
|
2209
|
|
2210 other things: split flags on CreateProcess and DDE stuff should be
|
|
2211 handled by us.
|
|
2212 */
|
|
2213
|
|
2214 static LRESULT WINAPI
|
|
2215 intercepted_wnd_proc (HWND hwnd, UINT message_, WPARAM wParam, LPARAM lParam)
|
|
2216 {
|
|
2217 Intercepted_wnd_proc *s;
|
|
2218 int is_ansi = XEUNICODE_P ? !IsWindowUnicode (hwnd) : 1;
|
|
2219 Extbyte *classname;
|
|
2220 int size = 100;
|
|
2221
|
|
2222 /* Just in case XEUNICODE_P changes during the execution of the program
|
|
2223 (admittedly, unlikely), check whether the window is Unicode and keep
|
|
2224 track of this in the list of classes. */
|
|
2225 while (1)
|
|
2226 {
|
|
2227 classname = alloca_extbytes (size * XETCHAR_SIZE);
|
|
2228 if ((is_ansi ? GetClassNameA (hwnd, (LPSTR) classname, size) :
|
|
2229 GetClassNameW (hwnd, (LPWSTR) classname, size)) < size - 1)
|
|
2230 break;
|
|
2231 size *= 2;
|
|
2232 }
|
|
2233
|
|
2234 s = find_window_class (classname, is_ansi);
|
|
2235
|
|
2236 assert (s);
|
|
2237
|
|
2238 if (message_ == WM_NOTIFY)
|
|
2239 {
|
|
2240 LPNMHDR nmhdr = (LPNMHDR) lParam;
|
|
2241 int putback = nmhdr->code;
|
|
2242 int do_putback = 0;
|
|
2243
|
|
2244 #define FROB(msg) \
|
|
2245 case msg##W: \
|
|
2246 /* split structures are the same size, so no conversion necessary */ \
|
|
2247 nmhdr->code = (UINT) msg##A; \
|
|
2248 do_putback = 1; \
|
|
2249 break;
|
|
2250 switch (nmhdr->code)
|
|
2251 {
|
|
2252 /* NMHEADER */
|
|
2253 FROB (HDN_ITEMCHANGING);
|
|
2254 FROB (HDN_ITEMCHANGED);
|
|
2255 FROB (HDN_ITEMCLICK);
|
|
2256 FROB (HDN_ITEMDBLCLICK);
|
|
2257 FROB (HDN_DIVIDERDBLCLICK);
|
|
2258 FROB (HDN_BEGINTRACK);
|
|
2259 FROB (HDN_ENDTRACK);
|
|
2260 FROB (HDN_TRACK);
|
|
2261 /* NMDISPINFO */
|
|
2262 FROB (HDN_GETDISPINFO);
|
|
2263 /* NMTBGETINFOTIP */
|
|
2264 FROB (TBN_GETINFOTIP);
|
|
2265 /* NMTBDISPINFO */
|
|
2266 FROB (TBN_GETDISPINFO);
|
|
2267 /* NMTOOLBAR */
|
|
2268 FROB (TBN_GETBUTTONINFO);
|
|
2269
|
|
2270 /* split-sized NMTTDISPINFO */
|
|
2271 FROB (TTN_GETDISPINFO); /* handle the ...W case; then handle the
|
|
2272 ...A case specially, since we need to
|
|
2273 mess with the structure */
|
|
2274 case TTN_GETDISPINFOA: /* same as TTN_NEEDTEXTA */
|
|
2275 {
|
|
2276 NMTTDISPINFOW *nmw = alloca_new (NMTTDISPINFOW);
|
|
2277 NMTTDISPINFOA *nma = (NMTTDISPINFOA *) lParam;
|
|
2278 LRESULT retval;
|
|
2279 /* the layout of NMTTDISPINFO is
|
|
2280
|
|
2281 non-split fields;
|
|
2282 TCHAR szText[...];
|
|
2283 non-split fields;
|
|
2284 */
|
|
2285
|
|
2286 xzero (*nmw);
|
|
2287 /* copy to ...W struct for Unicode code */
|
|
2288 memcpy ((char *) nmw, (char *) nma,
|
|
2289 offsetof (NMTTDISPINFOA, szText));
|
|
2290 memcpy ((char *) nmw + offsetof (NMTTDISPINFOW, szText) +
|
|
2291 sizeof (nmw->szText),
|
|
2292 (char *) nma + offsetof (NMTTDISPINFOA, szText) +
|
|
2293 sizeof (nma->szText),
|
|
2294 sizeof (NMTTDISPINFOA) -
|
|
2295 (offsetof (NMTTDISPINFOA, szText) + sizeof (nma->szText)));
|
|
2296 memcpy (nmw->szText, nma->szText, sizeof (nma->szText));
|
|
2297 retval = (s->proc) (hwnd, message_, wParam, lParam);
|
|
2298 /* copy back to ...A struct */
|
|
2299 xzero (*nma);
|
|
2300 memcpy ((char *) nma, (char *) nmw,
|
|
2301 offsetof (NMTTDISPINFOA, szText));
|
|
2302 memcpy ((char *) nma + offsetof (NMTTDISPINFOA, szText) +
|
|
2303 sizeof (nma->szText),
|
|
2304 (char *) nmw + offsetof (NMTTDISPINFOW, szText) +
|
|
2305 sizeof (nmw->szText),
|
|
2306 sizeof (NMTTDISPINFOA) -
|
|
2307 (offsetof (NMTTDISPINFOA, szText) + sizeof (nma->szText)));
|
|
2308 memcpy (nma->szText, nmw->szText, sizeof (nma->szText));
|
|
2309 return retval;
|
|
2310 }
|
|
2311
|
|
2312 /* NMLVFINDITEM */
|
|
2313 FROB (LVN_ODFINDITEM);
|
|
2314 /* NMLVDISPINFO */
|
|
2315 FROB (LVN_BEGINLABELEDIT);
|
|
2316 FROB (LVN_ENDLABELEDIT);
|
|
2317 FROB (LVN_GETDISPINFO);
|
|
2318 FROB (LVN_SETDISPINFO);
|
|
2319 /* NMLVGETINFOTIP */
|
|
2320 FROB (LVN_GETINFOTIP);
|
|
2321 /* NMTREEVIEW */
|
|
2322 FROB (TVN_SELCHANGING);
|
|
2323 FROB (TVN_SELCHANGED);
|
|
2324 FROB (TVN_ITEMEXPANDING);
|
|
2325 FROB (TVN_ITEMEXPANDED);
|
|
2326 FROB (TVN_BEGINDRAG);
|
|
2327 FROB (TVN_BEGINRDRAG);
|
|
2328 FROB (TVN_DELETEITEM);
|
|
2329 /* NMTVDISPINFO */
|
|
2330 FROB (TVN_GETDISPINFO);
|
|
2331 FROB (TVN_SETDISPINFO);
|
|
2332 FROB (TVN_BEGINLABELEDIT);
|
|
2333 FROB (TVN_ENDLABELEDIT);
|
|
2334 /* NMTVGETINFOTIP */
|
|
2335 FROB (TVN_GETINFOTIP);
|
|
2336 /* NMCOMBOBOXEX */
|
|
2337 FROB (CBEN_GETDISPINFO);
|
|
2338
|
|
2339 /* split-sized NMCBEDRAGBEGIN */
|
|
2340 FROB (CBEN_DRAGBEGIN); /* handle the ...W case; then handle the
|
|
2341 ...A case specially, since we need to
|
|
2342 mess with the structure */
|
|
2343 {
|
|
2344 NMCBEDRAGBEGINW *nmw = alloca_new (NMCBEDRAGBEGINW);
|
|
2345 NMCBEDRAGBEGINA *nma = (NMCBEDRAGBEGINA *) lParam;
|
|
2346 LRESULT retval;
|
|
2347 /* the layout of NNMCBEDRAGBEGIN is
|
|
2348
|
|
2349 non-split fields;
|
|
2350 TCHAR szText[...];
|
|
2351 */
|
|
2352
|
|
2353 xzero (*nmw);
|
|
2354 /* copy to ...W struct for Unicode code */
|
|
2355 memcpy ((char *) nmw, (char *) nma,
|
|
2356 sizeof (*nma));
|
|
2357 retval = (s->proc) (hwnd, message_, wParam, lParam);
|
|
2358 /* copy back to ...A struct */
|
|
2359 xzero (*nma);
|
|
2360 memcpy ((char *) nma, (char *) nmw,
|
|
2361 sizeof (*nma));
|
|
2362 return retval;
|
|
2363 }
|
|
2364
|
|
2365 /* split-sized NMCBEENDEDIT */
|
|
2366 FROB (CBEN_ENDEDIT); /* handle the ...W case; then handle the
|
|
2367 ...A case specially, since we need to
|
|
2368 mess with the structure */
|
|
2369 {
|
|
2370 NMCBEENDEDITW *nmw = alloca_new (NMCBEENDEDITW);
|
|
2371 NMCBEENDEDITA *nma = (NMCBEENDEDITA *) lParam;
|
|
2372 LRESULT retval;
|
|
2373 /* the layout of NMCBEENDEDIT is
|
|
2374
|
|
2375 non-split fields;
|
|
2376 TCHAR szText[...];
|
|
2377 non-split fields;
|
|
2378 */
|
|
2379
|
|
2380 xzero (*nmw);
|
|
2381 /* copy to ...W struct for Unicode code */
|
|
2382 memcpy ((char *) nmw, (char *) nma,
|
|
2383 offsetof (NMCBEENDEDITA, szText));
|
|
2384 memcpy ((char *) nmw + offsetof (NMCBEENDEDITW, szText) +
|
|
2385 sizeof (nmw->szText),
|
|
2386 (char *) nma + offsetof (NMCBEENDEDITA, szText) +
|
|
2387 sizeof (nma->szText),
|
|
2388 sizeof (NMCBEENDEDITA) -
|
|
2389 (offsetof (NMCBEENDEDITA, szText) + sizeof (nma->szText)));
|
|
2390 memcpy (nmw->szText, nma->szText, sizeof (nma->szText));
|
|
2391 retval = (s->proc) (hwnd, message_, wParam, lParam);
|
|
2392 /* copy back to ...A struct */
|
|
2393 xzero (*nma);
|
|
2394 memcpy ((char *) nma, (char *) nmw,
|
|
2395 offsetof (NMCBEENDEDITA, szText));
|
|
2396 memcpy ((char *) nma + offsetof (NMCBEENDEDITA, szText) +
|
|
2397 sizeof (nma->szText),
|
|
2398 (char *) nmw + offsetof (NMCBEENDEDITW, szText) +
|
|
2399 sizeof (nmw->szText),
|
|
2400 sizeof (NMCBEENDEDITA) -
|
|
2401 (offsetof (NMCBEENDEDITA, szText) + sizeof (nma->szText)));
|
|
2402 memcpy (nma->szText, nmw->szText, sizeof (nma->szText));
|
|
2403 return retval;
|
|
2404 }
|
|
2405
|
|
2406 /* NMDATETIMESTRING */
|
|
2407 FROB (DTN_USERSTRING);
|
|
2408 /* NMDATETIMEWMKEYDOWN */
|
|
2409 FROB (DTN_WMKEYDOWN);
|
|
2410
|
|
2411 /* split-sized NMDATETIMEFORMAT */
|
|
2412 FROB (DTN_FORMAT); /* handle the ...W case; then handle the
|
|
2413 ...A case specially, since we need to
|
|
2414 mess with the structure */
|
|
2415 {
|
|
2416 NMDATETIMEFORMATW *nmw = alloca_new (NMDATETIMEFORMATW);
|
|
2417 NMDATETIMEFORMATA *nma = (NMDATETIMEFORMATA *) lParam;
|
|
2418 LRESULT retval;
|
|
2419 /* the layout of NMDATETIMEFORMAT is
|
|
2420
|
|
2421 non-split fields;
|
|
2422 TCHAR szText[...];
|
|
2423 */
|
|
2424
|
|
2425 xzero (*nmw);
|
|
2426 /* copy to ...W struct for Unicode code */
|
|
2427 memcpy ((char *) nmw, (char *) nma,
|
|
2428 sizeof (*nma));
|
|
2429 retval = (s->proc) (hwnd, message_, wParam, lParam);
|
|
2430 /* copy back to ...A struct */
|
|
2431 xzero (*nma);
|
|
2432 memcpy ((char *) nma, (char *) nmw,
|
|
2433 sizeof (*nma));
|
|
2434 return retval;
|
|
2435 }
|
|
2436
|
|
2437 /* NMDATETIMEFORMATQUERY */
|
|
2438 FROB (DTN_FORMATQUERY);
|
|
2439 default: break;
|
|
2440 }
|
|
2441 #undef FROB
|
|
2442 if (do_putback)
|
|
2443 {
|
|
2444 LRESULT retval = (s->proc) (hwnd, message_, wParam, lParam);
|
|
2445 ((LPNMHDR) lParam)->code = putback;
|
|
2446 return retval;
|
|
2447 }
|
|
2448 }
|
|
2449
|
|
2450 return (s->proc) (hwnd, message_, wParam, lParam);
|
|
2451 }
|
|
2452
|
|
2453 ATOM
|
|
2454 qxeRegisterClass (CONST WNDCLASSW * lpWndClass)
|
|
2455 {
|
|
2456 Intercepted_wnd_proc *s =
|
|
2457 find_window_class ((Extbyte *) lpWndClass->lpszClassName, !XEUNICODE_P);
|
|
2458 WNDCLASSW classnew;
|
|
2459
|
|
2460 if (s)
|
|
2461 {
|
|
2462 s->proc = lpWndClass->lpfnWndProc;
|
|
2463 s->name = (Extbyte *) lpWndClass->lpszClassName;
|
|
2464 s->is_ansi = !XEUNICODE_P;
|
|
2465 }
|
|
2466 else
|
|
2467 {
|
|
2468 Intercepted_wnd_proc news;
|
|
2469 news.proc = lpWndClass->lpfnWndProc;
|
|
2470 news.name = (Extbyte *) lpWndClass->lpszClassName;
|
|
2471 news.is_ansi = !XEUNICODE_P;
|
|
2472 Dynarr_add (intercepted_wnd_procs, news);
|
|
2473 }
|
|
2474 classnew = *lpWndClass;
|
|
2475 classnew.lpfnWndProc = intercepted_wnd_proc;
|
|
2476 if (XEUNICODE_P)
|
|
2477 return RegisterClassW (&classnew);
|
|
2478 else
|
|
2479 return RegisterClassA ((CONST WNDCLASSA *) &classnew);
|
|
2480 }
|
|
2481
|
|
2482 BOOL
|
|
2483 qxeUnregisterClass (const Extbyte * lpClassName, HINSTANCE hInstance)
|
|
2484 {
|
|
2485 Intercepted_wnd_proc *s =
|
|
2486 find_window_class (lpClassName, !XEUNICODE_P);
|
|
2487
|
|
2488 if (s)
|
|
2489 Dynarr_delete_by_pointer (intercepted_wnd_procs, s);
|
|
2490 if (XEUNICODE_P)
|
|
2491 return UnregisterClassW ((LPCWSTR) lpClassName, hInstance);
|
|
2492 else
|
|
2493 return UnregisterClassA ((LPCSTR) lpClassName, hInstance);
|
|
2494 }
|
|
2495
|
|
2496 /* NOTE: NT 4.0+ only */
|
|
2497 ATOM
|
|
2498 qxeRegisterClassEx (CONST WNDCLASSEXW *lpWndClass)
|
|
2499 {
|
|
2500 Intercepted_wnd_proc *s =
|
|
2501 find_window_class ((Extbyte *) lpWndClass->lpszClassName, !XEUNICODE_P);
|
|
2502 WNDCLASSEXW classnew;
|
|
2503
|
|
2504 if (s)
|
|
2505 {
|
|
2506 s->proc = lpWndClass->lpfnWndProc;
|
|
2507 s->name = (Extbyte *) lpWndClass->lpszClassName;
|
|
2508 s->is_ansi = !XEUNICODE_P;
|
|
2509 }
|
|
2510 else
|
|
2511 {
|
|
2512 Intercepted_wnd_proc news;
|
|
2513 news.proc = lpWndClass->lpfnWndProc;
|
|
2514 news.name = (Extbyte *) lpWndClass->lpszClassName;
|
|
2515 news.is_ansi = !XEUNICODE_P;
|
|
2516 Dynarr_add (intercepted_wnd_procs, news);
|
|
2517 }
|
|
2518 classnew = *lpWndClass;
|
|
2519 classnew.lpfnWndProc = intercepted_wnd_proc;
|
|
2520 if (XEUNICODE_P)
|
|
2521 return RegisterClassExW (&classnew);
|
|
2522 else
|
|
2523 return RegisterClassExA ((CONST WNDCLASSEXA *) &classnew);
|
|
2524 }
|
|
2525
|
|
2526
|
|
2527 /************************************************************************/
|
|
2528 /* COMMCTRL.H */
|
|
2529 /************************************************************************/
|
|
2530
|
|
2531 /* there are only four structures in commctrl.h that cannot be cast
|
|
2532 between Unicode/ANSI versions:
|
|
2533
|
|
2534 NMTTDISPINFO aka TOOLTIPTEXT
|
|
2535 NMCBEDRAGBEGIN
|
|
2536 NMCBEENDEDIT
|
|
2537 NMDATETIMEFORMAT
|
|
2538
|
|
2539 these are all notify structures, and we handle them above in
|
|
2540 intercepted_wnd_proc().
|
|
2541
|
|
2542 in addition, this constant is weird, being a struct size of one of these:
|
|
2543
|
|
2544 NMTTDISPINFO_V1_SIZE
|
|
2545 */
|
|
2546
|
|
2547 /*
|
|
2548 split class names:
|
|
2549
|
|
2550 WC_HEADER
|
|
2551 TOOLBARCLASSNAME
|
|
2552 REBARCLASSNAME
|
|
2553 TOOLTIPS_CLASS
|
|
2554 STATUSCLASSNAME
|
|
2555 TRACKBAR_CLASS
|
|
2556 UPDOWN_CLASS
|
|
2557 PROGRESS_CLASS
|
|
2558 HOTKEY_CLASS
|
|
2559 WC_LISTVIEW
|
|
2560 WC_TREEVIEW
|
|
2561 WC_COMBOBOXEX
|
|
2562 WC_TABCONTROL
|
|
2563 ANIMATE_CLASS
|
|
2564 MONTHCAL_CLASS
|
|
2565 DATETIMEPICK_CLASS
|
|
2566 WC_IPADDRESS
|
|
2567 WC_PAGESCROLLER
|
|
2568 WC_NATIVEFONTCTL
|
|
2569 */
|
|
2570
|
|
2571 /*
|
|
2572 SendMessage split messages:
|
|
2573
|
|
2574 HDM_INSERTITEM
|
|
2575 HDM_GETITEM
|
|
2576 HDM_SETITEM
|
|
2577 TB_GETBUTTONTEXT
|
|
2578 TB_SAVERESTORE
|
|
2579 TB_ADDSTRING
|
|
2580 TB_GETBUTTONINFO
|
|
2581 TB_SETBUTTONINFO
|
|
2582 TB_INSERTBUTTON
|
|
2583 TB_ADDBUTTONS
|
|
2584 RB_INSERTBAND
|
|
2585 RB_SETBANDINFO
|
|
2586 RB_GETBANDINFO
|
|
2587 TTM_ADDTOOL
|
|
2588 TTM_DELTOOL
|
|
2589 TTM_NEWTOOLRECT
|
|
2590 TTM_GETTOOLINFO
|
|
2591 TTM_SETTOOLINFO
|
|
2592 TTM_HITTEST
|
|
2593 TTM_GETTEXT
|
|
2594 TTM_UPDATETIPTEXT
|
|
2595 TTM_ENUMTOOLS
|
|
2596 TTM_GETCURRENTTOOL
|
|
2597 SB_GETTEXT
|
|
2598 SB_SETTEXT
|
|
2599 SB_GETTEXTLENGTH
|
|
2600 SB_SETTIPTEXT
|
|
2601 SB_GETTIPTEXT
|
|
2602 LVM_GETITEM
|
|
2603 LVM_SETITEM
|
|
2604 LVM_INSERTITEM
|
|
2605 LVM_FINDITEM
|
|
2606 LVM_GETSTRINGWIDTH
|
|
2607 LVM_EDITLABEL
|
|
2608 LVM_GETCOLUMN
|
|
2609 LVM_SETCOLUMN
|
|
2610 LVM_GETITEMTEXT
|
|
2611 LVM_SETITEMTEXT
|
|
2612 LVM_GETISEARCHSTRING
|
|
2613 LVM_SETBKIMAGE
|
|
2614 LVM_GETBKIMAGE
|
|
2615 TVM_INSERTITEM
|
|
2616 TVM_GETITEM
|
|
2617 TVM_SETITEM
|
|
2618 TVM_EDITLABEL
|
|
2619 TVM_GETISEARCHSTRING
|
|
2620 CBEM_INSERTITEM
|
|
2621 CBEM_SETITEM
|
|
2622 CBEM_GETITEM
|
|
2623 TCM_GETITEM
|
|
2624 TCM_SETITEM
|
|
2625 TCM_INSERTITEM
|
|
2626 ACM_OPEN
|
|
2627 DTM_SETFORMAT
|
|
2628 BFFM_SETSTATUSTEXT
|
|
2629 BFFM_SETSELECTION
|
|
2630 */
|
|
2631
|
|
2632 /*
|
|
2633 split notify messages:
|
|
2634
|
|
2635 HDN_ITEMCHANGING
|
|
2636 HDN_ITEMCHANGED
|
|
2637 HDN_ITEMCLICK
|
|
2638 HDN_ITEMDBLCLICK
|
|
2639 HDN_DIVIDERDBLCLICK
|
|
2640 HDN_BEGINTRACK
|
|
2641 HDN_ENDTRACK
|
|
2642 HDN_TRACK
|
|
2643 HDN_GETDISPINFO
|
|
2644 TBN_GETINFOTIP
|
|
2645 TBN_GETDISPINFO
|
|
2646 TBN_GETBUTTONINFO
|
|
2647 TTN_GETDISPINFO
|
|
2648 TTN_NEEDTEXTW
|
|
2649 LVN_ODFINDITEM
|
|
2650 LVN_BEGINLABELEDIT
|
|
2651 LVN_ENDLABELEDIT
|
|
2652 LVN_GETDISPINFO
|
|
2653 LVN_SETDISPINFO
|
|
2654 LVN_GETINFOTIP
|
|
2655 TVN_SELCHANGING
|
|
2656 TVN_SELCHANGED
|
|
2657 TVN_GETDISPINFO
|
|
2658 TVN_SETDISPINFO
|
|
2659 TVN_ITEMEXPANDING
|
|
2660 TVN_ITEMEXPANDED
|
|
2661 TVN_BEGINDRAG
|
|
2662 TVN_BEGINRDRAG
|
|
2663 TVN_DELETEITEM
|
|
2664 TVN_BEGINLABELEDIT
|
|
2665 TVN_ENDLABELEDIT
|
|
2666 TVN_GETINFOTIP
|
|
2667 CBEN_GETDISPINFO
|
|
2668 CBEN_DRAGBEGIN
|
|
2669 CBEN_ENDEDIT
|
|
2670 DTN_USERSTRING
|
|
2671 DTN_WMKEYDOWN
|
|
2672 DTN_FORMAT
|
|
2673 DTN_FORMATQUERY
|
|
2674 BFFM_VALIDATEFAILED (send to SHBrowseForFolder procedure)
|
|
2675 */
|
|
2676
|
|
2677 /*
|
|
2678 split structures:
|
|
2679
|
|
2680 TV_INSERTSTRUCT (simple-split, though -- just cast)
|
|
2681 TC_ITEM (simple-split, though -- just cast)
|
|
2682
|
|
2683 ####
|
|
2684 */
|
|
2685
|
|
2686 /*
|
|
2687 split macros or macros needing splitting:
|
|
2688
|
|
2689 ####
|
|
2690 */
|
|
2691
|
|
2692 LRESULT
|
|
2693 qxeSendMessage (HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
|
2694 {
|
|
2695 #define FROB(msg) \
|
|
2696 case msg##A: \
|
|
2697 /* split structures are the same size, so no conversion necessary */ \
|
|
2698 Msg = msg##W; \
|
|
2699 break;
|
|
2700
|
|
2701 if (XEUNICODE_P)
|
|
2702 {
|
|
2703 WCHAR classname[100];
|
|
2704 /* the name for SHBrowseForFolder windows is non-obvious so we have
|
|
2705 to intercept the callback */
|
|
2706 if (is_SHBrowseForFolder (hWnd))
|
|
2707 {
|
|
2708 switch (Msg)
|
|
2709 {
|
|
2710 FROB (BFFM_SETSELECTION);
|
|
2711 FROB (BFFM_SETSTATUSTEXT);
|
|
2712 default: break;
|
|
2713 }
|
|
2714 }
|
|
2715 else if (!GetClassNameW (hWnd, classname, 100))
|
|
2716 ;
|
|
2717 /* luckily, subclassing leaves the name alone, so we can still
|
|
2718 determine fairly easily the correct class to switch on */
|
|
2719 else if (!wcscmp (classname, WC_HEADERW))
|
|
2720 {
|
|
2721 switch (Msg)
|
|
2722 {
|
|
2723 FROB (HDM_INSERTITEM);
|
|
2724 FROB (HDM_GETITEM);
|
|
2725 FROB (HDM_SETITEM);
|
|
2726 default: break;
|
|
2727 }
|
|
2728 }
|
|
2729 else if (!wcscmp (classname, TOOLBARCLASSNAMEW))
|
|
2730 {
|
|
2731 switch (Msg)
|
|
2732 {
|
|
2733 FROB (TB_GETBUTTONTEXT);
|
|
2734 FROB (TB_SAVERESTORE);
|
|
2735 FROB (TB_ADDSTRING);
|
|
2736 FROB (TB_GETBUTTONINFO);
|
|
2737 FROB (TB_SETBUTTONINFO);
|
|
2738 FROB (TB_INSERTBUTTON);
|
|
2739 FROB (TB_ADDBUTTONS);
|
|
2740 default: break;
|
|
2741 }
|
|
2742 }
|
|
2743 else if (!wcscmp (classname, REBARCLASSNAMEW))
|
|
2744 {
|
|
2745 switch (Msg)
|
|
2746 {
|
|
2747 FROB (RB_INSERTBAND);
|
|
2748 FROB (RB_SETBANDINFO);
|
|
2749 FROB (RB_GETBANDINFO);
|
|
2750 default: break;
|
|
2751 }
|
|
2752 }
|
|
2753 else if (!wcscmp (classname, TOOLTIPS_CLASSW))
|
|
2754 {
|
|
2755 switch (Msg)
|
|
2756 {
|
|
2757 FROB (TTM_ADDTOOL);
|
|
2758 FROB (TTM_DELTOOL);
|
|
2759 FROB (TTM_NEWTOOLRECT);
|
|
2760 FROB (TTM_GETTOOLINFO);
|
|
2761 FROB (TTM_SETTOOLINFO);
|
|
2762 FROB (TTM_HITTEST);
|
|
2763 FROB (TTM_GETTEXT);
|
|
2764 FROB (TTM_UPDATETIPTEXT);
|
|
2765 FROB (TTM_ENUMTOOLS);
|
|
2766 FROB (TTM_GETCURRENTTOOL);
|
|
2767 default: break;
|
|
2768 }
|
|
2769 }
|
|
2770 else if (!wcscmp (classname, STATUSCLASSNAMEW))
|
|
2771 {
|
|
2772 switch (Msg)
|
|
2773 {
|
|
2774 FROB (SB_GETTEXT);
|
|
2775 FROB (SB_SETTEXT);
|
|
2776 FROB (SB_GETTEXTLENGTH);
|
|
2777 FROB (SB_SETTIPTEXT);
|
|
2778 FROB (SB_GETTIPTEXT);
|
|
2779 default: break;
|
|
2780 }
|
|
2781 }
|
|
2782 else if (!wcscmp (classname, WC_LISTVIEWW))
|
|
2783 {
|
|
2784 switch (Msg)
|
|
2785 {
|
|
2786 FROB (LVM_GETITEM);
|
|
2787 FROB (LVM_SETITEM);
|
|
2788 FROB (LVM_INSERTITEM);
|
|
2789 FROB (LVM_FINDITEM);
|
|
2790 FROB (LVM_GETSTRINGWIDTH);
|
|
2791 FROB (LVM_EDITLABEL);
|
|
2792 FROB (LVM_GETCOLUMN);
|
|
2793 FROB (LVM_SETCOLUMN);
|
|
2794 FROB (LVM_GETITEMTEXT);
|
|
2795 FROB (LVM_SETITEMTEXT);
|
|
2796 FROB (LVM_GETISEARCHSTRING);
|
|
2797 FROB (LVM_SETBKIMAGE);
|
|
2798 FROB (LVM_GETBKIMAGE);
|
|
2799 default: break;
|
|
2800 }
|
|
2801 }
|
|
2802 else if (!wcscmp (classname, WC_TREEVIEWW))
|
|
2803 {
|
|
2804 switch (Msg)
|
|
2805 {
|
|
2806 FROB (TVM_INSERTITEM); /* no need to split TV_INSERTSTRUCT */
|
|
2807 FROB (TVM_GETITEM);
|
|
2808 FROB (TVM_SETITEM);
|
|
2809 FROB (TVM_EDITLABEL);
|
|
2810 FROB (TVM_GETISEARCHSTRING);
|
|
2811 default: break;
|
|
2812 }
|
|
2813 }
|
|
2814 else if (!wcscmp (classname, WC_COMBOBOXEXW))
|
|
2815 {
|
|
2816 switch (Msg)
|
|
2817 {
|
|
2818 FROB (CBEM_INSERTITEM);
|
|
2819 FROB (CBEM_SETITEM);
|
|
2820 FROB (CBEM_GETITEM);
|
|
2821 default: break;
|
|
2822 }
|
|
2823 }
|
|
2824 else if (!wcscmp (classname, WC_TABCONTROLW))
|
|
2825 {
|
|
2826 switch (Msg)
|
|
2827 {
|
|
2828 FROB (TCM_GETITEM);
|
|
2829 FROB (TCM_SETITEM);
|
|
2830 FROB (TCM_INSERTITEM); /* no need to split TC_ITEM */
|
|
2831 default: break;
|
|
2832 }
|
|
2833 }
|
|
2834 else if (!wcscmp (classname, ANIMATE_CLASSW))
|
|
2835 {
|
|
2836 switch (Msg)
|
|
2837 {
|
|
2838 FROB (ACM_OPEN);
|
|
2839 default: break;
|
|
2840 }
|
|
2841 }
|
|
2842 else if (!wcscmp (classname, DATETIMEPICK_CLASSW))
|
|
2843 {
|
|
2844 switch (Msg)
|
|
2845 {
|
|
2846 FROB (DTM_SETFORMAT);
|
|
2847 default: break;
|
|
2848 }
|
|
2849 }
|
|
2850 }
|
|
2851
|
|
2852 if (XEUNICODE_P)
|
|
2853 return SendMessageW (hWnd, Msg, wParam, lParam);
|
|
2854 else
|
|
2855 return SendMessageA (hWnd, Msg, wParam, lParam);
|
|
2856
|
|
2857 #undef FROB
|
|
2858 }
|
|
2859
|
|
2860 #endif /* HAVE_MS_WINDOWS */
|
|
2861
|
|
2862
|