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

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