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

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

New folder sorting. Updated folder refresh. Misc other changes.

  • Property svn:eol-style set to CRLF
  • Property svn:keywords set to Author Date Id Revision
File size: 32.9 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 /* ******************************************************************
546 *
547 * Scroll bar helpers
548 *
549 ********************************************************************/
550
551 BOOL XWPENTRY winhUpdateScrollBar(HWND hwndScrollBar,
552 ULONG ulWinPels,
553 ULONG ulViewportPels,
554 ULONG ulCurUnitOfs,
555 BOOL fAutoHide);
556
557 BOOL XWPENTRY winhHandleScrollMsg(HWND hwnd2Scroll,
558 HWND hwndScrollBar,
559 PULONG pulCurPelsOfs,
560 PRECTL prcl2Scroll,
561 LONG ulViewportPels,
562 USHORT usLineStepUnits,
563 ULONG msg,
564 MPARAM mp2);
565
566 BOOL XWPENTRY winhProcessScrollChars(HWND hwndClient,
567 HWND hwndVScroll,
568 HWND hwndHScroll,
569 MPARAM mp1,
570 MPARAM mp2,
571 ULONG ulVertMax,
572 ULONG ulHorzMax);
573
574 /* ******************************************************************
575 *
576 * Window positioning helpers
577 *
578 ********************************************************************/
579
580 BOOL XWPENTRY winhSaveWindowPos(HWND hwnd, HINI hIni, const char *pcszApp, const char *pcszKey);
581
582 BOOL XWPENTRY winhRestoreWindowPos(HWND hwnd, HINI hIni, const char *pcszApp, const char *pcszKey, ULONG fl);
583
584 #define XAC_MOVEX 0x0001
585 #define XAC_MOVEY 0x0002
586 #define XAC_SIZEX 0x0004
587 #define XAC_SIZEY 0x0008
588
589 /*
590 *@@ XADJUSTCTRLS:
591 *
592 */
593
594 typedef struct _XADJUSTCTRLS
595 {
596 BOOL fInitialized;
597 SWP swpMain; // SWP for main window
598 SWP *paswp; // pointer to array of control SWP structs
599 } XADJUSTCTRLS, *PXADJUSTCTRLS;
600
601 BOOL XWPENTRY winhAdjustControls(HWND hwndDlg,
602 MPARAM *pmpFlags,
603 ULONG ulCount,
604 PSWP pswpNew,
605 PXADJUSTCTRLS pxac);
606
607 void XWPENTRY winhCenterWindow(HWND hwnd);
608 typedef void XWPENTRY WINHCENTERWINDOW(HWND hwnd);
609 typedef WINHCENTERWINDOW *PWINHCENTERWINDOW;
610
611 HWND XWPENTRY winhFindWindowBelow(HWND hwndFind);
612
613 /* ******************************************************************
614 *
615 * Presparams helpers
616 *
617 ********************************************************************/
618
619 PSZ XWPENTRY winhQueryWindowFont(HWND hwnd);
620 typedef PSZ XWPENTRY WINHQUERYWINDOWFONT(HWND hwnd);
621 typedef WINHQUERYWINDOWFONT *PWINHQUERYWINDOWFONT;
622
623 BOOL XWPENTRY winhSetWindowFont(HWND hwnd, const char *pcszFont);
624 typedef BOOL XWPENTRY WINHSETWINDOWFONT(HWND hwnd, const char *pcszFont);
625 typedef WINHSETWINDOWFONT *PWINHSETWINDOWFONT;
626
627 /*
628 *@@ winhSetDlgItemFont:
629 * invokes winhSetWindowFont on a dialog
630 * item.
631 *
632 * Returns TRUE if successful or FALSE otherwise.
633 *
634 *@@added V0.9.0
635 */
636
637 #define winhSetDlgItemFont(hwnd, usId, pszFont) \
638 (winhSetWindowFont(WinWindowFromID(hwnd, usId), pszFont))
639
640 ULONG XWPENTRY winhSetControlsFont(HWND hwndDlg, SHORT usIDMin, SHORT usIDMax, const char *pcszFont);
641
642 #ifdef INCL_WINSYS
643 BOOL XWPENTRY winhStorePresParam(PPRESPARAMS *pppp,
644 ULONG ulAttrType,
645 ULONG cbData,
646 PVOID pData);
647 #endif
648
649 LONG XWPENTRY winhQueryPresColor(HWND hwnd, ULONG ulPP, BOOL fInherit, LONG lSysColor);
650 typedef LONG XWPENTRY WINHQUERYPRESCOLOR(HWND hwnd, ULONG ulPP, BOOL fInherit, LONG lSysColor);
651 typedef WINHQUERYPRESCOLOR *PWINHQUERYPRESCOLOR;
652
653 /* ******************************************************************
654 *
655 * Help instance helpers
656 *
657 ********************************************************************/
658
659 #ifdef INCL_WINHELP
660 HWND XWPENTRY winhCreateHelp(HWND hwndFrame,
661 const char *pcszFileName,
662 HMODULE hmod,
663 PHELPTABLE pHelpTable,
664 const char *pcszWindowTitle);
665
666 ULONG winhDisplayHelpPanel(HWND hwndHelpInstance,
667 ULONG ulHelpPanel);
668
669 void XWPENTRY winhDestroyHelp(HWND hwndHelp, HWND hwndFrame);
670 #endif
671
672 /* ******************************************************************
673 *
674 * Application control
675 *
676 ********************************************************************/
677
678 #ifdef INCL_WINPROGRAMLIST
679 // additional PROG_* flags for winhQueryAppType
680 #define PROG_XWP_DLL 998 // dynamic link library
681
682 APIRET winhQueryAppType(const char *pcszExecutable,
683 PULONG pulDosAppType,
684 PULONG pulWinAppType);
685
686 HAPP XWPENTRY winhStartApp(HWND hwndNotify, const PROGDETAILS *pcProgDetails);
687 #endif
688
689 BOOL XWPENTRY winhAnotherInstance(const char *pcszSemName, BOOL fSwitch);
690
691 HSWITCH XWPENTRY winhAddToTasklist(HWND hwnd, HPOINTER hIcon);
692
693 /* ******************************************************************
694 *
695 * Miscellaneous
696 *
697 ********************************************************************/
698
699 VOID XWPENTRY winhFree(PVOID p);
700 typedef VOID XWPENTRY WINHFREE(PVOID p);
701 typedef WINHFREE *PWINHFREE;
702
703 HAB XWPENTRY winhMyAnchorBlock(VOID);
704 typedef HAB XWPENTRY WINHMYANCHORBLOCK(VOID);
705 typedef WINHMYANCHORBLOCK *PWINHMYANCHORBLOCK;
706
707 VOID XWPENTRY winhSleep(ULONG ulSleep);
708
709 #define WINH_FOD_SAVEDLG 0x0001
710 #define WINH_FOD_INILOADDIR 0x0010
711 #define WINH_FOD_INISAVEDIR 0x0020
712
713 BOOL XWPENTRY winhFileDlg(HWND hwndOwner,
714 PSZ pszFile,
715 ULONG flFlags,
716 HINI hini,
717 const char *pcszApplication,
718 const char *pcszKey);
719
720 HPOINTER XWPENTRY winhSetWaitPointer(VOID);
721
722 PSZ XWPENTRY winhQueryWindowText(HWND hwnd);
723
724 /*
725 *@@ winhQueryDlgItemText:
726 * like winhQueryWindowText, but for the dialog item
727 * in hwnd which has the ID usItemID.
728 */
729
730 #define winhQueryDlgItemText(hwnd, usItemID) winhQueryWindowText(WinWindowFromID(hwnd, usItemID))
731
732 BOOL XWPENTRY winhReplaceWindowText(HWND hwnd,
733 const char *pcszSearch,
734 const char *pcszReplaceWith);
735
736 ULONG XWPENTRY winhCenteredDlgBox(HWND hwndParent, HWND hwndOwner,
737 PFNWP pfnDlgProc, HMODULE hmod, ULONG idDlg, PVOID pCreateParams);
738 typedef ULONG XWPENTRY WINHCENTEREDDLGBOX(HWND hwndParent, HWND hwndOwner,
739 PFNWP pfnDlgProc, HMODULE hmod, ULONG idDlg, PVOID pCreateParams);
740 typedef WINHCENTEREDDLGBOX *PWINHCENTEREDDLGBOX;
741
742 ULONG XWPENTRY winhEnableControls(HWND hwndDlg,
743 USHORT usIDFirst,
744 USHORT usIDLast,
745 BOOL fEnable);
746
747 HWND XWPENTRY winhCreateStdWindow(HWND hwndFrameParent,
748 PSWP pswpFrame,
749 ULONG flFrameCreateFlags,
750 ULONG ulFrameStyle,
751 const char *pcszFrameTitle,
752 ULONG ulResourcesID,
753 const char *pcszClassClient,
754 ULONG flStyleClient,
755 ULONG ulID,
756 PVOID pClientCtlData,
757 PHWND phwndClient);
758
759 HWND XWPENTRY winhCreateObjectWindow(const char *pcszWindowClass,
760 PVOID pvCreateParam);
761
762 HWND XWPENTRY winhCreateControl(HWND hwndParentAndOwner,
763 const char *pcszClass,
764 const char *pcszText,
765 ULONG ulStyle,
766 ULONG ulID);
767
768 VOID XWPENTRY winhRepaintWindows(HWND hwndParent);
769
770 HMQ XWPENTRY winhFindMsgQueue(PID pid, TID tid, HAB* phab);
771
772 VOID XWPENTRY winhFindPMErrorWindows(HWND *phwndHardError, HWND *phwndSysError);
773
774 HWND XWPENTRY winhCreateFakeDesktop(HWND hwndSibling);
775
776 BOOL XWPENTRY winhAssertWarp4Notebook(HWND hwndDlg,
777 USHORT usIdThreshold,
778 ULONG ulDownUnits);
779
780 ULONG XWPENTRY winhDrawFormattedText(HPS hps, PRECTL prcl, const char *pcszText, ULONG flCmd);
781
782 #ifdef INCL_WINSWITCHLIST
783 PSWBLOCK XWPENTRY winhQuerySwitchList(HAB hab);
784 typedef PSWBLOCK XWPENTRY WINHQUERYSWITCHLIST(HAB hab);
785 typedef WINHQUERYSWITCHLIST *PWINHQUERYSWITCHLIST;
786 #endif
787
788 HWND XWPENTRY winhQueryTasklistWindow(VOID);
789 typedef HWND XWPENTRY WINHQUERYTASKLISTWINDOW(VOID);
790 typedef WINHQUERYTASKLISTWINDOW *PWINHQUERYTASKLISTWINDOW;
791
792 VOID XWPENTRY winhKillTasklist(VOID);
793
794 ULONG XWPENTRY winhQueryPendingSpoolJobs(VOID);
795
796 VOID XWPENTRY winhSetNumLock(BOOL fState);
797
798 /*
799 *@@ winhQueryScreenCX:
800 * helper macro for getting the screen width.
801 */
802
803 #define winhQueryScreenCX() (WinQuerySysValue(HWND_DESKTOP, SV_CXSCREEN))
804
805 /*
806 *@@ winhQueryScreenCY:
807 * helper macro for getting the screen height.
808 */
809
810 #define winhQueryScreenCY() (WinQuerySysValue(HWND_DESKTOP, SV_CYSCREEN))
811
812 /* ******************************************************************
813 *
814 * WPS Class List helpers
815 *
816 ********************************************************************/
817
818 PBYTE XWPENTRY winhQueryWPSClassList(VOID);
819
820 PBYTE XWPENTRY winhQueryWPSClass(PBYTE pObjClass, const char *pszClass);
821
822 APIRET XWPENTRY winhRegisterClass(const char* pcszClassName,
823 const char* pcszModule,
824 PSZ pszBuf,
825 ULONG cbBuf);
826
827 BOOL XWPENTRY winhIsClassRegistered(const char *pcszClass);
828
829 ULONG XWPENTRY winhResetWPS(HAB hab);
830
831#endif
832
833#if __cplusplus
834}
835#endif
836
Note: See TracBrowser for help on using the repository browser.