source: trunk/include/helpers/winh.h@ 84

Last change on this file since 84 was 84, checked in by umoeller, 24 years ago

Many misc updates.

  • Property svn:eol-style set to CRLF
  • Property svn:keywords set to Author Date Id Revision
File size: 33.5 KB
Line 
1
2/*
3 *@@sourcefile winh.h:
4 * header file for winh.c (PM helper funcs). See remarks there.
5 *
6 * Special #define's which this thing reacts to:
7 *
8 * -- If WINH_STANDARDWRAPPERS is defined to anything, this include
9 * file maps a number of freqently API calls (such as WinSendMsg)
10 * to winh* equivalents to reduce the amount of fixup records
11 * in the final executable.
12 *
13 * Note: Version numbering in this file relates to XWorkplace version
14 * numbering.
15 */
16
17/* Copyright (C) 1997-2000 Ulrich M”ller.
18 * This file is part of the "XWorkplace helpers" source package.
19 * This is free software; you can redistribute it and/or modify
20 * it under the terms of the GNU General Public License as published
21 * by the Free Software Foundation, in version 2 as it comes in the
22 * "COPYING" file of the XWorkplace main distribution.
23 * This program is distributed in the hope that it will be useful,
24 * but WITHOUT ANY WARRANTY; without even the implied warranty of
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 * GNU General Public License for more details.
27 *
28 *@@include #define INCL_WINWINDOWMGR
29 *@@include #define INCL_WINMESSAGEMGR
30 *@@include #define INCL_WINSYS // for winhStorePresParam
31 *@@include #define INCL_WINDIALOGS
32 *@@include #define INCL_WINMENUS // for menu helpers
33 *@@include #define INCL_WINENTRYFIELDS // for entry field helpers
34 *@@include #define INCL_WINBUTTONS // for button/check box helpers
35 *@@include #define INCL_WINLISTBOXES // for list box helpers
36 *@@include #define INCL_WINSTDSPIN // for spin button helpers
37 *@@include #define INCL_WINSTDSLIDER // for slider helpers
38 *@@include #define INCL_WININPUT
39 *@@include #define INCL_WINSYS
40 *@@include #define INCL_WINSHELLDATA
41 *@@include #define INCL_WINSWITCHLIST // for winhQuerySwitchList
42 *@@include #define INCL_WINPROGRAMLIST // for appStartApp
43 *@@include #define INCL_WINHELP // for help manager helpers
44 *@@include #include <os2.h>
45 *@@include #include "winh.h"
46 */
47
48#if __cplusplus
49extern "C" {
50#endif
51
52#ifndef WINH_HEADER_INCLUDED
53 #define WINH_HEADER_INCLUDED
54
55 #ifndef XWPENTRY
56 #error You must define XWPENTRY to contain the standard linkage for the XWPHelpers.
57 #endif
58
59 /* ******************************************************************
60 *
61 * Declarations
62 *
63 ********************************************************************/
64
65 #define MPNULL (MPFROMP(NULL))
66 #define MPZERO (MPFROMSHORT(0))
67 #define MRTRUE (MRFROMSHORT((SHORT) TRUE))
68 #define MRFALSE (MRFROMSHORT((SHORT) FALSE))
69 #define BM_UNCHECKED 0 // for checkboxes: disabled
70 #define BM_CHECKED 1 // for checkboses: enabled
71 #define BM_INDETERMINATE 2 // for tri-state checkboxes: indeterminate
72
73 /* ******************************************************************
74 *
75 * Wrappers
76 *
77 ********************************************************************/
78
79 // if WINH_STANDARDWRAPPERS is #define'd before including winh.h,
80 // all the following Win* API calls are redirected to the winh*
81 // counterparts
82
83 #ifdef WINH_STANDARDWRAPPERS
84
85 MRESULT XWPENTRY winhSendMsg(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
86 #define WinSendMsg(a,b,c,d) winhSendMsg((a),(b),(c),(d))
87
88 MRESULT XWPENTRY winhSendDlgItemMsg(HWND hwnd, ULONG id, ULONG msg, MPARAM mp1, MPARAM mp2);
89 #define WinSendDlgItemMsg(a,b,c,d,e) winhSendDlgItemMsg((a),(b),(c),(d),(e))
90
91 BOOL XWPENTRY winhPostMsg(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
92 #define WinPostMsg(a,b,c,d) winhPostMsg((a),(b),(c),(d))
93
94 HWND XWPENTRY winhWindowFromID(HWND hwnd, ULONG id);
95 #define WinWindowFromID(a,b) winhWindowFromID((a),(b))
96
97 HWND XWPENTRY winhQueryWindow(HWND hwnd, LONG lCode);
98 #define WinQueryWindow(a,b) winhQueryWindow((a),(b))
99
100 PVOID XWPENTRY winhQueryWindowPtr(HWND hwnd, LONG index);
101 #define WinQueryWindowPtr(a,b) winhQueryWindowPtr((a),(b))
102
103 BOOL XWPENTRY winhSetWindowText(HWND hwnd, const char *pcsz);
104 #define WinSetWindowText(a,b) winhSetWindowText((a),(b))
105
106 BOOL XWPENTRY winhSetDlgItemText(HWND hwnd, ULONG id, const char *pcsz);
107 #define WinSetDlgItemText(a,b,c) winhSetDlgItemText((a),(b),(c))
108 #endif
109
110 /* ******************************************************************
111 *
112 * Macros
113 *
114 ********************************************************************/
115
116 /*
117 * Here come some monster macros for
118 * frequently needed functions.
119 */
120
121 #define winhDebugBox(hwndOwner, title, text) \
122 WinMessageBox(HWND_DESKTOP, hwndOwner, ((PSZ)text), ((PSZ)title), 0, MB_OK | MB_ICONEXCLAMATION | MB_MOVEABLE)
123
124 #define winhYesNoBox(title, text) \
125 WinMessageBox(HWND_DESKTOP, HWND_DESKTOP, ((PSZ)text), ((PSZ)title), 0, MB_YESNO | MB_ICONQUESTION | MB_MOVEABLE)
126
127 #define winhSetDlgItemChecked(hwnd, id, bCheck) \
128 WinSendDlgItemMsg((hwnd), (id), BM_SETCHECK, MPFROMSHORT(bCheck), MPNULL)
129 #define winhIsDlgItemChecked(hwnd, id) \
130 (SHORT1FROMMR(WinSendDlgItemMsg((hwnd), (id), BM_QUERYCHECK, MPNULL, MPNULL)))
131
132 #define winhSetMenuItemChecked(hwndMenu, usId, bCheck) \
133 WinSendMsg(hwndMenu, MM_SETITEMATTR, MPFROM2SHORT(usId, TRUE), \
134 MPFROM2SHORT(MIA_CHECKED, (((bCheck)) ? MIA_CHECKED : FALSE)))
135
136 #define winhShowDlgItem(hwnd, id, show) \
137 WinShowWindow(WinWindowFromID(hwnd, id), show)
138
139 // made these functions V0.9.12 (2001-05-18) [umoeller]
140 /* #define winhEnableDlgItem(hwndDlg, ulId, Enable) \
141 WinEnableWindow(WinWindowFromID(hwndDlg, ulId), Enable)
142 #define winhIsDlgItemEnabled(hwndDlg, ulId) \
143 WinIsWindowEnabled(WinWindowFromID(hwndDlg, ulId))
144 */
145
146 #define winhSetDlgItemFocus(hwndDlg, ulId) \
147 WinSetFocus(HWND_DESKTOP, WinWindowFromID(hwndDlg, ulId))
148
149 /* ******************************************************************
150 *
151 * Rectangle helpers
152 *
153 ********************************************************************/
154
155 VOID XWPENTRY winhOffsetRect(PRECTL prcl, LONG lx, LONG ly);
156
157 /* ******************************************************************
158 *
159 * Generics
160 *
161 ********************************************************************/
162
163 BOOL XWPENTRY winhEnableDlgItem(HWND hwndDlg, SHORT id, BOOL fEnable);
164
165 BOOL XWPENTRY winhIsDlgItemEnabled(HWND hwndDlg, SHORT id);
166
167 /* ******************************************************************
168 *
169 * Menu helpers
170 *
171 ********************************************************************/
172
173 #ifdef INCL_WINMENUS
174 BOOL XWPENTRY winhQueryMenuItem(HWND hwndMenu,
175 USHORT usItemID,
176 BOOL fSearchSubmenus,
177 PMENUITEM pmi);
178 #endif
179
180 /*
181 * winhCreateEmptyMenu:
182 * this macro creates an empty menu, which can
183 * be used with winhInsertMenuItem etc. later.
184 * Useful for creating popup menus on the fly.
185 * Note that even though HWND_DESKTOP is specified
186 * here as both the parent and the owner, the
187 * actual owner and parent are specified later
188 * with WinPopupMenu.
189 */
190
191 #define winhCreateEmptyMenu() \
192 WinCreateWindow(HWND_DESKTOP, WC_MENU, "", 0, 0, 0, 0, 0, \
193 HWND_DESKTOP, HWND_TOP, 0, 0, 0)
194
195 SHORT XWPENTRY winhInsertMenuItem(HWND hwndMenu,
196 SHORT iPosition,
197 SHORT sItemId,
198 const char *pcszItemTitle,
199 SHORT afStyle,
200 SHORT afAttr);
201
202 HWND XWPENTRY winhInsertSubmenu(HWND hwndMenu,
203 ULONG iPosition,
204 SHORT sMenuId,
205 const char *pcszSubmenuTitle,
206 USHORT afMenuStyle,
207 SHORT sItemId,
208 const char *pcszItemTitle,
209 USHORT afItemStyle,
210 USHORT afAttribute);
211
212 BOOL XWPENTRY winhSetMenuCondCascade(HWND hwndMenu,
213 LONG lDefaultItem);
214
215 /*
216 *@@ winhRemoveMenuItem:
217 * removes a menu item (SHORT) from the
218 * given menu (HWND). Returns the no. of
219 * remaining menu items (SHORT).
220 *
221 * This works for whole submenus too.
222 */
223
224 #define winhRemoveMenuItem(hwndMenu, sItemId) \
225 (SHORT)WinSendMsg(hwndMenu, MM_REMOVEITEM, MPFROM2SHORT(sItemId, FALSE), 0)
226
227 /*
228 *@@ winhDeleteMenuItem:
229 * deleted a menu item (SHORT) from the
230 * given menu (HWND). Returns the no. of
231 * remaining menu items (SHORT).
232 *
233 * As opposed to MM_REMOVEITEM, MM_DELETEITEM
234 * frees submenus and bitmaps also.
235 *
236 * This works for whole submenus too.
237 */
238
239 #define winhDeleteMenuItem(hwndMenu, sItemId) \
240 (SHORT)WinSendMsg(hwndMenu, MM_DELETEITEM, MPFROM2SHORT(sItemId, FALSE), 0)
241
242 SHORT XWPENTRY winhInsertMenuSeparator(HWND hMenu,
243 SHORT iPosition,
244 SHORT sId);
245
246 BOOL XWPENTRY winhCopyMenuItem(HWND hmenuTarget,
247 HWND hmenuSource,
248 USHORT usID,
249 SHORT sTargetPosition);
250 typedef BOOL XWPENTRY WINHCOPYMENUITEM(HWND hmenuTarget,
251 HWND hmenuSource,
252 USHORT usID,
253 SHORT sTargetPosition);
254 typedef WINHCOPYMENUITEM *PWINHCOPYMENUITEM;
255
256 HWND XWPENTRY winhMergeIntoSubMenu(HWND hmenuTarget,
257 SHORT sTargetPosition,
258 const char *pcszTitle,
259 SHORT sID,
260 HWND hmenuSource);
261 typedef HWND XWPENTRY WINHMERGEINTOSUBMENU(HWND hmenuTarget,
262 SHORT sTargetPosition,
263 const char *pcszTitle,
264 SHORT sID,
265 HWND hmenuSource);
266 typedef WINHMERGEINTOSUBMENU *PWINHMERGEINTOSUBMENU;
267
268 PSZ XWPENTRY winhQueryMenuItemText(HWND hwndMenu,
269 USHORT usItemID);
270
271 BOOL XWPENTRY winhAppend2MenuItemText(HWND hwndMenu,
272 USHORT usItemID,
273 const char *pcszAppend,
274 BOOL fTab);
275
276 VOID XWPENTRY winhMenuRemoveEllipse(HWND hwndMenu,
277 USHORT usItemId);
278
279 SHORT XWPENTRY winhQueryItemUnderMouse(HWND hwndMenu, POINTL *pptlMouse, RECTL *prtlItem);
280
281 /* ******************************************************************
282 *
283 * Slider helpers
284 *
285 ********************************************************************/
286
287 HWND XWPENTRY winhReplaceWithLinearSlider(HWND hwndParent,
288 HWND hwndOwner,
289 HWND hwndInsertAfter,
290 ULONG ulID,
291 ULONG ulSliderStyle,
292 ULONG ulTickCount);
293
294 BOOL XWPENTRY winhSetSliderTicks(HWND hwndSlider,
295 MPARAM mpEveryOther1,
296 ULONG ulPixels1,
297 MPARAM mpEveryOther2,
298 ULONG ulPixels2);
299 typedef BOOL XWPENTRY WINHSETSLIDERTICKS(HWND hwndSlider,
300 MPARAM mpEveryOther1,
301 ULONG ulPixels1,
302 MPARAM mpEveryOther2,
303 ULONG ulPixels2);
304 typedef WINHSETSLIDERTICKS *PWINHSETSLIDERTICKS;
305
306 /*
307 * winhSetSliderArmPosition:
308 * this moves the slider arm in a given
309 * linear slider.
310 *
311 * usMode can be one of the following:
312 * -- SMA_RANGEVALUE: usOffset is in pixels
313 * from the slider's home position.
314 * -- SMA_INCREMENTVALUE: usOffset is in
315 * units of the slider's primary scale.
316 */
317
318 #define winhSetSliderArmPosition(hwndSlider, usMode, usOffset) \
319 WinSendMsg(hwndSlider, SLM_SETSLIDERINFO, \
320 MPFROM2SHORT(SMA_SLIDERARMPOSITION, \
321 usMode), \
322 MPFROMSHORT(usOffset))
323
324 /*
325 * winhQuerySliderArmPosition:
326 * reverse to the previous, this returns a
327 * slider arm position (as a LONG value).
328 */
329
330 #define winhQuerySliderArmPosition(hwndSlider, usMode) \
331 (LONG)(WinSendMsg(hwndSlider, \
332 SLM_QUERYSLIDERINFO, \
333 MPFROM2SHORT(SMA_SLIDERARMPOSITION, \
334 usMode), \
335 0))
336
337 HWND XWPENTRY winhReplaceWithCircularSlider(HWND hwndParent,
338 HWND hwndOwner,
339 HWND hwndInsertAfter,
340 ULONG ulID,
341 ULONG ulSliderStyle,
342 SHORT sMin,
343 SHORT sMax,
344 USHORT usIncrement,
345 USHORT usTicksEvery);
346
347 /* ******************************************************************
348 *
349 * Spin button helpers
350 *
351 ********************************************************************/
352
353 VOID XWPENTRY winhSetDlgItemSpinData(HWND hwndDlg,
354 ULONG idSpinButton,
355 ULONG min,
356 ULONG max,
357 ULONG current);
358
359 LONG XWPENTRY winhAdjustDlgItemSpinData(HWND hwndDlg,
360 USHORT usItemID,
361 LONG lGrid,
362 USHORT usNotifyCode);
363
364 /* ******************************************************************
365 *
366 * Entry field helpers
367 *
368 ********************************************************************/
369
370 /*
371 * winhSetEntryFieldLimit:
372 * sets the maximum length for the entry field
373 * (EM_SETTEXTLIMIT message).
374 *
375 * PMREF doesn't say this, but the limit does
376 * _not_ include the null-terminator. That is,
377 * if you specify "12" characters here, you can
378 * really enter 12 characters.
379 *
380 * The default length is 30 characters, I think.
381 */
382
383 #define winhSetEntryFieldLimit(hwndEntryField, usLength) \
384 WinSendMsg(hwndEntryField, EM_SETTEXTLIMIT, (MPARAM)(usLength), (MPARAM)0)
385
386 /*
387 *@@ winhEntryFieldSelectAll:
388 * this selects the entire text in the entry field.
389 * Useful when the thing gets the focus.
390 */
391
392 #define winhEntryFieldSelectAll(hwndEntryField) \
393 WinSendMsg(hwndEntryField, EM_SETSEL, MPFROM2SHORT(0, 10000), MPNULL)
394
395 /*
396 *@@ winhHasEntryFieldChanged:
397 * this queries whether the entry field's contents
398 * have changed (EM_QUERYCHANGED message).
399 *
400 * This returns TRUE if changes have occured since
401 * the last time this message or WM_QUERYWINDOWPARAMS
402 * (WinQueryWindowText) was received.
403 */
404
405 #define winhHasEntryFieldChanged(hwndEntryField) \
406 (BOOL)WinSendMsg(hwndEntryField, EM_QUERYCHANGED, (MPARAM)0, (MPARAM)0)
407
408 /* ******************************************************************
409 *
410 * List box helpers
411 *
412 ********************************************************************/
413
414 /* The following macros are defined in the OS/2 headers for
415 list boxes:
416
417 LONG WinQueryLboxCount(HWND hwndLbox);
418 // wrapper around LM_QUERYITEMCOUNT;
419 // list box item count
420
421 SHORT WinQueryLboxItemTextLength(HWND hwndLbox,
422 SHORT index); // item index, starting from 0
423 // wrapper around LM_QUERYITEMTEXTLENGTH;
424 // returns length of item text, excluding NULL character
425
426 LONG WinQueryLboxItemText(HWND hwndLbox,
427 SHORT index, // item index, starting from 0
428 PSZ psz, // buffer
429 PSZ cchMax); // size of buffer, incl. null
430 // wrapper around LM_QUERYITEMTEXT;
431 // returns length of item text, excluding NULL character
432
433 BOOL WinSetLboxItemText(HWND hwndLbox,
434 LONG index,
435 PSZ psz);
436 // wrapper around LM_SETITEMTEXT
437
438 LONG WinInsertLboxItem(HWND hwndLbox,
439 LONG index, // new item index, starting from 0
440 // or LIT_END
441 // or LIT_SORTASCENDING
442 // or LIT_SORTDESCENDING
443 PSZ psz)
444 // wrapper around LM_INSERTITEM;
445 // returns LIT_MEMERROR, LIT_ERROR, or zero-based index
446
447 LONG WinDeleteLboxItem(HWND hwndLbox,
448 LONG index); // item index, starting from 0
449
450 LONG WinQueryLboxSelectedItem(HWND hwndLbox);
451 // wrapper around LM_QUERYSELECTION;
452 // works with single selection only,
453 // use winhQueryLboxSelectedItem instead
454 */
455
456 /*
457 * winhQueryLboxItemCount:
458 * returns the no. of items in the listbox
459 * as a SHORT.
460 *
461 *added V0.9.1 (99-12-14) [umoeller]
462 */
463
464 // #define winhQueryLboxItemCount(hwndListBox)
465 // (SHORT)WinSendMsg(hwndListBox, LM_QUERYITEMCOUNT, 0, 0)
466
467 // removed, use WinQueryLboxCount
468
469 /*
470 *@@ winhDeleteAllItems:
471 * deletes all list box items. Returns
472 * a BOOL.
473 *
474 *@@added V0.9.1 (99-12-14) [umoeller]
475 */
476
477 #define winhDeleteAllItems(hwndListBox) \
478 (BOOL)WinSendMsg(hwndListBox, \
479 LM_DELETEALL, 0, 0)
480 /*
481 *@@ winhQueryLboxSelectedItem:
482 * this queries the next selected list box item.
483 * For the first call, set sItemStart to LIT_FIRST;
484 * then repeat the call with sItemStart set to
485 * the previous return value until this returns
486 * LIT_NONE.
487 *
488 * Example:
489 + SHORT sItemStart = LIT_FIRST;
490 + while (TRUE)
491 + {
492 + sItemStart = winhQueryLboxSelectedItem(hwndListBox,
493 + sItemStart)
494 + if (sItemStart == LIT_NONE)
495 + break;
496 + ...
497 + }
498 *
499 * To have the cursored item returned, use LIT_CURSOR.
500 *
501 * For single selection, you can also use
502 * WinQueryLboxSelectedItem from the OS/2 PM headers.
503 */
504
505 #define winhQueryLboxSelectedItem(hwndListBox, sItemStart) \
506 (SHORT)(WinSendMsg(hwndListBox, \
507 LM_QUERYSELECTION, \
508 (MPARAM)(sItemStart), \
509 MPNULL))
510
511 /*
512 *@@ winhSetLboxSelectedItem:
513 * selects a list box item.
514 * This works for both single-selection and
515 * multiple-selection listboxes.
516 * In single-selection listboxes, if an item
517 * is selected (fSelect == TRUE), the previous
518 * item is automatically deselected.
519 * Note that (BOOL)fSelect is ignored if
520 * sItemIndex == LIT_NONE.
521 */
522
523 #define winhSetLboxSelectedItem(hwndListBox, sItemIndex, fSelect) \
524 (BOOL)(WinSendMsg(hwndListBox, \
525 LM_SELECTITEM, \
526 (MPARAM)(sItemIndex), \
527 (MPARAM)(fSelect)))
528
529 ULONG XWPENTRY winhLboxSelectAll(HWND hwndListBox, BOOL fSelect);
530
531 /*
532 * winhSetLboxItemHandle:
533 * sets the "item handle" for the specified sItemIndex.
534 * See LM_SETITEMHANDLE in PMREF for details.
535 */
536
537 #define winhSetLboxItemHandle(hwndListBox, sItemIndex, ulHandle) \
538 (BOOL)(WinSendMsg(hwndListBox, LM_SETITEMHANDLE, \
539 (MPARAM)(sItemIndex), \
540 (MPARAM)ulHandle))
541
542 /*
543 * winhQueryLboxItemHandle:
544 * the reverse to the previous. Returns a ULONG.
545 */
546
547 #define winhQueryLboxItemHandle(hwndListBox, sItemIndex) \
548 (ULONG)WinSendMsg(hwndListBox, LM_QUERYITEMHANDLE, \
549 MPFROMSHORT(sItemIndex), (MPARAM)NULL)
550
551 PSZ XWPENTRY winhQueryLboxItemText(HWND hwndListbox, SHORT sIndex);
552
553 BOOL XWPENTRY winhMoveLboxItem(HWND hwndSource,
554 SHORT sSourceIndex,
555 HWND hwndTarget,
556 SHORT sTargetIndex,
557 BOOL fSelectTarget);
558
559 ULONG XWPENTRY winhLboxFindItemFromHandle(HWND hwndListBox,
560 ULONG ulHandle);
561
562 /* ******************************************************************
563 *
564 * Scroll bar helpers
565 *
566 ********************************************************************/
567
568 BOOL XWPENTRY winhUpdateScrollBar(HWND hwndScrollBar,
569 ULONG ulWinPels,
570 ULONG ulViewportPels,
571 ULONG ulCurUnitOfs,
572 BOOL fAutoHide);
573
574 BOOL XWPENTRY winhHandleScrollMsg(HWND hwnd2Scroll,
575 HWND hwndScrollBar,
576 PULONG pulCurPelsOfs,
577 PRECTL prcl2Scroll,
578 LONG ulViewportPels,
579 USHORT usLineStepUnits,
580 ULONG msg,
581 MPARAM mp2);
582
583 BOOL XWPENTRY winhProcessScrollChars(HWND hwndClient,
584 HWND hwndVScroll,
585 HWND hwndHScroll,
586 MPARAM mp1,
587 MPARAM mp2,
588 ULONG ulVertMax,
589 ULONG ulHorzMax);
590
591 /* ******************************************************************
592 *
593 * Window positioning helpers
594 *
595 ********************************************************************/
596
597 BOOL XWPENTRY winhSaveWindowPos(HWND hwnd, HINI hIni, const char *pcszApp, const char *pcszKey);
598
599 BOOL XWPENTRY winhRestoreWindowPos(HWND hwnd, HINI hIni, const char *pcszApp, const char *pcszKey, ULONG fl);
600
601 #define XAC_MOVEX 0x0001
602 #define XAC_MOVEY 0x0002
603 #define XAC_SIZEX 0x0004
604 #define XAC_SIZEY 0x0008
605
606 /*
607 *@@ XADJUSTCTRLS:
608 *
609 */
610
611 typedef struct _XADJUSTCTRLS
612 {
613 BOOL fInitialized;
614 SWP swpMain; // SWP for main window
615 SWP *paswp; // pointer to array of control SWP structs
616 } XADJUSTCTRLS, *PXADJUSTCTRLS;
617
618 BOOL XWPENTRY winhAdjustControls(HWND hwndDlg,
619 MPARAM *pmpFlags,
620 ULONG ulCount,
621 PSWP pswpNew,
622 PXADJUSTCTRLS pxac);
623
624 void XWPENTRY winhCenterWindow(HWND hwnd);
625 typedef void XWPENTRY WINHCENTERWINDOW(HWND hwnd);
626 typedef WINHCENTERWINDOW *PWINHCENTERWINDOW;
627
628 HWND XWPENTRY winhFindWindowBelow(HWND hwndFind);
629
630 /* ******************************************************************
631 *
632 * Presparams helpers
633 *
634 ********************************************************************/
635
636 PSZ XWPENTRY winhQueryWindowFont(HWND hwnd);
637 typedef PSZ XWPENTRY WINHQUERYWINDOWFONT(HWND hwnd);
638 typedef WINHQUERYWINDOWFONT *PWINHQUERYWINDOWFONT;
639
640 BOOL XWPENTRY winhSetWindowFont(HWND hwnd, const char *pcszFont);
641 typedef BOOL XWPENTRY WINHSETWINDOWFONT(HWND hwnd, const char *pcszFont);
642 typedef WINHSETWINDOWFONT *PWINHSETWINDOWFONT;
643
644 /*
645 *@@ winhSetDlgItemFont:
646 * invokes winhSetWindowFont on a dialog
647 * item.
648 *
649 * Returns TRUE if successful or FALSE otherwise.
650 *
651 *@@added V0.9.0
652 */
653
654 #define winhSetDlgItemFont(hwnd, usId, pszFont) \
655 (winhSetWindowFont(WinWindowFromID(hwnd, usId), pszFont))
656
657 ULONG XWPENTRY winhSetControlsFont(HWND hwndDlg, SHORT usIDMin, SHORT usIDMax, const char *pcszFont);
658
659 #ifdef INCL_WINSYS
660 BOOL XWPENTRY winhStorePresParam(PPRESPARAMS *pppp,
661 ULONG ulAttrType,
662 ULONG cbData,
663 PVOID pData);
664 #endif
665
666 LONG XWPENTRY winhQueryPresColor(HWND hwnd, ULONG ulPP, BOOL fInherit, LONG lSysColor);
667 typedef LONG XWPENTRY WINHQUERYPRESCOLOR(HWND hwnd, ULONG ulPP, BOOL fInherit, LONG lSysColor);
668 typedef WINHQUERYPRESCOLOR *PWINHQUERYPRESCOLOR;
669
670 /* ******************************************************************
671 *
672 * Help instance helpers
673 *
674 ********************************************************************/
675
676 #ifdef INCL_WINHELP
677 HWND XWPENTRY winhCreateHelp(HWND hwndFrame,
678 const char *pcszFileName,
679 HMODULE hmod,
680 PHELPTABLE pHelpTable,
681 const char *pcszWindowTitle);
682
683 ULONG winhDisplayHelpPanel(HWND hwndHelpInstance,
684 ULONG ulHelpPanel);
685
686 void XWPENTRY winhDestroyHelp(HWND hwndHelp, HWND hwndFrame);
687 #endif
688
689 /* ******************************************************************
690 *
691 * Application control
692 *
693 ********************************************************************/
694
695 BOOL XWPENTRY winhAnotherInstance(const char *pcszSemName, BOOL fSwitch);
696
697 HSWITCH XWPENTRY winhAddToTasklist(HWND hwnd, HPOINTER hIcon);
698
699 /* ******************************************************************
700 *
701 * Miscellaneous
702 *
703 ********************************************************************/
704
705 VOID XWPENTRY winhFree(PVOID p);
706 typedef VOID XWPENTRY WINHFREE(PVOID p);
707 typedef WINHFREE *PWINHFREE;
708
709 HAB XWPENTRY winhMyAnchorBlock(VOID);
710 typedef HAB XWPENTRY WINHMYANCHORBLOCK(VOID);
711 typedef WINHMYANCHORBLOCK *PWINHMYANCHORBLOCK;
712
713 VOID XWPENTRY winhSleep(ULONG ulSleep);
714
715 #define WINH_FOD_SAVEDLG 0x0001
716 #define WINH_FOD_INILOADDIR 0x0010
717 #define WINH_FOD_INISAVEDIR 0x0020
718
719 BOOL XWPENTRY winhFileDlg(HWND hwndOwner,
720 PSZ pszFile,
721 ULONG flFlags,
722 HINI hini,
723 const char *pcszApplication,
724 const char *pcszKey);
725
726 HPOINTER XWPENTRY winhSetWaitPointer(VOID);
727
728 PSZ XWPENTRY winhQueryWindowText(HWND hwnd);
729
730 /*
731 *@@ winhQueryDlgItemText:
732 * like winhQueryWindowText, but for the dialog item
733 * in hwnd which has the ID usItemID.
734 */
735
736 #define winhQueryDlgItemText(hwnd, usItemID) winhQueryWindowText(WinWindowFromID(hwnd, usItemID))
737
738 BOOL XWPENTRY winhReplaceWindowText(HWND hwnd,
739 const char *pcszSearch,
740 const char *pcszReplaceWith);
741
742 ULONG XWPENTRY winhCenteredDlgBox(HWND hwndParent, HWND hwndOwner,
743 PFNWP pfnDlgProc, HMODULE hmod, ULONG idDlg, PVOID pCreateParams);
744 typedef ULONG XWPENTRY WINHCENTEREDDLGBOX(HWND hwndParent, HWND hwndOwner,
745 PFNWP pfnDlgProc, HMODULE hmod, ULONG idDlg, PVOID pCreateParams);
746 typedef WINHCENTEREDDLGBOX *PWINHCENTEREDDLGBOX;
747
748 ULONG XWPENTRY winhEnableControls(HWND hwndDlg,
749 USHORT usIDFirst,
750 USHORT usIDLast,
751 BOOL fEnable);
752
753 HWND XWPENTRY winhCreateStdWindow(HWND hwndFrameParent,
754 PSWP pswpFrame,
755 ULONG flFrameCreateFlags,
756 ULONG ulFrameStyle,
757 const char *pcszFrameTitle,
758 ULONG ulResourcesID,
759 const char *pcszClassClient,
760 ULONG flStyleClient,
761 ULONG ulID,
762 PVOID pClientCtlData,
763 PHWND phwndClient);
764
765 HWND XWPENTRY winhCreateObjectWindow(const char *pcszWindowClass,
766 PVOID pvCreateParam);
767
768 HWND XWPENTRY winhCreateControl(HWND hwndParentAndOwner,
769 const char *pcszClass,
770 const char *pcszText,
771 ULONG ulStyle,
772 ULONG ulID);
773
774 VOID XWPENTRY winhRepaintWindows(HWND hwndParent);
775
776 HMQ XWPENTRY winhFindMsgQueue(PID pid, TID tid, HAB* phab);
777
778 VOID XWPENTRY winhFindPMErrorWindows(HWND *phwndHardError, HWND *phwndSysError);
779
780 HWND XWPENTRY winhCreateFakeDesktop(HWND hwndSibling);
781
782 BOOL XWPENTRY winhAssertWarp4Notebook(HWND hwndDlg,
783 USHORT usIdThreshold,
784 ULONG ulDownUnits);
785
786 ULONG XWPENTRY winhDrawFormattedText(HPS hps, PRECTL prcl, const char *pcszText, ULONG flCmd);
787
788 #ifdef INCL_WINSWITCHLIST
789 PSWBLOCK XWPENTRY winhQuerySwitchList(HAB hab);
790 typedef PSWBLOCK XWPENTRY WINHQUERYSWITCHLIST(HAB hab);
791 typedef WINHQUERYSWITCHLIST *PWINHQUERYSWITCHLIST;
792 #endif
793
794 HWND XWPENTRY winhQueryTasklistWindow(VOID);
795 typedef HWND XWPENTRY WINHQUERYTASKLISTWINDOW(VOID);
796 typedef WINHQUERYTASKLISTWINDOW *PWINHQUERYTASKLISTWINDOW;
797
798 VOID XWPENTRY winhKillTasklist(VOID);
799
800 ULONG XWPENTRY winhQueryPendingSpoolJobs(VOID);
801
802 VOID XWPENTRY winhSetNumLock(BOOL fState);
803
804 /*
805 *@@ winhQueryScreenCX:
806 * helper macro for getting the screen width.
807 */
808
809 #define winhQueryScreenCX() (WinQuerySysValue(HWND_DESKTOP, SV_CXSCREEN))
810
811 /*
812 *@@ winhQueryScreenCY:
813 * helper macro for getting the screen height.
814 */
815
816 #define winhQueryScreenCY() (WinQuerySysValue(HWND_DESKTOP, SV_CYSCREEN))
817
818 /* ******************************************************************
819 *
820 * WPS Class List helpers
821 *
822 ********************************************************************/
823
824 PBYTE XWPENTRY winhQueryWPSClassList(VOID);
825
826 PBYTE XWPENTRY winhQueryWPSClass(PBYTE pObjClass, const char *pszClass);
827
828 APIRET XWPENTRY winhRegisterClass(const char* pcszClassName,
829 const char* pcszModule,
830 PSZ pszBuf,
831 ULONG cbBuf);
832
833 BOOL XWPENTRY winhIsClassRegistered(const char *pcszClass);
834
835 ULONG XWPENTRY winhResetWPS(HAB hab);
836
837#endif
838
839#if __cplusplus
840}
841#endif
842
Note: See TracBrowser for help on using the repository browser.