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

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

Tons of changes from the last weeks.

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