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

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

Misc changes.

  • Property svn:eol-style set to CRLF
  • Property svn:keywords set to Author Date Id Revision
File size: 33.1 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 winhStartApp
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 _Optlink winhSendMsg(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
86 #define WinSendMsg(a,b,c,d) winhSendMsg((a),(b),(c),(d))
87
88 BOOL _Optlink winhPostMsg(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
89 #define WinPostMsg(a,b,c,d) winhPostMsg((a),(b),(c),(d))
90
91 HWND _Optlink winhWindowFromID(HWND hwnd, ULONG id);
92 #define WinWindowFromID(a,b) winhWindowFromID((a),(b))
93
94 HWND _Optlink winhQueryWindow(HWND hwnd, LONG lCode);
95 #define WinQueryWindow(a,b) winhQueryWindow((a),(b))
96
97 #endif
98
99 /* ******************************************************************
100 *
101 * Macros
102 *
103 ********************************************************************/
104
105 /*
106 * Here come some monster macros for
107 * frequently needed functions.
108 */
109
110 #define winhDebugBox(hwndOwner, title, text) \
111 WinMessageBox(HWND_DESKTOP, hwndOwner, ((PSZ)text), ((PSZ)title), 0, MB_OK | MB_ICONEXCLAMATION | MB_MOVEABLE)
112
113 #define winhYesNoBox(title, text) \
114 WinMessageBox(HWND_DESKTOP, HWND_DESKTOP, ((PSZ)text), ((PSZ)title), 0, MB_YESNO | MB_ICONQUESTION | MB_MOVEABLE)
115
116 // made these functions V0.9.12 (2001-05-18) [umoeller]
117 /* #define winhSetDlgItemChecked(hwnd, id, bCheck) \
118 WinSendDlgItemMsg((hwnd), (id), BM_SETCHECK, MPFROMSHORT(bCheck), MPNULL)
119 #define winhIsDlgItemChecked(hwnd, id) \
120 (SHORT1FROMMR(WinSendDlgItemMsg((hwnd), (id), BM_QUERYCHECK, MPNULL, MPNULL)))
121 */
122
123 #define winhSetMenuItemChecked(hwndMenu, usId, bCheck) \
124 WinSendMsg(hwndMenu, MM_SETITEMATTR, MPFROM2SHORT(usId, TRUE), \
125 MPFROM2SHORT(MIA_CHECKED, (((bCheck)) ? MIA_CHECKED : FALSE)))
126
127 #define winhShowDlgItem(hwnd, id, show) \
128 WinShowWindow(WinWindowFromID(hwnd, id), show)
129
130 // made these functions V0.9.12 (2001-05-18) [umoeller]
131 /* #define winhEnableDlgItem(hwndDlg, ulId, Enable) \
132 WinEnableWindow(WinWindowFromID(hwndDlg, ulId), Enable)
133 #define winhIsDlgItemEnabled(hwndDlg, ulId) \
134 WinIsWindowEnabled(WinWindowFromID(hwndDlg, ulId))
135 */
136
137 #define winhSetDlgItemFocus(hwndDlg, ulId) \
138 WinSetFocus(HWND_DESKTOP, WinWindowFromID(hwndDlg, ulId))
139
140 /* ******************************************************************
141 *
142 * Rectangle helpers
143 *
144 ********************************************************************/
145
146 VOID XWPENTRY winhOffsetRect(PRECTL prcl, LONG lx, LONG ly);
147
148 /* ******************************************************************
149 *
150 * Generics
151 *
152 ********************************************************************/
153
154 BOOL XWPENTRY winhSetDlgItemChecked(HWND hwnd, SHORT id, SHORT bCheck);
155
156 SHORT XWPENTRY winhIsDlgItemChecked(HWND hwnd, SHORT id);
157
158 BOOL XWPENTRY winhEnableDlgItem(HWND hwndDlg, SHORT id, BOOL fEnable);
159
160 BOOL XWPENTRY winhIsDlgItemEnabled(HWND hwndDlg, SHORT id);
161
162 /* ******************************************************************
163 *
164 * Menu helpers
165 *
166 ********************************************************************/
167
168 #ifdef INCL_WINMENUS
169 BOOL XWPENTRY winhQueryMenuItem(HWND hwndMenu,
170 USHORT usItemID,
171 BOOL fSearchSubmenus,
172 PMENUITEM pmi);
173 #endif
174
175 /*
176 * winhCreateEmptyMenu:
177 * this macro creates an empty menu, which can
178 * be used with winhInsertMenuItem etc. later.
179 * Useful for creating popup menus on the fly.
180 * Note that even though HWND_DESKTOP is specified
181 * here as both the parent and the owner, the
182 * actual owner and parent are specified later
183 * with WinPopupMenu.
184 */
185
186 #define winhCreateEmptyMenu() \
187 WinCreateWindow(HWND_DESKTOP, WC_MENU, "", 0, 0, 0, 0, 0, \
188 HWND_DESKTOP, HWND_TOP, 0, 0, 0)
189
190 SHORT XWPENTRY winhInsertMenuItem(HWND hwndMenu,
191 SHORT iPosition,
192 SHORT sItemId,
193 const char *pcszItemTitle,
194 SHORT afStyle,
195 SHORT afAttr);
196
197 HWND XWPENTRY winhInsertSubmenu(HWND hwndMenu,
198 ULONG iPosition,
199 SHORT sMenuId,
200 const char *pcszSubmenuTitle,
201 USHORT afMenuStyle,
202 SHORT sItemId,
203 const char *pcszItemTitle,
204 USHORT afItemStyle,
205 USHORT afAttribute);
206
207 BOOL XWPENTRY winhSetMenuCondCascade(HWND hwndMenu,
208 LONG lDefaultItem);
209
210 /*
211 *@@ winhRemoveMenuItem:
212 * removes a menu item (SHORT) from the
213 * given menu (HWND). Returns the no. of
214 * remaining menu items (SHORT).
215 *
216 * This works for whole submenus too.
217 */
218
219 #define winhRemoveMenuItem(hwndMenu, sItemId) \
220 (SHORT)WinSendMsg(hwndMenu, MM_REMOVEITEM, MPFROM2SHORT(sItemId, FALSE), 0)
221
222 /*
223 *@@ winhDeleteMenuItem:
224 * deleted a menu item (SHORT) from the
225 * given menu (HWND). Returns the no. of
226 * remaining menu items (SHORT).
227 *
228 * As opposed to MM_REMOVEITEM, MM_DELETEITEM
229 * frees submenus and bitmaps also.
230 *
231 * This works for whole submenus too.
232 */
233
234 #define winhDeleteMenuItem(hwndMenu, sItemId) \
235 (SHORT)WinSendMsg(hwndMenu, MM_DELETEITEM, MPFROM2SHORT(sItemId, FALSE), 0)
236
237 SHORT XWPENTRY winhInsertMenuSeparator(HWND hMenu,
238 SHORT iPosition,
239 SHORT sId);
240
241 BOOL XWPENTRY winhCopyMenuItem(HWND hmenuTarget,
242 HWND hmenuSource,
243 USHORT usID,
244 SHORT sTargetPosition);
245 typedef BOOL XWPENTRY WINHCOPYMENUITEM(HWND hmenuTarget,
246 HWND hmenuSource,
247 USHORT usID,
248 SHORT sTargetPosition);
249 typedef WINHCOPYMENUITEM *PWINHCOPYMENUITEM;
250
251 HWND XWPENTRY winhMergeIntoSubMenu(HWND hmenuTarget,
252 SHORT sTargetPosition,
253 const char *pcszTitle,
254 SHORT sID,
255 HWND hmenuSource);
256 typedef HWND XWPENTRY WINHMERGEINTOSUBMENU(HWND hmenuTarget,
257 SHORT sTargetPosition,
258 const char *pcszTitle,
259 SHORT sID,
260 HWND hmenuSource);
261 typedef WINHMERGEINTOSUBMENU *PWINHMERGEINTOSUBMENU;
262
263 PSZ XWPENTRY winhQueryMenuItemText(HWND hwndMenu,
264 USHORT usItemID);
265
266 BOOL XWPENTRY winhAppend2MenuItemText(HWND hwndMenu,
267 USHORT usItemID,
268 const char *pcszAppend,
269 BOOL fTab);
270
271 VOID XWPENTRY winhMenuRemoveEllipse(HWND hwndMenu,
272 USHORT usItemId);
273
274 SHORT XWPENTRY winhQueryItemUnderMouse(HWND hwndMenu, POINTL *pptlMouse, RECTL *prtlItem);
275
276 /* ******************************************************************
277 *
278 * Slider helpers
279 *
280 ********************************************************************/
281
282 HWND XWPENTRY winhReplaceWithLinearSlider(HWND hwndParent,
283 HWND hwndOwner,
284 HWND hwndInsertAfter,
285 ULONG ulID,
286 ULONG ulSliderStyle,
287 ULONG ulTickCount);
288
289 BOOL winhSetSliderTicks(HWND hwndSlider,
290 MPARAM mpEveryOther1,
291 ULONG ulPixels1,
292 MPARAM mpEveryOther2,
293 ULONG ulPixels2);
294
295 /*
296 * winhSetSliderArmPosition:
297 * this moves the slider arm in a given
298 * linear slider.
299 *
300 * usMode can be one of the following:
301 * -- SMA_RANGEVALUE: usOffset is in pixels
302 * from the slider's home position.
303 * -- SMA_INCREMENTVALUE: usOffset is in
304 * units of the slider's primary scale.
305 */
306
307 #define winhSetSliderArmPosition(hwndSlider, usMode, usOffset) \
308 WinSendMsg(hwndSlider, SLM_SETSLIDERINFO, \
309 MPFROM2SHORT(SMA_SLIDERARMPOSITION, \
310 usMode), \
311 MPFROMSHORT(usOffset))
312
313 /*
314 * winhQuerySliderArmPosition:
315 * reverse to the previous, this returns a
316 * slider arm position (as a LONG value).
317 */
318
319 #define winhQuerySliderArmPosition(hwndSlider, usMode) \
320 (LONG)(WinSendMsg(hwndSlider, \
321 SLM_QUERYSLIDERINFO, \
322 MPFROM2SHORT(SMA_SLIDERARMPOSITION, \
323 usMode), \
324 0))
325
326 HWND XWPENTRY winhReplaceWithCircularSlider(HWND hwndParent,
327 HWND hwndOwner,
328 HWND hwndInsertAfter,
329 ULONG ulID,
330 ULONG ulSliderStyle,
331 SHORT sMin,
332 SHORT sMax,
333 USHORT usIncrement,
334 USHORT usTicksEvery);
335
336 /* ******************************************************************
337 *
338 * Spin button helpers
339 *
340 ********************************************************************/
341
342 VOID XWPENTRY winhSetDlgItemSpinData(HWND hwndDlg,
343 ULONG idSpinButton,
344 ULONG min,
345 ULONG max,
346 ULONG current);
347
348 LONG XWPENTRY winhAdjustDlgItemSpinData(HWND hwndDlg,
349 USHORT usItemID,
350 LONG lGrid,
351 USHORT usNotifyCode);
352
353 /* ******************************************************************
354 *
355 * Entry field helpers
356 *
357 ********************************************************************/
358
359 /*
360 * winhSetEntryFieldLimit:
361 * sets the maximum length for the entry field
362 * (EM_SETTEXTLIMIT message).
363 *
364 * PMREF doesn't say this, but the limit does
365 * _not_ include the null-terminator. That is,
366 * if you specify "12" characters here, you can
367 * really enter 12 characters.
368 *
369 * The default length is 30 characters, I think.
370 */
371
372 #define winhSetEntryFieldLimit(hwndEntryField, usLength) \
373 WinSendMsg(hwndEntryField, EM_SETTEXTLIMIT, (MPARAM)(usLength), (MPARAM)0)
374
375 /*
376 *@@ winhEntryFieldSelectAll:
377 * this selects the entire text in the entry field.
378 * Useful when the thing gets the focus.
379 */
380
381 #define winhEntryFieldSelectAll(hwndEntryField) \
382 WinSendMsg(hwndEntryField, EM_SETSEL, MPFROM2SHORT(0, 10000), MPNULL)
383
384 /*
385 *@@ winhHasEntryFieldChanged:
386 * this queries whether the entry field's contents
387 * have changed (EM_QUERYCHANGED message).
388 *
389 * This returns TRUE if changes have occured since
390 * the last time this message or WM_QUERYWINDOWPARAMS
391 * (WinQueryWindowText) was received.
392 */
393
394 #define winhHasEntryFieldChanged(hwndEntryField) \
395 (BOOL)WinSendMsg(hwndEntryField, EM_QUERYCHANGED, (MPARAM)0, (MPARAM)0)
396
397 /* ******************************************************************
398 *
399 * List box helpers
400 *
401 ********************************************************************/
402
403 /* The following macros are defined in the OS/2 headers for
404 list boxes:
405
406 LONG WinQueryLboxCount(HWND hwndLbox);
407 // wrapper around LM_QUERYITEMCOUNT;
408 // list box item count
409
410 SHORT WinQueryLboxItemTextLength(HWND hwndLbox,
411 SHORT index); // item index, starting from 0
412 // wrapper around LM_QUERYITEMTEXTLENGTH;
413 // returns length of item text, excluding NULL character
414
415 LONG WinQueryLboxItemText(HWND hwndLbox,
416 SHORT index, // item index, starting from 0
417 PSZ psz, // buffer
418 PSZ cchMax); // size of buffer, incl. null
419 // wrapper around LM_QUERYITEMTEXT;
420 // returns length of item text, excluding NULL character
421
422 BOOL WinSetLboxItemText(HWND hwndLbox,
423 LONG index,
424 PSZ psz);
425 // wrapper around LM_SETITEMTEXT
426
427 LONG WinInsertLboxItem(HWND hwndLbox,
428 LONG index, // new item index, starting from 0
429 // or LIT_END
430 // or LIT_SORTASCENDING
431 // or LIT_SORTDESCENDING
432 PSZ psz)
433 // wrapper around LM_INSERTITEM;
434 // returns LIT_MEMERROR, LIT_ERROR, or zero-based index
435
436 LONG WinDeleteLboxItem(HWND hwndLbox,
437 LONG index); // item index, starting from 0
438
439 LONG WinQueryLboxSelectedItem(HWND hwndLbox);
440 // wrapper around LM_QUERYSELECTION;
441 // works with single selection only,
442 // use winhQueryLboxSelectedItem instead
443 */
444
445 /*
446 * winhQueryLboxItemCount:
447 * returns the no. of items in the listbox
448 * as a SHORT.
449 *
450 *added V0.9.1 (99-12-14) [umoeller]
451 */
452
453 // #define winhQueryLboxItemCount(hwndListBox)
454 // (SHORT)WinSendMsg(hwndListBox, LM_QUERYITEMCOUNT, 0, 0)
455
456 // removed, use WinQueryLboxCount
457
458 /*
459 *@@ winhDeleteAllItems:
460 * deletes all list box items. Returns
461 * a BOOL.
462 *
463 *@@added V0.9.1 (99-12-14) [umoeller]
464 */
465
466 #define winhDeleteAllItems(hwndListBox) \
467 (BOOL)WinSendMsg(hwndListBox, \
468 LM_DELETEALL, 0, 0)
469 /*
470 *@@ winhQueryLboxSelectedItem:
471 * this queries the next selected list box item.
472 * For the first call, set sItemStart to LIT_FIRST;
473 * then repeat the call with sItemStart set to
474 * the previous return value until this returns
475 * LIT_NONE.
476 *
477 * Example:
478 + SHORT sItemStart = LIT_FIRST;
479 + while (TRUE)
480 + {
481 + sItemStart = winhQueryLboxSelectedItem(hwndListBox,
482 + sItemStart)
483 + if (sItemStart == LIT_NONE)
484 + break;
485 + ...
486 + }
487 *
488 * To have the cursored item returned, use LIT_CURSOR.
489 *
490 * For single selection, you can also use
491 * WinQueryLboxSelectedItem from the OS/2 PM headers.
492 */
493
494 #define winhQueryLboxSelectedItem(hwndListBox, sItemStart) \
495 (SHORT)(WinSendMsg(hwndListBox, \
496 LM_QUERYSELECTION, \
497 (MPARAM)(sItemStart), \
498 MPNULL))
499
500 /*
501 *@@ winhSetLboxSelectedItem:
502 * selects a list box item.
503 * This works for both single-selection and
504 * multiple-selection listboxes.
505 * In single-selection listboxes, if an item
506 * is selected (fSelect == TRUE), the previous
507 * item is automatically deselected.
508 * Note that (BOOL)fSelect is ignored if
509 * sItemIndex == LIT_NONE.
510 */
511
512 #define winhSetLboxSelectedItem(hwndListBox, sItemIndex, fSelect) \
513 (BOOL)(WinSendMsg(hwndListBox, \
514 LM_SELECTITEM, \
515 (MPARAM)(sItemIndex), \
516 (MPARAM)(fSelect)))
517
518 ULONG XWPENTRY winhLboxSelectAll(HWND hwndListBox, BOOL fSelect);
519
520 /*
521 * winhSetLboxItemHandle:
522 * sets the "item handle" for the specified sItemIndex.
523 * See LM_SETITEMHANDLE in PMREF for details.
524 */
525
526 #define winhSetLboxItemHandle(hwndListBox, sItemIndex, ulHandle) \
527 (BOOL)(WinSendMsg(hwndListBox, LM_SETITEMHANDLE, \
528 (MPARAM)(sItemIndex), \
529 (MPARAM)ulHandle))
530
531 /*
532 * winhQueryLboxItemHandle:
533 * the reverse to the previous. Returns a ULONG.
534 */
535
536 #define winhQueryLboxItemHandle(hwndListBox, sItemIndex) \
537 (ULONG)WinSendMsg(hwndListBox, LM_QUERYITEMHANDLE, \
538 MPFROMSHORT(sItemIndex), (MPARAM)NULL)
539
540 PSZ XWPENTRY winhQueryLboxItemText(HWND hwndListbox, SHORT sIndex);
541
542 BOOL XWPENTRY winhMoveLboxItem(HWND hwndSource,
543 SHORT sSourceIndex,
544 HWND hwndTarget,
545 SHORT sTargetIndex,
546 BOOL fSelectTarget);
547
548 ULONG XWPENTRY winhLboxFindItemFromHandle(HWND hwndListBox,
549 ULONG ulHandle);
550
551 /* ******************************************************************
552 *
553 * Scroll bar helpers
554 *
555 ********************************************************************/
556
557 BOOL XWPENTRY winhUpdateScrollBar(HWND hwndScrollBar,
558 ULONG ulWinPels,
559 ULONG ulViewportPels,
560 ULONG ulCurUnitOfs,
561 BOOL fAutoHide);
562
563 BOOL XWPENTRY winhHandleScrollMsg(HWND hwnd2Scroll,
564 HWND hwndScrollBar,
565 PULONG pulCurPelsOfs,
566 PRECTL prcl2Scroll,
567 LONG ulViewportPels,
568 USHORT usLineStepUnits,
569 ULONG msg,
570 MPARAM mp2);
571
572 BOOL XWPENTRY winhProcessScrollChars(HWND hwndClient,
573 HWND hwndVScroll,
574 HWND hwndHScroll,
575 MPARAM mp1,
576 MPARAM mp2,
577 ULONG ulVertMax,
578 ULONG ulHorzMax);
579
580 /* ******************************************************************
581 *
582 * Window positioning helpers
583 *
584 ********************************************************************/
585
586 BOOL XWPENTRY winhSaveWindowPos(HWND hwnd, HINI hIni, const char *pcszApp, const char *pcszKey);
587
588 BOOL XWPENTRY winhRestoreWindowPos(HWND hwnd, HINI hIni, const char *pcszApp, const char *pcszKey, ULONG fl);
589
590 #define XAC_MOVEX 0x0001
591 #define XAC_MOVEY 0x0002
592 #define XAC_SIZEX 0x0004
593 #define XAC_SIZEY 0x0008
594
595 /*
596 *@@ XADJUSTCTRLS:
597 *
598 */
599
600 typedef struct _XADJUSTCTRLS
601 {
602 BOOL fInitialized;
603 SWP swpMain; // SWP for main window
604 SWP *paswp; // pointer to array of control SWP structs
605 } XADJUSTCTRLS, *PXADJUSTCTRLS;
606
607 BOOL XWPENTRY winhAdjustControls(HWND hwndDlg,
608 MPARAM *pmpFlags,
609 ULONG ulCount,
610 PSWP pswpNew,
611 PXADJUSTCTRLS pxac);
612
613 void XWPENTRY winhCenterWindow(HWND hwnd);
614 typedef void XWPENTRY WINHCENTERWINDOW(HWND hwnd);
615 typedef WINHCENTERWINDOW *PWINHCENTERWINDOW;
616
617 HWND XWPENTRY winhFindWindowBelow(HWND hwndFind);
618
619 /* ******************************************************************
620 *
621 * Presparams helpers
622 *
623 ********************************************************************/
624
625 PSZ XWPENTRY winhQueryWindowFont(HWND hwnd);
626 typedef PSZ XWPENTRY WINHQUERYWINDOWFONT(HWND hwnd);
627 typedef WINHQUERYWINDOWFONT *PWINHQUERYWINDOWFONT;
628
629 BOOL XWPENTRY winhSetWindowFont(HWND hwnd, const char *pcszFont);
630 typedef BOOL XWPENTRY WINHSETWINDOWFONT(HWND hwnd, const char *pcszFont);
631 typedef WINHSETWINDOWFONT *PWINHSETWINDOWFONT;
632
633 /*
634 *@@ winhSetDlgItemFont:
635 * invokes winhSetWindowFont on a dialog
636 * item.
637 *
638 * Returns TRUE if successful or FALSE otherwise.
639 *
640 *@@added V0.9.0
641 */
642
643 #define winhSetDlgItemFont(hwnd, usId, pszFont) \
644 (winhSetWindowFont(WinWindowFromID(hwnd, usId), pszFont))
645
646 ULONG XWPENTRY winhSetControlsFont(HWND hwndDlg, SHORT usIDMin, SHORT usIDMax, const char *pcszFont);
647
648 #ifdef INCL_WINSYS
649 BOOL XWPENTRY winhStorePresParam(PPRESPARAMS *pppp,
650 ULONG ulAttrType,
651 ULONG cbData,
652 PVOID pData);
653 #endif
654
655 LONG XWPENTRY winhQueryPresColor(HWND hwnd, ULONG ulPP, BOOL fInherit, LONG lSysColor);
656 typedef LONG XWPENTRY WINHQUERYPRESCOLOR(HWND hwnd, ULONG ulPP, BOOL fInherit, LONG lSysColor);
657 typedef WINHQUERYPRESCOLOR *PWINHQUERYPRESCOLOR;
658
659 /* ******************************************************************
660 *
661 * Help instance helpers
662 *
663 ********************************************************************/
664
665 #ifdef INCL_WINHELP
666 HWND XWPENTRY winhCreateHelp(HWND hwndFrame,
667 const char *pcszFileName,
668 HMODULE hmod,
669 PHELPTABLE pHelpTable,
670 const char *pcszWindowTitle);
671
672 ULONG winhDisplayHelpPanel(HWND hwndHelpInstance,
673 ULONG ulHelpPanel);
674
675 void XWPENTRY winhDestroyHelp(HWND hwndHelp, HWND hwndFrame);
676 #endif
677
678 /* ******************************************************************
679 *
680 * Application control
681 *
682 ********************************************************************/
683
684 #ifdef INCL_WINPROGRAMLIST
685 // additional PROG_* flags for winhQueryAppType
686 #define PROG_XWP_DLL 998 // dynamic link library
687
688 APIRET winhQueryAppType(const char *pcszExecutable,
689 PULONG pulDosAppType,
690 PULONG pulWinAppType);
691
692 HAPP XWPENTRY winhStartApp(HWND hwndNotify, const PROGDETAILS *pcProgDetails);
693 #endif
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.