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

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

misc updates

  • Property svn:eol-style set to CRLF
  • Property svn:keywords set to Author Date Id Revision
File size: 33.0 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 /*
208 *@@ winhRemoveMenuItem:
209 * removes a menu item (SHORT) from the
210 * given menu (HWND). Returns the no. of
211 * remaining menu items (SHORT).
212 *
213 * This works for whole submenus too.
214 */
215
216 #define winhRemoveMenuItem(hwndMenu, sItemId) \
217 (SHORT)WinSendMsg(hwndMenu, MM_REMOVEITEM, MPFROM2SHORT(sItemId, FALSE), 0)
218
219 /*
220 *@@ winhDeleteMenuItem:
221 * deleted a menu item (SHORT) from the
222 * given menu (HWND). Returns the no. of
223 * remaining menu items (SHORT).
224 *
225 * As opposed to MM_REMOVEITEM, MM_DELETEITEM
226 * frees submenus and bitmaps also.
227 *
228 * This works for whole submenus too.
229 */
230
231 #define winhDeleteMenuItem(hwndMenu, sItemId) \
232 (SHORT)WinSendMsg(hwndMenu, MM_DELETEITEM, MPFROM2SHORT(sItemId, FALSE), 0)
233
234 SHORT XWPENTRY winhInsertMenuSeparator(HWND hMenu,
235 SHORT iPosition,
236 SHORT sId);
237
238 BOOL XWPENTRY winhCopyMenuItem(HWND hmenuTarget,
239 HWND hmenuSource,
240 USHORT usID,
241 SHORT sTargetPosition);
242 typedef BOOL XWPENTRY WINHCOPYMENUITEM(HWND hmenuTarget,
243 HWND hmenuSource,
244 USHORT usID,
245 SHORT sTargetPosition);
246 typedef WINHCOPYMENUITEM *PWINHCOPYMENUITEM;
247
248 HWND XWPENTRY winhMergeIntoSubMenu(HWND hmenuTarget,
249 SHORT sTargetPosition,
250 const char *pcszTitle,
251 SHORT sID,
252 HWND hmenuSource);
253 typedef HWND XWPENTRY WINHMERGEINTOSUBMENU(HWND hmenuTarget,
254 SHORT sTargetPosition,
255 const char *pcszTitle,
256 SHORT sID,
257 HWND hmenuSource);
258 typedef WINHMERGEINTOSUBMENU *PWINHMERGEINTOSUBMENU;
259
260 PSZ XWPENTRY winhQueryMenuItemText(HWND hwndMenu,
261 USHORT usItemID);
262
263 BOOL XWPENTRY winhAppend2MenuItemText(HWND hwndMenu,
264 USHORT usItemID,
265 const char *pcszAppend,
266 BOOL fTab);
267
268 VOID XWPENTRY winhMenuRemoveEllipse(HWND hwndMenu,
269 USHORT usItemId);
270
271 SHORT XWPENTRY winhQueryItemUnderMouse(HWND hwndMenu, POINTL *pptlMouse, RECTL *prtlItem);
272
273 /* ******************************************************************
274 *
275 * Slider helpers
276 *
277 ********************************************************************/
278
279 HWND XWPENTRY winhReplaceWithLinearSlider(HWND hwndParent,
280 HWND hwndOwner,
281 HWND hwndInsertAfter,
282 ULONG ulID,
283 ULONG ulSliderStyle,
284 ULONG ulTickCount);
285
286 BOOL winhSetSliderTicks(HWND hwndSlider,
287 MPARAM mpEveryOther1,
288 ULONG ulPixels1,
289 MPARAM mpEveryOther2,
290 ULONG ulPixels2);
291
292 /*
293 * winhSetSliderArmPosition:
294 * this moves the slider arm in a given
295 * linear slider.
296 *
297 * usMode can be one of the following:
298 * -- SMA_RANGEVALUE: usOffset is in pixels
299 * from the slider's home position.
300 * -- SMA_INCREMENTVALUE: usOffset is in
301 * units of the slider's primary scale.
302 */
303
304 #define winhSetSliderArmPosition(hwndSlider, usMode, usOffset) \
305 WinSendMsg(hwndSlider, SLM_SETSLIDERINFO, \
306 MPFROM2SHORT(SMA_SLIDERARMPOSITION, \
307 usMode), \
308 MPFROMSHORT(usOffset))
309
310 /*
311 * winhQuerySliderArmPosition:
312 * reverse to the previous, this returns a
313 * slider arm position (as a LONG value).
314 */
315
316 #define winhQuerySliderArmPosition(hwndSlider, usMode) \
317 (LONG)(WinSendMsg(hwndSlider, \
318 SLM_QUERYSLIDERINFO, \
319 MPFROM2SHORT(SMA_SLIDERARMPOSITION, \
320 usMode), \
321 0))
322
323 HWND XWPENTRY winhReplaceWithCircularSlider(HWND hwndParent,
324 HWND hwndOwner,
325 HWND hwndInsertAfter,
326 ULONG ulID,
327 ULONG ulSliderStyle,
328 SHORT sMin,
329 SHORT sMax,
330 USHORT usIncrement,
331 USHORT usTicksEvery);
332
333 /* ******************************************************************
334 *
335 * Spin button helpers
336 *
337 ********************************************************************/
338
339 VOID XWPENTRY winhSetDlgItemSpinData(HWND hwndDlg,
340 ULONG idSpinButton,
341 ULONG min,
342 ULONG max,
343 ULONG current);
344
345 LONG XWPENTRY winhAdjustDlgItemSpinData(HWND hwndDlg,
346 USHORT usItemID,
347 LONG lGrid,
348 USHORT usNotifyCode);
349
350 /* ******************************************************************
351 *
352 * Entry field helpers
353 *
354 ********************************************************************/
355
356 /*
357 * winhSetEntryFieldLimit:
358 * sets the maximum length for the entry field
359 * (EM_SETTEXTLIMIT message).
360 *
361 * PMREF doesn't say this, but the limit does
362 * _not_ include the null-terminator. That is,
363 * if you specify "12" characters here, you can
364 * really enter 12 characters.
365 *
366 * The default length is 30 characters, I think.
367 */
368
369 #define winhSetEntryFieldLimit(hwndEntryField, usLength) \
370 WinSendMsg(hwndEntryField, EM_SETTEXTLIMIT, (MPARAM)(usLength), (MPARAM)0)
371
372 /*
373 *@@ winhEntryFieldSelectAll:
374 * this selects the entire text in the entry field.
375 * Useful when the thing gets the focus.
376 */
377
378 #define winhEntryFieldSelectAll(hwndEntryField) \
379 WinSendMsg(hwndEntryField, EM_SETSEL, MPFROM2SHORT(0, 10000), MPNULL)
380
381 /*
382 *@@ winhHasEntryFieldChanged:
383 * this queries whether the entry field's contents
384 * have changed (EM_QUERYCHANGED message).
385 *
386 * This returns TRUE if changes have occured since
387 * the last time this message or WM_QUERYWINDOWPARAMS
388 * (WinQueryWindowText) was received.
389 */
390
391 #define winhHasEntryFieldChanged(hwndEntryField) \
392 (BOOL)WinSendMsg(hwndEntryField, EM_QUERYCHANGED, (MPARAM)0, (MPARAM)0)
393
394 /* ******************************************************************
395 *
396 * List box helpers
397 *
398 ********************************************************************/
399
400 /* The following macros are defined in the OS/2 headers for
401 list boxes:
402
403 LONG WinQueryLboxCount(HWND hwndLbox);
404 // wrapper around LM_QUERYITEMCOUNT;
405 // list box item count
406
407 SHORT WinQueryLboxItemTextLength(HWND hwndLbox,
408 SHORT index); // item index, starting from 0
409 // wrapper around LM_QUERYITEMTEXTLENGTH;
410 // returns length of item text, excluding NULL character
411
412 LONG WinQueryLboxItemText(HWND hwndLbox,
413 SHORT index, // item index, starting from 0
414 PSZ psz, // buffer
415 PSZ cchMax); // size of buffer, incl. null
416 // wrapper around LM_QUERYITEMTEXT;
417 // returns length of item text, excluding NULL character
418
419 BOOL WinSetLboxItemText(HWND hwndLbox,
420 LONG index,
421 PSZ psz);
422 // wrapper around LM_SETITEMTEXT
423
424 LONG WinInsertLboxItem(HWND hwndLbox,
425 LONG index, // new item index, starting from 0
426 // or LIT_END
427 // or LIT_SORTASCENDING
428 // or LIT_SORTDESCENDING
429 PSZ psz)
430 // wrapper around LM_INSERTITEM;
431 // returns LIT_MEMERROR, LIT_ERROR, or zero-based index
432
433 LONG WinDeleteLboxItem(HWND hwndLbox,
434 LONG index); // item index, starting from 0
435
436 LONG WinQueryLboxSelectedItem(HWND hwndLbox);
437 // wrapper around LM_QUERYSELECTION;
438 // works with single selection only,
439 // use winhQueryLboxSelectedItem instead
440 */
441
442 /*
443 * winhQueryLboxItemCount:
444 * returns the no. of items in the listbox
445 * as a SHORT.
446 *
447 *added V0.9.1 (99-12-14) [umoeller]
448 */
449
450 // #define winhQueryLboxItemCount(hwndListBox)
451 // (SHORT)WinSendMsg(hwndListBox, LM_QUERYITEMCOUNT, 0, 0)
452
453 // removed, use WinQueryLboxCount
454
455 /*
456 *@@ winhDeleteAllItems:
457 * deletes all list box items. Returns
458 * a BOOL.
459 *
460 *@@added V0.9.1 (99-12-14) [umoeller]
461 */
462
463 #define winhDeleteAllItems(hwndListBox) \
464 (BOOL)WinSendMsg(hwndListBox, \
465 LM_DELETEALL, 0, 0)
466 /*
467 *@@ winhQueryLboxSelectedItem:
468 * this queries the next selected list box item.
469 * For the first call, set sItemStart to LIT_FIRST;
470 * then repeat the call with sItemStart set to
471 * the previous return value until this returns
472 * LIT_NONE.
473 *
474 * Example:
475 + SHORT sItemStart = LIT_FIRST;
476 + while (TRUE)
477 + {
478 + sItemStart = winhQueryLboxSelectedItem(hwndListBox,
479 + sItemStart)
480 + if (sItemStart == LIT_NONE)
481 + break;
482 + ...
483 + }
484 *
485 * To have the cursored item returned, use LIT_CURSOR.
486 *
487 * For single selection, you can also use
488 * WinQueryLboxSelectedItem from the OS/2 PM headers.
489 */
490
491 #define winhQueryLboxSelectedItem(hwndListBox, sItemStart) \
492 (SHORT)(WinSendMsg(hwndListBox, \
493 LM_QUERYSELECTION, \
494 (MPARAM)(sItemStart), \
495 MPNULL))
496
497 /*
498 *@@ winhSetLboxSelectedItem:
499 * selects a list box item.
500 * This works for both single-selection and
501 * multiple-selection listboxes.
502 * In single-selection listboxes, if an item
503 * is selected (fSelect == TRUE), the previous
504 * item is automatically deselected.
505 * Note that (BOOL)fSelect is ignored if
506 * sItemIndex == LIT_NONE.
507 */
508
509 #define winhSetLboxSelectedItem(hwndListBox, sItemIndex, fSelect) \
510 (BOOL)(WinSendMsg(hwndListBox, \
511 LM_SELECTITEM, \
512 (MPARAM)(sItemIndex), \
513 (MPARAM)(fSelect)))
514
515 ULONG XWPENTRY winhLboxSelectAll(HWND hwndListBox, BOOL fSelect);
516
517 /*
518 * winhSetLboxItemHandle:
519 * sets the "item handle" for the specified sItemIndex.
520 * See LM_SETITEMHANDLE in PMREF for details.
521 */
522
523 #define winhSetLboxItemHandle(hwndListBox, sItemIndex, ulHandle) \
524 (BOOL)(WinSendMsg(hwndListBox, LM_SETITEMHANDLE, \
525 (MPARAM)(sItemIndex), \
526 (MPARAM)ulHandle))
527
528 /*
529 * winhQueryLboxItemHandle:
530 * the reverse to the previous. Returns a ULONG.
531 */
532
533 #define winhQueryLboxItemHandle(hwndListBox, sItemIndex) \
534 (ULONG)WinSendMsg(hwndListBox, LM_QUERYITEMHANDLE, \
535 MPFROMSHORT(sItemIndex), (MPARAM)NULL)
536
537 PSZ XWPENTRY winhQueryLboxItemText(HWND hwndListbox, SHORT sIndex);
538
539 BOOL XWPENTRY winhMoveLboxItem(HWND hwndSource,
540 SHORT sSourceIndex,
541 HWND hwndTarget,
542 SHORT sTargetIndex,
543 BOOL fSelectTarget);
544
545 ULONG XWPENTRY winhLboxFindItemFromHandle(HWND hwndListBox,
546 ULONG ulHandle);
547
548 /* ******************************************************************
549 *
550 * Scroll bar helpers
551 *
552 ********************************************************************/
553
554 BOOL XWPENTRY winhUpdateScrollBar(HWND hwndScrollBar,
555 ULONG ulWinPels,
556 ULONG ulViewportPels,
557 ULONG ulCurUnitOfs,
558 BOOL fAutoHide);
559
560 BOOL XWPENTRY winhHandleScrollMsg(HWND hwnd2Scroll,
561 HWND hwndScrollBar,
562 PULONG pulCurPelsOfs,
563 PRECTL prcl2Scroll,
564 LONG ulViewportPels,
565 USHORT usLineStepUnits,
566 ULONG msg,
567 MPARAM mp2);
568
569 BOOL XWPENTRY winhProcessScrollChars(HWND hwndClient,
570 HWND hwndVScroll,
571 HWND hwndHScroll,
572 MPARAM mp1,
573 MPARAM mp2,
574 ULONG ulVertMax,
575 ULONG ulHorzMax);
576
577 /* ******************************************************************
578 *
579 * Window positioning helpers
580 *
581 ********************************************************************/
582
583 BOOL XWPENTRY winhSaveWindowPos(HWND hwnd, HINI hIni, const char *pcszApp, const char *pcszKey);
584
585 BOOL XWPENTRY winhRestoreWindowPos(HWND hwnd, HINI hIni, const char *pcszApp, const char *pcszKey, ULONG fl);
586
587 #define XAC_MOVEX 0x0001
588 #define XAC_MOVEY 0x0002
589 #define XAC_SIZEX 0x0004
590 #define XAC_SIZEY 0x0008
591
592 /*
593 *@@ XADJUSTCTRLS:
594 *
595 */
596
597 typedef struct _XADJUSTCTRLS
598 {
599 BOOL fInitialized;
600 SWP swpMain; // SWP for main window
601 SWP *paswp; // pointer to array of control SWP structs
602 } XADJUSTCTRLS, *PXADJUSTCTRLS;
603
604 BOOL XWPENTRY winhAdjustControls(HWND hwndDlg,
605 MPARAM *pmpFlags,
606 ULONG ulCount,
607 PSWP pswpNew,
608 PXADJUSTCTRLS pxac);
609
610 void XWPENTRY winhCenterWindow(HWND hwnd);
611 typedef void XWPENTRY WINHCENTERWINDOW(HWND hwnd);
612 typedef WINHCENTERWINDOW *PWINHCENTERWINDOW;
613
614 HWND XWPENTRY winhFindWindowBelow(HWND hwndFind);
615
616 /* ******************************************************************
617 *
618 * Presparams helpers
619 *
620 ********************************************************************/
621
622 PSZ XWPENTRY winhQueryWindowFont(HWND hwnd);
623 typedef PSZ XWPENTRY WINHQUERYWINDOWFONT(HWND hwnd);
624 typedef WINHQUERYWINDOWFONT *PWINHQUERYWINDOWFONT;
625
626 BOOL XWPENTRY winhSetWindowFont(HWND hwnd, const char *pcszFont);
627 typedef BOOL XWPENTRY WINHSETWINDOWFONT(HWND hwnd, const char *pcszFont);
628 typedef WINHSETWINDOWFONT *PWINHSETWINDOWFONT;
629
630 /*
631 *@@ winhSetDlgItemFont:
632 * invokes winhSetWindowFont on a dialog
633 * item.
634 *
635 * Returns TRUE if successful or FALSE otherwise.
636 *
637 *@@added V0.9.0
638 */
639
640 #define winhSetDlgItemFont(hwnd, usId, pszFont) \
641 (winhSetWindowFont(WinWindowFromID(hwnd, usId), pszFont))
642
643 ULONG XWPENTRY winhSetControlsFont(HWND hwndDlg, SHORT usIDMin, SHORT usIDMax, const char *pcszFont);
644
645 #ifdef INCL_WINSYS
646 BOOL XWPENTRY winhStorePresParam(PPRESPARAMS *pppp,
647 ULONG ulAttrType,
648 ULONG cbData,
649 PVOID pData);
650 #endif
651
652 LONG XWPENTRY winhQueryPresColor(HWND hwnd, ULONG ulPP, BOOL fInherit, LONG lSysColor);
653 typedef LONG XWPENTRY WINHQUERYPRESCOLOR(HWND hwnd, ULONG ulPP, BOOL fInherit, LONG lSysColor);
654 typedef WINHQUERYPRESCOLOR *PWINHQUERYPRESCOLOR;
655
656 /* ******************************************************************
657 *
658 * Help instance helpers
659 *
660 ********************************************************************/
661
662 #ifdef INCL_WINHELP
663 HWND XWPENTRY winhCreateHelp(HWND hwndFrame,
664 const char *pcszFileName,
665 HMODULE hmod,
666 PHELPTABLE pHelpTable,
667 const char *pcszWindowTitle);
668
669 ULONG winhDisplayHelpPanel(HWND hwndHelpInstance,
670 ULONG ulHelpPanel);
671
672 void XWPENTRY winhDestroyHelp(HWND hwndHelp, HWND hwndFrame);
673 #endif
674
675 /* ******************************************************************
676 *
677 * Application control
678 *
679 ********************************************************************/
680
681 #ifdef INCL_WINPROGRAMLIST
682 // additional PROG_* flags for winhQueryAppType
683 #define PROG_XWP_DLL 998 // dynamic link library
684
685 APIRET winhQueryAppType(const char *pcszExecutable,
686 PULONG pulDosAppType,
687 PULONG pulWinAppType);
688
689 HAPP XWPENTRY winhStartApp(HWND hwndNotify, const PROGDETAILS *pcProgDetails);
690 #endif
691
692 BOOL XWPENTRY winhAnotherInstance(const char *pcszSemName, BOOL fSwitch);
693
694 HSWITCH XWPENTRY winhAddToTasklist(HWND hwnd, HPOINTER hIcon);
695
696 /* ******************************************************************
697 *
698 * Miscellaneous
699 *
700 ********************************************************************/
701
702 VOID XWPENTRY winhFree(PVOID p);
703 typedef VOID XWPENTRY WINHFREE(PVOID p);
704 typedef WINHFREE *PWINHFREE;
705
706 HAB XWPENTRY winhMyAnchorBlock(VOID);
707 typedef HAB XWPENTRY WINHMYANCHORBLOCK(VOID);
708 typedef WINHMYANCHORBLOCK *PWINHMYANCHORBLOCK;
709
710 VOID XWPENTRY winhSleep(ULONG ulSleep);
711
712 #define WINH_FOD_SAVEDLG 0x0001
713 #define WINH_FOD_INILOADDIR 0x0010
714 #define WINH_FOD_INISAVEDIR 0x0020
715
716 BOOL XWPENTRY winhFileDlg(HWND hwndOwner,
717 PSZ pszFile,
718 ULONG flFlags,
719 HINI hini,
720 const char *pcszApplication,
721 const char *pcszKey);
722
723 HPOINTER XWPENTRY winhSetWaitPointer(VOID);
724
725 PSZ XWPENTRY winhQueryWindowText(HWND hwnd);
726
727 /*
728 *@@ winhQueryDlgItemText:
729 * like winhQueryWindowText, but for the dialog item
730 * in hwnd which has the ID usItemID.
731 */
732
733 #define winhQueryDlgItemText(hwnd, usItemID) winhQueryWindowText(WinWindowFromID(hwnd, usItemID))
734
735 BOOL XWPENTRY winhReplaceWindowText(HWND hwnd,
736 const char *pcszSearch,
737 const char *pcszReplaceWith);
738
739 ULONG XWPENTRY winhCenteredDlgBox(HWND hwndParent, HWND hwndOwner,
740 PFNWP pfnDlgProc, HMODULE hmod, ULONG idDlg, PVOID pCreateParams);
741 typedef ULONG XWPENTRY WINHCENTEREDDLGBOX(HWND hwndParent, HWND hwndOwner,
742 PFNWP pfnDlgProc, HMODULE hmod, ULONG idDlg, PVOID pCreateParams);
743 typedef WINHCENTEREDDLGBOX *PWINHCENTEREDDLGBOX;
744
745 ULONG XWPENTRY winhEnableControls(HWND hwndDlg,
746 USHORT usIDFirst,
747 USHORT usIDLast,
748 BOOL fEnable);
749
750 HWND XWPENTRY winhCreateStdWindow(HWND hwndFrameParent,
751 PSWP pswpFrame,
752 ULONG flFrameCreateFlags,
753 ULONG ulFrameStyle,
754 const char *pcszFrameTitle,
755 ULONG ulResourcesID,
756 const char *pcszClassClient,
757 ULONG flStyleClient,
758 ULONG ulID,
759 PVOID pClientCtlData,
760 PHWND phwndClient);
761
762 HWND XWPENTRY winhCreateObjectWindow(const char *pcszWindowClass,
763 PVOID pvCreateParam);
764
765 HWND XWPENTRY winhCreateControl(HWND hwndParentAndOwner,
766 const char *pcszClass,
767 const char *pcszText,
768 ULONG ulStyle,
769 ULONG ulID);
770
771 VOID XWPENTRY winhRepaintWindows(HWND hwndParent);
772
773 HMQ XWPENTRY winhFindMsgQueue(PID pid, TID tid, HAB* phab);
774
775 VOID XWPENTRY winhFindPMErrorWindows(HWND *phwndHardError, HWND *phwndSysError);
776
777 HWND XWPENTRY winhCreateFakeDesktop(HWND hwndSibling);
778
779 BOOL XWPENTRY winhAssertWarp4Notebook(HWND hwndDlg,
780 USHORT usIdThreshold,
781 ULONG ulDownUnits);
782
783 ULONG XWPENTRY winhDrawFormattedText(HPS hps, PRECTL prcl, const char *pcszText, ULONG flCmd);
784
785 #ifdef INCL_WINSWITCHLIST
786 PSWBLOCK XWPENTRY winhQuerySwitchList(HAB hab);
787 typedef PSWBLOCK XWPENTRY WINHQUERYSWITCHLIST(HAB hab);
788 typedef WINHQUERYSWITCHLIST *PWINHQUERYSWITCHLIST;
789 #endif
790
791 HWND XWPENTRY winhQueryTasklistWindow(VOID);
792 typedef HWND XWPENTRY WINHQUERYTASKLISTWINDOW(VOID);
793 typedef WINHQUERYTASKLISTWINDOW *PWINHQUERYTASKLISTWINDOW;
794
795 VOID XWPENTRY winhKillTasklist(VOID);
796
797 ULONG XWPENTRY winhQueryPendingSpoolJobs(VOID);
798
799 VOID XWPENTRY winhSetNumLock(BOOL fState);
800
801 /*
802 *@@ winhQueryScreenCX:
803 * helper macro for getting the screen width.
804 */
805
806 #define winhQueryScreenCX() (WinQuerySysValue(HWND_DESKTOP, SV_CXSCREEN))
807
808 /*
809 *@@ winhQueryScreenCY:
810 * helper macro for getting the screen height.
811 */
812
813 #define winhQueryScreenCY() (WinQuerySysValue(HWND_DESKTOP, SV_CYSCREEN))
814
815 /* ******************************************************************
816 *
817 * WPS Class List helpers
818 *
819 ********************************************************************/
820
821 PBYTE XWPENTRY winhQueryWPSClassList(VOID);
822
823 PBYTE XWPENTRY winhQueryWPSClass(PBYTE pObjClass, const char *pszClass);
824
825 APIRET XWPENTRY winhRegisterClass(const char* pcszClassName,
826 const char* pcszModule,
827 PSZ pszBuf,
828 ULONG cbBuf);
829
830 BOOL XWPENTRY winhIsClassRegistered(const char *pcszClass);
831
832 ULONG XWPENTRY winhResetWPS(HAB hab);
833
834#endif
835
836#if __cplusplus
837}
838#endif
839
Note: See TracBrowser for help on using the repository browser.