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

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