[7] | 1 |
|
---|
| 2 | /*
|
---|
| 3 | *@@sourcefile winh.h:
|
---|
| 4 | * header file for winh.c (PM helper funcs). See remarks there.
|
---|
| 5 | *
|
---|
[69] | 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 | *
|
---|
[7] | 13 | * Note: Version numbering in this file relates to XWorkplace version
|
---|
| 14 | * numbering.
|
---|
| 15 | */
|
---|
| 16 |
|
---|
[354] | 17 | /* Copyright (C) 1997-2007 Ulrich Mller.
|
---|
[14] | 18 | * This file is part of the "XWorkplace helpers" source package.
|
---|
| 19 | * This is free software; you can redistribute it and/or modify
|
---|
[7] | 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
|
---|
[14] | 41 | *@@include #define INCL_WINSWITCHLIST // for winhQuerySwitchList
|
---|
[76] | 42 | *@@include #define INCL_WINPROGRAMLIST // for appStartApp
|
---|
[7] | 43 | *@@include #define INCL_WINHELP // for help manager helpers
|
---|
| 44 | *@@include #include <os2.h>
|
---|
[113] | 45 | *@@include #include "helpers\winh.h"
|
---|
[7] | 46 | */
|
---|
| 47 |
|
---|
| 48 | #if __cplusplus
|
---|
| 49 | extern "C" {
|
---|
| 50 | #endif
|
---|
| 51 |
|
---|
| 52 | #ifndef WINH_HEADER_INCLUDED
|
---|
| 53 | #define WINH_HEADER_INCLUDED
|
---|
| 54 |
|
---|
[14] | 55 | #ifndef XWPENTRY
|
---|
| 56 | #error You must define XWPENTRY to contain the standard linkage for the XWPHelpers.
|
---|
| 57 | #endif
|
---|
| 58 |
|
---|
[7] | 59 | /* ******************************************************************
|
---|
[14] | 60 | *
|
---|
| 61 | * Declarations
|
---|
| 62 | *
|
---|
[7] | 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 |
|
---|
[232] | 73 | // these undocumented msgs are posted whenever the mouse
|
---|
| 74 | // enters or leaves a window V1.0.1 (2002-11-30) [umoeller]
|
---|
| 75 | #ifndef WM_MOUSEENTER
|
---|
| 76 | #define WM_MOUSEENTER 0x041E
|
---|
| 77 | #define WM_MOUSELEAVE 0x041F
|
---|
| 78 | #endif
|
---|
| 79 |
|
---|
[245] | 80 | #ifndef PP_FIELDBACKGROUNDCOLOR
|
---|
| 81 | #define PP_FIELDBACKGROUNDCOLOR 57L
|
---|
| 82 | #endif
|
---|
| 83 |
|
---|
| 84 | #ifndef PP_PAGEFOREGROUNDCOLOR
|
---|
| 85 | #define PP_PAGEFOREGROUNDCOLOR 68L
|
---|
| 86 | #endif
|
---|
| 87 |
|
---|
| 88 | #ifndef PP_PAGEBACKGROUNDCOLOR
|
---|
| 89 | #define PP_PAGEBACKGROUNDCOLOR 69L
|
---|
| 90 | #endif
|
---|
| 91 |
|
---|
| 92 | #ifndef CM_SETGRIDINFO
|
---|
| 93 | #define CM_SETGRIDINFO 0x0354
|
---|
| 94 | #define CM_QUERYGRIDINFO 0x0355
|
---|
| 95 | #define CM_SNAPTOGRID 0x0356
|
---|
| 96 | #define CRA_LOCKED 0x00000400L /* record is locked. */
|
---|
| 97 | #endif
|
---|
| 98 |
|
---|
[7] | 99 | /* ******************************************************************
|
---|
[14] | 100 | *
|
---|
[69] | 101 | * Wrappers
|
---|
| 102 | *
|
---|
| 103 | ********************************************************************/
|
---|
| 104 |
|
---|
| 105 | // if WINH_STANDARDWRAPPERS is #define'd before including winh.h,
|
---|
| 106 | // all the following Win* API calls are redirected to the winh*
|
---|
| 107 | // counterparts
|
---|
| 108 |
|
---|
| 109 | #ifdef WINH_STANDARDWRAPPERS
|
---|
| 110 |
|
---|
[81] | 111 | MRESULT XWPENTRY winhSendMsg(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
|
---|
[69] | 112 | #define WinSendMsg(a,b,c,d) winhSendMsg((a),(b),(c),(d))
|
---|
| 113 |
|
---|
[84] | 114 | MRESULT XWPENTRY winhSendDlgItemMsg(HWND hwnd, ULONG id, ULONG msg, MPARAM mp1, MPARAM mp2);
|
---|
| 115 | #define WinSendDlgItemMsg(a,b,c,d,e) winhSendDlgItemMsg((a),(b),(c),(d),(e))
|
---|
| 116 |
|
---|
[81] | 117 | BOOL XWPENTRY winhPostMsg(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
|
---|
[69] | 118 | #define WinPostMsg(a,b,c,d) winhPostMsg((a),(b),(c),(d))
|
---|
| 119 |
|
---|
[81] | 120 | HWND XWPENTRY winhWindowFromID(HWND hwnd, ULONG id);
|
---|
[69] | 121 | #define WinWindowFromID(a,b) winhWindowFromID((a),(b))
|
---|
| 122 |
|
---|
[81] | 123 | HWND XWPENTRY winhQueryWindow(HWND hwnd, LONG lCode);
|
---|
[69] | 124 | #define WinQueryWindow(a,b) winhQueryWindow((a),(b))
|
---|
| 125 |
|
---|
[81] | 126 | PVOID XWPENTRY winhQueryWindowPtr(HWND hwnd, LONG index);
|
---|
| 127 | #define WinQueryWindowPtr(a,b) winhQueryWindowPtr((a),(b))
|
---|
| 128 |
|
---|
[108] | 129 | BOOL XWPENTRY winhSetWindowText2(HWND hwnd, const char *pcsz);
|
---|
| 130 | #define WinSetWindowText(a,b) winhSetWindowText2((a),(b))
|
---|
[81] | 131 |
|
---|
| 132 | BOOL XWPENTRY winhSetDlgItemText(HWND hwnd, ULONG id, const char *pcsz);
|
---|
| 133 | #define WinSetDlgItemText(a,b,c) winhSetDlgItemText((a),(b),(c))
|
---|
[135] | 134 |
|
---|
[166] | 135 | // pmwin.h defines the WinEnableControl macro; turn this into our function call
|
---|
| 136 | #ifdef WinEnableControl
|
---|
| 137 | #undef WinEnableControl
|
---|
| 138 | #endif
|
---|
| 139 | #define WinEnableControl(hwndDlg, id, fEnable) winhEnableDlgItem((hwndDlg), (id), (fEnable))
|
---|
| 140 |
|
---|
[135] | 141 | #ifdef INCL_WINMESSAGEMGR
|
---|
| 142 | APIRET XWPENTRY winhRequestMutexSem(HMTX hmtx, ULONG ulTimeout);
|
---|
| 143 | #define WinRequestMutexSem(a, b) winhRequestMutexSem((a), (b))
|
---|
| 144 | #endif
|
---|
[69] | 145 | #endif
|
---|
| 146 |
|
---|
| 147 | /* ******************************************************************
|
---|
| 148 | *
|
---|
[14] | 149 | * Macros
|
---|
| 150 | *
|
---|
[7] | 151 | ********************************************************************/
|
---|
| 152 |
|
---|
| 153 | /*
|
---|
| 154 | * Here come some monster macros for
|
---|
| 155 | * frequently needed functions.
|
---|
| 156 | */
|
---|
| 157 |
|
---|
| 158 | #define winhDebugBox(hwndOwner, title, text) \
|
---|
| 159 | WinMessageBox(HWND_DESKTOP, hwndOwner, ((PSZ)text), ((PSZ)title), 0, MB_OK | MB_ICONEXCLAMATION | MB_MOVEABLE)
|
---|
| 160 |
|
---|
| 161 | #define winhYesNoBox(title, text) \
|
---|
| 162 | WinMessageBox(HWND_DESKTOP, HWND_DESKTOP, ((PSZ)text), ((PSZ)title), 0, MB_YESNO | MB_ICONQUESTION | MB_MOVEABLE)
|
---|
| 163 |
|
---|
[84] | 164 | #define winhSetDlgItemChecked(hwnd, id, bCheck) \
|
---|
[7] | 165 | WinSendDlgItemMsg((hwnd), (id), BM_SETCHECK, MPFROMSHORT(bCheck), MPNULL)
|
---|
| 166 | #define winhIsDlgItemChecked(hwnd, id) \
|
---|
| 167 | (SHORT1FROMMR(WinSendDlgItemMsg((hwnd), (id), BM_QUERYCHECK, MPNULL, MPNULL)))
|
---|
| 168 |
|
---|
| 169 | #define winhSetMenuItemChecked(hwndMenu, usId, bCheck) \
|
---|
| 170 | WinSendMsg(hwndMenu, MM_SETITEMATTR, MPFROM2SHORT(usId, TRUE), \
|
---|
| 171 | MPFROM2SHORT(MIA_CHECKED, (((bCheck)) ? MIA_CHECKED : FALSE)))
|
---|
| 172 |
|
---|
| 173 | #define winhShowDlgItem(hwnd, id, show) \
|
---|
| 174 | WinShowWindow(WinWindowFromID(hwnd, id), show)
|
---|
| 175 |
|
---|
[69] | 176 | // made these functions V0.9.12 (2001-05-18) [umoeller]
|
---|
| 177 | /* #define winhEnableDlgItem(hwndDlg, ulId, Enable) \
|
---|
[7] | 178 | WinEnableWindow(WinWindowFromID(hwndDlg, ulId), Enable)
|
---|
| 179 | #define winhIsDlgItemEnabled(hwndDlg, ulId) \
|
---|
| 180 | WinIsWindowEnabled(WinWindowFromID(hwndDlg, ulId))
|
---|
[69] | 181 | */
|
---|
[7] | 182 |
|
---|
| 183 | #define winhSetDlgItemFocus(hwndDlg, ulId) \
|
---|
| 184 | WinSetFocus(HWND_DESKTOP, WinWindowFromID(hwndDlg, ulId))
|
---|
| 185 |
|
---|
| 186 | /* ******************************************************************
|
---|
[14] | 187 | *
|
---|
[48] | 188 | * Rectangle helpers
|
---|
| 189 | *
|
---|
| 190 | ********************************************************************/
|
---|
| 191 |
|
---|
| 192 | VOID XWPENTRY winhOffsetRect(PRECTL prcl, LONG lx, LONG ly);
|
---|
| 193 |
|
---|
| 194 | /* ******************************************************************
|
---|
| 195 | *
|
---|
[69] | 196 | * Generics
|
---|
| 197 | *
|
---|
| 198 | ********************************************************************/
|
---|
| 199 |
|
---|
[232] | 200 | extern LONG G_cxScreen,
|
---|
| 201 | G_cyScreen,
|
---|
| 202 | G_cxIcon,
|
---|
| 203 | G_cyIcon,
|
---|
| 204 | G_lcol3DDark,
|
---|
| 205 | G_lcol3DLight;
|
---|
| 206 |
|
---|
| 207 | VOID XWPENTRY winhInitGlobals(VOID);
|
---|
| 208 |
|
---|
[85] | 209 | ULONG XWPENTRY winhQueryWindowStyle(HWND hwnd);
|
---|
| 210 |
|
---|
[69] | 211 | BOOL XWPENTRY winhEnableDlgItem(HWND hwndDlg, SHORT id, BOOL fEnable);
|
---|
| 212 |
|
---|
| 213 | BOOL XWPENTRY winhIsDlgItemEnabled(HWND hwndDlg, SHORT id);
|
---|
| 214 |
|
---|
[235] | 215 | BOOL winhDestroyWindow(HWND *phwnd);
|
---|
| 216 |
|
---|
[69] | 217 | /* ******************************************************************
|
---|
| 218 | *
|
---|
[14] | 219 | * Menu helpers
|
---|
| 220 | *
|
---|
[7] | 221 | ********************************************************************/
|
---|
| 222 |
|
---|
[232] | 223 | // now including all this only with INCL_WINMENUS
|
---|
| 224 | // V1.0.1 (2002-11-30) [umoeller]
|
---|
[69] | 225 | #ifdef INCL_WINMENUS
|
---|
[232] | 226 |
|
---|
| 227 | #ifndef MM_QUERYITEMBYPOS16
|
---|
| 228 | #define MM_QUERYITEMBYPOS16 0x01f3
|
---|
| 229 | // this undocumented message is sent to retrieve the definition
|
---|
| 230 | // of a menu item by its position. This message will only query
|
---|
| 231 | // an item in the specified menu.
|
---|
| 232 | //
|
---|
| 233 | // Parameters:
|
---|
| 234 | // SHORT1FROMMP(mp1) = position of item in the menu
|
---|
| 235 | // SHORT2FROMMP(mp1) = reserved, set to 0
|
---|
| 236 | // mp2 = (16 bit pointer) points to a MENUITEM structure
|
---|
| 237 | // to be filled in.
|
---|
| 238 | #endif
|
---|
| 239 | #ifndef MAKE_16BIT_POINTER
|
---|
| 240 | #define MAKE_16BIT_POINTER(p) \
|
---|
| 241 | ((PVOID)MAKEULONG(LOUSHORT(p),(HIUSHORT(p) << 3) | 7))
|
---|
| 242 | // converts a flat 32bit pointer to its 16bit offset/selector form
|
---|
| 243 | #endif
|
---|
| 244 |
|
---|
| 245 | /*
|
---|
| 246 | * winhCreateEmptyMenu:
|
---|
| 247 | * this macro creates an empty menu, which can
|
---|
| 248 | * be used with winhInsertMenuItem etc. later.
|
---|
| 249 | * Useful for creating popup menus on the fly.
|
---|
| 250 | * Note that even though HWND_DESKTOP is specified
|
---|
| 251 | * here as both the parent and the owner, the
|
---|
| 252 | * actual owner and parent are specified later
|
---|
| 253 | * with WinPopupMenu.
|
---|
| 254 | */
|
---|
[7] | 255 |
|
---|
[232] | 256 | #define winhCreateEmptyMenu() \
|
---|
| 257 | WinCreateWindow(HWND_DESKTOP, WC_MENU, "", 0, 0, 0, 0, 0, \
|
---|
| 258 | HWND_DESKTOP, HWND_TOP, 0, 0, 0)
|
---|
[7] | 259 |
|
---|
[239] | 260 | BOOL XWPENTRY winhQueryMenuItem(HWND hwndMenu,
|
---|
| 261 | USHORT usItemID,
|
---|
| 262 | BOOL fSearchSubmenus,
|
---|
| 263 | PMENUITEM pmi);
|
---|
| 264 |
|
---|
| 265 | HWND XWPENTRY winhQuerySubmenu(HWND hMenu, SHORT sID);
|
---|
| 266 |
|
---|
[232] | 267 | SHORT XWPENTRY winhInsertMenuItem(HWND hwndMenu,
|
---|
| 268 | SHORT iPosition,
|
---|
| 269 | SHORT sItemId,
|
---|
| 270 | const char *pcszItemTitle,
|
---|
| 271 | SHORT afStyle,
|
---|
| 272 | SHORT afAttr);
|
---|
| 273 | typedef SHORT XWPENTRY WINHINSERTMENUITEM(HWND hwndMenu,
|
---|
| 274 | SHORT iPosition,
|
---|
| 275 | SHORT sItemId,
|
---|
| 276 | const char *pcszItemTitle,
|
---|
| 277 | SHORT afStyle,
|
---|
| 278 | SHORT afAttr);
|
---|
| 279 | typedef WINHINSERTMENUITEM *PWINHINSERTMENUITEM;
|
---|
[7] | 280 |
|
---|
[232] | 281 | HWND XWPENTRY winhInsertSubmenu(HWND hwndMenu,
|
---|
| 282 | ULONG iPosition,
|
---|
| 283 | SHORT sMenuId,
|
---|
| 284 | const char *pcszSubmenuTitle,
|
---|
| 285 | USHORT afMenuStyle,
|
---|
| 286 | SHORT sItemId,
|
---|
| 287 | const char *pcszItemTitle,
|
---|
| 288 | USHORT afItemStyle,
|
---|
| 289 | USHORT afAttribute);
|
---|
| 290 | typedef HWND XWPENTRY WINHINSERTSUBMENU(HWND hwndMenu,
|
---|
| 291 | ULONG iPosition,
|
---|
| 292 | SHORT sMenuId,
|
---|
| 293 | const char *pcszSubmenuTitle,
|
---|
| 294 | USHORT afMenuStyle,
|
---|
| 295 | SHORT sItemId,
|
---|
| 296 | const char *pcszItemTitle,
|
---|
| 297 | USHORT afItemStyle,
|
---|
| 298 | USHORT afAttribute);
|
---|
| 299 | typedef WINHINSERTSUBMENU *PWINHINSERTSUBMENU;
|
---|
[7] | 300 |
|
---|
[232] | 301 | BOOL XWPENTRY winhSetMenuCondCascade(HWND hwndMenu,
|
---|
| 302 | LONG lDefaultItem);
|
---|
[73] | 303 |
|
---|
[232] | 304 | /*
|
---|
| 305 | *@@ winhRemoveMenuItem:
|
---|
| 306 | * removes a menu item (SHORT) from the
|
---|
| 307 | * given menu (HWND). Returns the no. of
|
---|
| 308 | * remaining menu items (SHORT).
|
---|
| 309 | *
|
---|
| 310 | * This works for whole submenus too.
|
---|
| 311 | */
|
---|
[7] | 312 |
|
---|
[232] | 313 | #define winhRemoveMenuItem(hwndMenu, sItemID) \
|
---|
| 314 | SHORT1FROMMR(WinSendMsg(hwndMenu, MM_REMOVEITEM, MPFROM2SHORT(sItemID, FALSE), 0))
|
---|
[7] | 315 |
|
---|
[232] | 316 | BOOL XWPENTRY winhRemoveMenuItems(HWND hwndMenu,
|
---|
| 317 | const SHORT *asItemIDs,
|
---|
| 318 | ULONG cItemIDs);
|
---|
[206] | 319 |
|
---|
[232] | 320 | /*
|
---|
| 321 | *@@ winhDeleteMenuItem:
|
---|
| 322 | * deleted a menu item (SHORT) from the
|
---|
| 323 | * given menu (HWND). Returns the no. of
|
---|
| 324 | * remaining menu items (SHORT).
|
---|
| 325 | *
|
---|
| 326 | * As opposed to MM_REMOVEITEM, MM_DELETEITEM
|
---|
| 327 | * frees submenus and bitmaps also.
|
---|
| 328 | *
|
---|
| 329 | * This works for whole submenus too.
|
---|
| 330 | */
|
---|
[7] | 331 |
|
---|
[232] | 332 | #define winhDeleteMenuItem(hwndMenu, sItemId) \
|
---|
| 333 | (SHORT)WinSendMsg(hwndMenu, MM_DELETEITEM, MPFROM2SHORT(sItemId, FALSE), 0)
|
---|
[7] | 334 |
|
---|
[232] | 335 | SHORT XWPENTRY winhInsertMenuSeparator(HWND hMenu,
|
---|
| 336 | SHORT iPosition,
|
---|
| 337 | SHORT sId);
|
---|
[7] | 338 |
|
---|
[232] | 339 | #define COPYFL_STRIPTABS 0x0001
|
---|
[199] | 340 |
|
---|
[232] | 341 | BOOL XWPENTRY winhCopyMenuItem2(HWND hmenuTarget,
|
---|
| 342 | HWND hmenuSource,
|
---|
| 343 | USHORT usID,
|
---|
| 344 | SHORT sTargetPosition,
|
---|
| 345 | ULONG fl);
|
---|
[199] | 346 |
|
---|
[232] | 347 | BOOL XWPENTRY winhCopyMenuItem(HWND hmenuTarget,
|
---|
| 348 | HWND hmenuSource,
|
---|
| 349 | USHORT usID,
|
---|
| 350 | SHORT sTargetPosition);
|
---|
| 351 | typedef BOOL XWPENTRY WINHCOPYMENUITEM(HWND hmenuTarget,
|
---|
| 352 | HWND hmenuSource,
|
---|
| 353 | USHORT usID,
|
---|
| 354 | SHORT sTargetPosition);
|
---|
| 355 | typedef WINHCOPYMENUITEM *PWINHCOPYMENUITEM;
|
---|
[45] | 356 |
|
---|
[232] | 357 | HWND XWPENTRY winhMergeIntoSubMenu(HWND hmenuTarget,
|
---|
| 358 | SHORT sTargetPosition,
|
---|
| 359 | const char *pcszTitle,
|
---|
| 360 | SHORT sID,
|
---|
| 361 | HWND hmenuSource);
|
---|
| 362 | typedef HWND XWPENTRY WINHMERGEINTOSUBMENU(HWND hmenuTarget,
|
---|
| 363 | SHORT sTargetPosition,
|
---|
| 364 | const char *pcszTitle,
|
---|
| 365 | SHORT sID,
|
---|
| 366 | HWND hmenuSource);
|
---|
| 367 | typedef WINHMERGEINTOSUBMENU *PWINHMERGEINTOSUBMENU;
|
---|
[45] | 368 |
|
---|
[232] | 369 | ULONG XWPENTRY winhMergeMenus(HWND hmenuTarget,
|
---|
| 370 | SHORT sTargetPosition,
|
---|
| 371 | HWND hmenuSource,
|
---|
| 372 | ULONG fl);
|
---|
| 373 | typedef ULONG XWPENTRY WINHMERGEMENUS(HWND hmenuTarget,
|
---|
| 374 | SHORT sTargetPosition,
|
---|
| 375 | HWND hmenuSource,
|
---|
| 376 | ULONG fl);
|
---|
| 377 | typedef WINHMERGEMENUS *PWINHMERGEMENUS;
|
---|
[199] | 378 |
|
---|
[232] | 379 | ULONG XWPENTRY winhClearMenu(HWND hwndMenu);
|
---|
[218] | 380 |
|
---|
[232] | 381 | PSZ XWPENTRY winhQueryMenuItemText(HWND hwndMenu,
|
---|
| 382 | USHORT usItemID);
|
---|
[7] | 383 |
|
---|
[232] | 384 | BOOL XWPENTRY winhAppend2MenuItemText(HWND hwndMenu,
|
---|
| 385 | USHORT usItemID,
|
---|
| 386 | const char *pcszAppend,
|
---|
| 387 | BOOL fTab);
|
---|
[7] | 388 |
|
---|
[232] | 389 | VOID XWPENTRY winhMenuRemoveEllipse(HWND hwndMenu,
|
---|
| 390 | USHORT usItemId);
|
---|
[7] | 391 |
|
---|
[232] | 392 | SHORT XWPENTRY winhQueryItemUnderMouse(HWND hwndMenu, POINTL *pptlMouse, RECTL *prtlItem);
|
---|
[7] | 393 |
|
---|
[232] | 394 | #endif
|
---|
| 395 |
|
---|
[7] | 396 | /* ******************************************************************
|
---|
[14] | 397 | *
|
---|
| 398 | * Slider helpers
|
---|
| 399 | *
|
---|
[7] | 400 | ********************************************************************/
|
---|
| 401 |
|
---|
[14] | 402 | HWND XWPENTRY winhReplaceWithLinearSlider(HWND hwndParent,
|
---|
| 403 | HWND hwndOwner,
|
---|
| 404 | HWND hwndInsertAfter,
|
---|
| 405 | ULONG ulID,
|
---|
| 406 | ULONG ulSliderStyle,
|
---|
| 407 | ULONG ulTickCount);
|
---|
[7] | 408 |
|
---|
[84] | 409 | BOOL XWPENTRY winhSetSliderTicks(HWND hwndSlider,
|
---|
| 410 | MPARAM mpEveryOther1,
|
---|
| 411 | ULONG ulPixels1,
|
---|
| 412 | MPARAM mpEveryOther2,
|
---|
| 413 | ULONG ulPixels2);
|
---|
| 414 | typedef BOOL XWPENTRY WINHSETSLIDERTICKS(HWND hwndSlider,
|
---|
| 415 | MPARAM mpEveryOther1,
|
---|
| 416 | ULONG ulPixels1,
|
---|
| 417 | MPARAM mpEveryOther2,
|
---|
| 418 | ULONG ulPixels2);
|
---|
| 419 | typedef WINHSETSLIDERTICKS *PWINHSETSLIDERTICKS;
|
---|
[7] | 420 |
|
---|
| 421 | /*
|
---|
| 422 | * winhSetSliderArmPosition:
|
---|
| 423 | * this moves the slider arm in a given
|
---|
| 424 | * linear slider.
|
---|
| 425 | *
|
---|
| 426 | * usMode can be one of the following:
|
---|
| 427 | * -- SMA_RANGEVALUE: usOffset is in pixels
|
---|
| 428 | * from the slider's home position.
|
---|
| 429 | * -- SMA_INCREMENTVALUE: usOffset is in
|
---|
| 430 | * units of the slider's primary scale.
|
---|
| 431 | */
|
---|
| 432 |
|
---|
| 433 | #define winhSetSliderArmPosition(hwndSlider, usMode, usOffset) \
|
---|
| 434 | WinSendMsg(hwndSlider, SLM_SETSLIDERINFO, \
|
---|
| 435 | MPFROM2SHORT(SMA_SLIDERARMPOSITION, \
|
---|
| 436 | usMode), \
|
---|
| 437 | MPFROMSHORT(usOffset))
|
---|
| 438 |
|
---|
| 439 | /*
|
---|
| 440 | * winhQuerySliderArmPosition:
|
---|
| 441 | * reverse to the previous, this returns a
|
---|
| 442 | * slider arm position (as a LONG value).
|
---|
| 443 | */
|
---|
| 444 |
|
---|
| 445 | #define winhQuerySliderArmPosition(hwndSlider, usMode) \
|
---|
| 446 | (LONG)(WinSendMsg(hwndSlider, \
|
---|
| 447 | SLM_QUERYSLIDERINFO, \
|
---|
| 448 | MPFROM2SHORT(SMA_SLIDERARMPOSITION, \
|
---|
| 449 | usMode), \
|
---|
| 450 | 0))
|
---|
| 451 |
|
---|
[14] | 452 | HWND XWPENTRY winhReplaceWithCircularSlider(HWND hwndParent,
|
---|
| 453 | HWND hwndOwner,
|
---|
| 454 | HWND hwndInsertAfter,
|
---|
| 455 | ULONG ulID,
|
---|
| 456 | ULONG ulSliderStyle,
|
---|
| 457 | SHORT sMin,
|
---|
| 458 | SHORT sMax,
|
---|
| 459 | USHORT usIncrement,
|
---|
| 460 | USHORT usTicksEvery);
|
---|
[7] | 461 |
|
---|
| 462 | /* ******************************************************************
|
---|
[14] | 463 | *
|
---|
| 464 | * Spin button helpers
|
---|
| 465 | *
|
---|
[7] | 466 | ********************************************************************/
|
---|
| 467 |
|
---|
[14] | 468 | VOID XWPENTRY winhSetDlgItemSpinData(HWND hwndDlg,
|
---|
| 469 | ULONG idSpinButton,
|
---|
| 470 | ULONG min,
|
---|
| 471 | ULONG max,
|
---|
| 472 | ULONG current);
|
---|
[85] | 473 | typedef VOID XWPENTRY WINHSETDLGITEMSPINDATA(HWND hwndDlg,
|
---|
| 474 | ULONG idSpinButton,
|
---|
| 475 | ULONG min,
|
---|
| 476 | ULONG max,
|
---|
| 477 | ULONG current);
|
---|
| 478 | typedef WINHSETDLGITEMSPINDATA *PWINHSETDLGITEMSPINDATA;
|
---|
[7] | 479 |
|
---|
[14] | 480 | LONG XWPENTRY winhAdjustDlgItemSpinData(HWND hwndDlg,
|
---|
| 481 | USHORT usItemID,
|
---|
| 482 | LONG lGrid,
|
---|
| 483 | USHORT usNotifyCode);
|
---|
[85] | 484 | typedef LONG XWPENTRY WINHADJUSTDLGITEMSPINDATA(HWND hwndDlg,
|
---|
| 485 | USHORT usItemID,
|
---|
| 486 | LONG lGrid,
|
---|
| 487 | USHORT usNotifyCode);
|
---|
| 488 | typedef WINHADJUSTDLGITEMSPINDATA *PWINHADJUSTDLGITEMSPINDATA;
|
---|
[7] | 489 |
|
---|
| 490 | /* ******************************************************************
|
---|
[14] | 491 | *
|
---|
| 492 | * Entry field helpers
|
---|
| 493 | *
|
---|
[7] | 494 | ********************************************************************/
|
---|
| 495 |
|
---|
| 496 | /*
|
---|
| 497 | * winhSetEntryFieldLimit:
|
---|
| 498 | * sets the maximum length for the entry field
|
---|
| 499 | * (EM_SETTEXTLIMIT message).
|
---|
| 500 | *
|
---|
| 501 | * PMREF doesn't say this, but the limit does
|
---|
| 502 | * _not_ include the null-terminator. That is,
|
---|
| 503 | * if you specify "12" characters here, you can
|
---|
| 504 | * really enter 12 characters.
|
---|
| 505 | *
|
---|
| 506 | * The default length is 30 characters, I think.
|
---|
| 507 | */
|
---|
| 508 |
|
---|
| 509 | #define winhSetEntryFieldLimit(hwndEntryField, usLength) \
|
---|
| 510 | WinSendMsg(hwndEntryField, EM_SETTEXTLIMIT, (MPARAM)(usLength), (MPARAM)0)
|
---|
| 511 |
|
---|
| 512 | /*
|
---|
| 513 | *@@ winhEntryFieldSelectAll:
|
---|
| 514 | * this selects the entire text in the entry field.
|
---|
| 515 | * Useful when the thing gets the focus.
|
---|
| 516 | */
|
---|
| 517 |
|
---|
| 518 | #define winhEntryFieldSelectAll(hwndEntryField) \
|
---|
| 519 | WinSendMsg(hwndEntryField, EM_SETSEL, MPFROM2SHORT(0, 10000), MPNULL)
|
---|
| 520 |
|
---|
| 521 | /*
|
---|
| 522 | *@@ winhHasEntryFieldChanged:
|
---|
| 523 | * this queries whether the entry field's contents
|
---|
| 524 | * have changed (EM_QUERYCHANGED message).
|
---|
| 525 | *
|
---|
[265] | 526 | * This returns TRUE if changes have occurred since
|
---|
[7] | 527 | * the last time this message or WM_QUERYWINDOWPARAMS
|
---|
| 528 | * (WinQueryWindowText) was received.
|
---|
| 529 | */
|
---|
| 530 |
|
---|
| 531 | #define winhHasEntryFieldChanged(hwndEntryField) \
|
---|
| 532 | (BOOL)WinSendMsg(hwndEntryField, EM_QUERYCHANGED, (MPARAM)0, (MPARAM)0)
|
---|
| 533 |
|
---|
| 534 | /* ******************************************************************
|
---|
[14] | 535 | *
|
---|
| 536 | * List box helpers
|
---|
| 537 | *
|
---|
[7] | 538 | ********************************************************************/
|
---|
| 539 |
|
---|
[14] | 540 | /* The following macros are defined in the OS/2 headers for
|
---|
| 541 | list boxes:
|
---|
| 542 |
|
---|
| 543 | LONG WinQueryLboxCount(HWND hwndLbox);
|
---|
| 544 | // wrapper around LM_QUERYITEMCOUNT;
|
---|
| 545 | // list box item count
|
---|
| 546 |
|
---|
| 547 | SHORT WinQueryLboxItemTextLength(HWND hwndLbox,
|
---|
| 548 | SHORT index); // item index, starting from 0
|
---|
| 549 | // wrapper around LM_QUERYITEMTEXTLENGTH;
|
---|
| 550 | // returns length of item text, excluding NULL character
|
---|
| 551 |
|
---|
| 552 | LONG WinQueryLboxItemText(HWND hwndLbox,
|
---|
| 553 | SHORT index, // item index, starting from 0
|
---|
| 554 | PSZ psz, // buffer
|
---|
| 555 | PSZ cchMax); // size of buffer, incl. null
|
---|
| 556 | // wrapper around LM_QUERYITEMTEXT;
|
---|
| 557 | // returns length of item text, excluding NULL character
|
---|
| 558 |
|
---|
| 559 | BOOL WinSetLboxItemText(HWND hwndLbox,
|
---|
| 560 | LONG index,
|
---|
| 561 | PSZ psz);
|
---|
| 562 | // wrapper around LM_SETITEMTEXT
|
---|
| 563 |
|
---|
| 564 | LONG WinInsertLboxItem(HWND hwndLbox,
|
---|
| 565 | LONG index, // new item index, starting from 0
|
---|
| 566 | // or LIT_END
|
---|
| 567 | // or LIT_SORTASCENDING
|
---|
| 568 | // or LIT_SORTDESCENDING
|
---|
| 569 | PSZ psz)
|
---|
| 570 | // wrapper around LM_INSERTITEM;
|
---|
| 571 | // returns LIT_MEMERROR, LIT_ERROR, or zero-based index
|
---|
| 572 |
|
---|
| 573 | LONG WinDeleteLboxItem(HWND hwndLbox,
|
---|
| 574 | LONG index); // item index, starting from 0
|
---|
| 575 |
|
---|
| 576 | LONG WinQueryLboxSelectedItem(HWND hwndLbox);
|
---|
| 577 | // wrapper around LM_QUERYSELECTION;
|
---|
| 578 | // works with single selection only,
|
---|
| 579 | // use winhQueryLboxSelectedItem instead
|
---|
| 580 | */
|
---|
| 581 |
|
---|
[7] | 582 | /*
|
---|
[14] | 583 | * winhQueryLboxItemCount:
|
---|
[7] | 584 | * returns the no. of items in the listbox
|
---|
| 585 | * as a SHORT.
|
---|
| 586 | *
|
---|
[14] | 587 | *added V0.9.1 (99-12-14) [umoeller]
|
---|
[7] | 588 | */
|
---|
| 589 |
|
---|
[14] | 590 | // #define winhQueryLboxItemCount(hwndListBox)
|
---|
| 591 | // (SHORT)WinSendMsg(hwndListBox, LM_QUERYITEMCOUNT, 0, 0)
|
---|
[7] | 592 |
|
---|
[14] | 593 | // removed, use WinQueryLboxCount
|
---|
| 594 |
|
---|
[7] | 595 | /*
|
---|
| 596 | *@@ winhDeleteAllItems:
|
---|
| 597 | * deletes all list box items. Returns
|
---|
| 598 | * a BOOL.
|
---|
| 599 | *
|
---|
| 600 | *@@added V0.9.1 (99-12-14) [umoeller]
|
---|
| 601 | */
|
---|
| 602 |
|
---|
| 603 | #define winhDeleteAllItems(hwndListBox) \
|
---|
| 604 | (BOOL)WinSendMsg(hwndListBox, \
|
---|
| 605 | LM_DELETEALL, 0, 0)
|
---|
| 606 | /*
|
---|
| 607 | *@@ winhQueryLboxSelectedItem:
|
---|
| 608 | * this queries the next selected list box item.
|
---|
| 609 | * For the first call, set sItemStart to LIT_FIRST;
|
---|
| 610 | * then repeat the call with sItemStart set to
|
---|
| 611 | * the previous return value until this returns
|
---|
| 612 | * LIT_NONE.
|
---|
| 613 | *
|
---|
| 614 | * Example:
|
---|
| 615 | + SHORT sItemStart = LIT_FIRST;
|
---|
| 616 | + while (TRUE)
|
---|
| 617 | + {
|
---|
| 618 | + sItemStart = winhQueryLboxSelectedItem(hwndListBox,
|
---|
| 619 | + sItemStart)
|
---|
| 620 | + if (sItemStart == LIT_NONE)
|
---|
| 621 | + break;
|
---|
| 622 | + ...
|
---|
| 623 | + }
|
---|
| 624 | *
|
---|
| 625 | * To have the cursored item returned, use LIT_CURSOR.
|
---|
[14] | 626 | *
|
---|
| 627 | * For single selection, you can also use
|
---|
| 628 | * WinQueryLboxSelectedItem from the OS/2 PM headers.
|
---|
[7] | 629 | */
|
---|
| 630 |
|
---|
| 631 | #define winhQueryLboxSelectedItem(hwndListBox, sItemStart) \
|
---|
[127] | 632 | SHORT1FROMMR(WinSendMsg(hwndListBox, \
|
---|
[7] | 633 | LM_QUERYSELECTION, \
|
---|
| 634 | (MPARAM)(sItemStart), \
|
---|
| 635 | MPNULL))
|
---|
| 636 |
|
---|
| 637 | /*
|
---|
| 638 | *@@ winhSetLboxSelectedItem:
|
---|
| 639 | * selects a list box item.
|
---|
| 640 | * This works for both single-selection and
|
---|
| 641 | * multiple-selection listboxes.
|
---|
| 642 | * In single-selection listboxes, if an item
|
---|
| 643 | * is selected (fSelect == TRUE), the previous
|
---|
| 644 | * item is automatically deselected.
|
---|
| 645 | * Note that (BOOL)fSelect is ignored if
|
---|
| 646 | * sItemIndex == LIT_NONE.
|
---|
| 647 | */
|
---|
| 648 |
|
---|
| 649 | #define winhSetLboxSelectedItem(hwndListBox, sItemIndex, fSelect) \
|
---|
| 650 | (BOOL)(WinSendMsg(hwndListBox, \
|
---|
| 651 | LM_SELECTITEM, \
|
---|
| 652 | (MPARAM)(sItemIndex), \
|
---|
| 653 | (MPARAM)(fSelect)))
|
---|
| 654 |
|
---|
[14] | 655 | ULONG XWPENTRY winhLboxSelectAll(HWND hwndListBox, BOOL fSelect);
|
---|
[7] | 656 |
|
---|
| 657 | /*
|
---|
| 658 | * winhSetLboxItemHandle:
|
---|
| 659 | * sets the "item handle" for the specified sItemIndex.
|
---|
| 660 | * See LM_SETITEMHANDLE in PMREF for details.
|
---|
| 661 | */
|
---|
| 662 |
|
---|
| 663 | #define winhSetLboxItemHandle(hwndListBox, sItemIndex, ulHandle) \
|
---|
| 664 | (BOOL)(WinSendMsg(hwndListBox, LM_SETITEMHANDLE, \
|
---|
| 665 | (MPARAM)(sItemIndex), \
|
---|
| 666 | (MPARAM)ulHandle))
|
---|
| 667 |
|
---|
| 668 | /*
|
---|
| 669 | * winhQueryLboxItemHandle:
|
---|
| 670 | * the reverse to the previous. Returns a ULONG.
|
---|
| 671 | */
|
---|
| 672 |
|
---|
| 673 | #define winhQueryLboxItemHandle(hwndListBox, sItemIndex) \
|
---|
| 674 | (ULONG)WinSendMsg(hwndListBox, LM_QUERYITEMHANDLE, \
|
---|
| 675 | MPFROMSHORT(sItemIndex), (MPARAM)NULL)
|
---|
| 676 |
|
---|
[14] | 677 | PSZ XWPENTRY winhQueryLboxItemText(HWND hwndListbox, SHORT sIndex);
|
---|
[7] | 678 |
|
---|
[14] | 679 | BOOL XWPENTRY winhMoveLboxItem(HWND hwndSource,
|
---|
| 680 | SHORT sSourceIndex,
|
---|
| 681 | HWND hwndTarget,
|
---|
| 682 | SHORT sTargetIndex,
|
---|
| 683 | BOOL fSelectTarget);
|
---|
[7] | 684 |
|
---|
[71] | 685 | ULONG XWPENTRY winhLboxFindItemFromHandle(HWND hwndListBox,
|
---|
| 686 | ULONG ulHandle);
|
---|
| 687 |
|
---|
[7] | 688 | /* ******************************************************************
|
---|
[14] | 689 | *
|
---|
| 690 | * Scroll bar helpers
|
---|
| 691 | *
|
---|
[7] | 692 | ********************************************************************/
|
---|
| 693 |
|
---|
[14] | 694 | BOOL XWPENTRY winhUpdateScrollBar(HWND hwndScrollBar,
|
---|
| 695 | ULONG ulWinPels,
|
---|
| 696 | ULONG ulViewportPels,
|
---|
| 697 | ULONG ulCurUnitOfs,
|
---|
| 698 | BOOL fAutoHide);
|
---|
[7] | 699 |
|
---|
[243] | 700 | LONG XWPENTRY winhHandleScrollMsg(HWND hwndScrollBar,
|
---|
| 701 | PLONG plCurPelsOfs,
|
---|
| 702 | LONG lWindowPels,
|
---|
| 703 | LONG lWorkareaPels,
|
---|
| 704 | USHORT usLineStepPels,
|
---|
[14] | 705 | ULONG msg,
|
---|
| 706 | MPARAM mp2);
|
---|
[7] | 707 |
|
---|
[242] | 708 | BOOL XWPENTRY winhScrollWindow(HWND hwnd2Scroll,
|
---|
| 709 | PRECTL prclClip,
|
---|
| 710 | PPOINTL pptlScroll);
|
---|
| 711 |
|
---|
[14] | 712 | BOOL XWPENTRY winhProcessScrollChars(HWND hwndClient,
|
---|
| 713 | HWND hwndVScroll,
|
---|
| 714 | HWND hwndHScroll,
|
---|
| 715 | MPARAM mp1,
|
---|
| 716 | MPARAM mp2,
|
---|
| 717 | ULONG ulVertMax,
|
---|
| 718 | ULONG ulHorzMax);
|
---|
[7] | 719 |
|
---|
[243] | 720 | /*
|
---|
| 721 | *@@ SCROLLABLEWINDOW:
|
---|
| 722 | * scroll data struct for use with winhHandleScrollerMsgs.
|
---|
| 723 | *
|
---|
| 724 | *@@added V1.0.1 (2003-01-25) [umoeller]
|
---|
| 725 | */
|
---|
| 726 |
|
---|
| 727 | typedef struct _SCROLLABLEWINDOW
|
---|
| 728 | {
|
---|
| 729 | LONG cxScrollBar,
|
---|
| 730 | cyScrollBar;
|
---|
| 731 | HWND hwndVScroll, // vertical scroll bar
|
---|
| 732 | hwndHScroll; // horizontal scroll bar
|
---|
| 733 | ULONG idVScroll,
|
---|
| 734 | idHScroll;
|
---|
| 735 | SIZEL szlWorkarea; // workarea dimensions (over which window scrolls)
|
---|
| 736 | POINTL ptlScrollOfs; // current scroll offset; positive x means right,
|
---|
| 737 | // positive y means down
|
---|
| 738 | } SCROLLABLEWINDOW, *PSCROLLABLEWINDOW;
|
---|
| 739 |
|
---|
| 740 | #define ID_VSCROLL 100
|
---|
| 741 | #define ID_HSCROLL 101
|
---|
| 742 |
|
---|
| 743 | BOOL XWPENTRY winhCreateScroller(HWND hwndParent,
|
---|
| 744 | PSCROLLABLEWINDOW pscrw,
|
---|
| 745 | ULONG idVScroll,
|
---|
| 746 | ULONG idHScroll);
|
---|
| 747 |
|
---|
| 748 | MRESULT XWPENTRY winhHandleScrollerMsgs(HWND hwnd2Scroll,
|
---|
| 749 | PSCROLLABLEWINDOW pscrw,
|
---|
| 750 | PSIZEL pszlWin,
|
---|
| 751 | ULONG msg,
|
---|
| 752 | MPARAM mp1,
|
---|
| 753 | MPARAM mp2);
|
---|
| 754 |
|
---|
[7] | 755 | /* ******************************************************************
|
---|
[14] | 756 | *
|
---|
| 757 | * Window positioning helpers
|
---|
| 758 | *
|
---|
[7] | 759 | ********************************************************************/
|
---|
| 760 |
|
---|
[25] | 761 | BOOL XWPENTRY winhSaveWindowPos(HWND hwnd, HINI hIni, const char *pcszApp, const char *pcszKey);
|
---|
[7] | 762 |
|
---|
[25] | 763 | BOOL XWPENTRY winhRestoreWindowPos(HWND hwnd, HINI hIni, const char *pcszApp, const char *pcszKey, ULONG fl);
|
---|
[7] | 764 |
|
---|
[337] | 765 | // V1.0.6 (2006-10-28) [pr]
|
---|
[346] | 766 | // V1.0.7 (2006-12-16) [pr]: Named screen width/height parameters
|
---|
[337] | 767 |
|
---|
| 768 | /*
|
---|
| 769 | *@@ STOREPOS:
|
---|
| 770 | *
|
---|
| 771 | */
|
---|
| 772 |
|
---|
| 773 | #pragma pack(2)
|
---|
| 774 | typedef struct _STOREPOS
|
---|
| 775 | {
|
---|
| 776 | USHORT usMagic; // Always 0x7B6A (???)
|
---|
| 777 | ULONG ulFlags;
|
---|
| 778 | USHORT usXPos;
|
---|
| 779 | USHORT usYPos;
|
---|
| 780 | USHORT usWidth;
|
---|
| 781 | USHORT usHeight;
|
---|
| 782 | ULONG ulRes1; // Always 1 (???)
|
---|
| 783 | USHORT usRestoreXPos;
|
---|
| 784 | USHORT usRestoreYPos;
|
---|
| 785 | USHORT usRestoreWidth;
|
---|
| 786 | USHORT usRestoreHeight;
|
---|
| 787 | ULONG ulRes2; // Always 1 (???)
|
---|
| 788 | USHORT usMinXPos;
|
---|
| 789 | USHORT usMinYPos;
|
---|
[346] | 790 | ULONG ulScreenWidth;
|
---|
| 791 | ULONG ulScreenHeight;
|
---|
| 792 | ULONG ulRes3; // Always 0xFFFFFFFF (???)
|
---|
| 793 | ULONG ulRes4; // Always 0xFFFFFFFF (???)
|
---|
[337] | 794 | ULONG ulPPLen; // Presentation Parameters length
|
---|
| 795 | } STOREPOS, *PSTOREPOS;
|
---|
| 796 | #pragma pack()
|
---|
| 797 |
|
---|
| 798 | #pragma import(WinGetFrameTreePPSize, , "PMWIN", 972)
|
---|
| 799 | #pragma import(WinGetFrameTreePPs, , "PMWIN", 973)
|
---|
| 800 |
|
---|
| 801 | ULONG APIENTRY WinGetFrameTreePPSize(HWND hwnd);
|
---|
| 802 | ULONG APIENTRY WinGetFrameTreePPs(HWND hwnd, ULONG cchMax, PCH pch);
|
---|
| 803 |
|
---|
| 804 | BOOL XWPENTRY winhStoreWindowPos(HWND hwnd, HINI hIni, const char *pcszApp, const char *pcszKey);
|
---|
| 805 |
|
---|
[7] | 806 | #define XAC_MOVEX 0x0001
|
---|
| 807 | #define XAC_MOVEY 0x0002
|
---|
| 808 | #define XAC_SIZEX 0x0004
|
---|
| 809 | #define XAC_SIZEY 0x0008
|
---|
| 810 |
|
---|
| 811 | /*
|
---|
| 812 | *@@ XADJUSTCTRLS:
|
---|
| 813 | *
|
---|
| 814 | */
|
---|
| 815 |
|
---|
| 816 | typedef struct _XADJUSTCTRLS
|
---|
| 817 | {
|
---|
| 818 | BOOL fInitialized;
|
---|
| 819 | SWP swpMain; // SWP for main window
|
---|
| 820 | SWP *paswp; // pointer to array of control SWP structs
|
---|
| 821 | } XADJUSTCTRLS, *PXADJUSTCTRLS;
|
---|
| 822 |
|
---|
[14] | 823 | BOOL XWPENTRY winhAdjustControls(HWND hwndDlg,
|
---|
[147] | 824 | const MPARAM *pmpFlags,
|
---|
[14] | 825 | ULONG ulCount,
|
---|
| 826 | PSWP pswpNew,
|
---|
| 827 | PXADJUSTCTRLS pxac);
|
---|
[7] | 828 |
|
---|
[14] | 829 | void XWPENTRY winhCenterWindow(HWND hwnd);
|
---|
| 830 | typedef void XWPENTRY WINHCENTERWINDOW(HWND hwnd);
|
---|
| 831 | typedef WINHCENTERWINDOW *PWINHCENTERWINDOW;
|
---|
[7] | 832 |
|
---|
[155] | 833 | #define PLF_SMART 0x0001
|
---|
| 834 |
|
---|
| 835 | BOOL winhPlaceBesides(HWND hwnd,
|
---|
| 836 | HWND hwndRelative,
|
---|
| 837 | ULONG fl);
|
---|
| 838 |
|
---|
[14] | 839 | HWND XWPENTRY winhFindWindowBelow(HWND hwndFind);
|
---|
| 840 |
|
---|
[7] | 841 | /* ******************************************************************
|
---|
[14] | 842 | *
|
---|
| 843 | * Presparams helpers
|
---|
| 844 | *
|
---|
[7] | 845 | ********************************************************************/
|
---|
| 846 |
|
---|
[14] | 847 | PSZ XWPENTRY winhQueryWindowFont(HWND hwnd);
|
---|
| 848 | typedef PSZ XWPENTRY WINHQUERYWINDOWFONT(HWND hwnd);
|
---|
| 849 | typedef WINHQUERYWINDOWFONT *PWINHQUERYWINDOWFONT;
|
---|
[7] | 850 |
|
---|
[232] | 851 | PCSZ XWPENTRY winhQueryDefaultFont(VOID);
|
---|
| 852 |
|
---|
[239] | 853 | PSZ XWPENTRY winhQueryMenuSysFont(VOID);
|
---|
| 854 |
|
---|
[14] | 855 | BOOL XWPENTRY winhSetWindowFont(HWND hwnd, const char *pcszFont);
|
---|
| 856 | typedef BOOL XWPENTRY WINHSETWINDOWFONT(HWND hwnd, const char *pcszFont);
|
---|
| 857 | typedef WINHSETWINDOWFONT *PWINHSETWINDOWFONT;
|
---|
[7] | 858 |
|
---|
| 859 | /*
|
---|
| 860 | *@@ winhSetDlgItemFont:
|
---|
| 861 | * invokes winhSetWindowFont on a dialog
|
---|
| 862 | * item.
|
---|
| 863 | *
|
---|
| 864 | * Returns TRUE if successful or FALSE otherwise.
|
---|
| 865 | *
|
---|
| 866 | *@@added V0.9.0
|
---|
| 867 | */
|
---|
| 868 |
|
---|
| 869 | #define winhSetDlgItemFont(hwnd, usId, pszFont) \
|
---|
| 870 | (winhSetWindowFont(WinWindowFromID(hwnd, usId), pszFont))
|
---|
| 871 |
|
---|
[14] | 872 | ULONG XWPENTRY winhSetControlsFont(HWND hwndDlg, SHORT usIDMin, SHORT usIDMax, const char *pcszFont);
|
---|
[7] | 873 |
|
---|
| 874 | #ifdef INCL_WINSYS
|
---|
[14] | 875 | BOOL XWPENTRY winhStorePresParam(PPRESPARAMS *pppp,
|
---|
| 876 | ULONG ulAttrType,
|
---|
| 877 | ULONG cbData,
|
---|
| 878 | PVOID pData);
|
---|
[232] | 879 |
|
---|
| 880 | PPRESPARAMS XWPENTRY winhCreateDefaultPresparams(VOID);
|
---|
[7] | 881 | #endif
|
---|
| 882 |
|
---|
[14] | 883 | LONG XWPENTRY winhQueryPresColor(HWND hwnd, ULONG ulPP, BOOL fInherit, LONG lSysColor);
|
---|
| 884 | typedef LONG XWPENTRY WINHQUERYPRESCOLOR(HWND hwnd, ULONG ulPP, BOOL fInherit, LONG lSysColor);
|
---|
| 885 | typedef WINHQUERYPRESCOLOR *PWINHQUERYPRESCOLOR;
|
---|
[7] | 886 |
|
---|
[195] | 887 | LONG XWPENTRY winhQueryPresColor2(HWND hwnd,
|
---|
| 888 | ULONG ulppRGB,
|
---|
| 889 | ULONG ulppIndex,
|
---|
| 890 | BOOL fInherit,
|
---|
| 891 | LONG lSysColor);
|
---|
| 892 |
|
---|
[111] | 893 | BOOL XWPENTRY winhSetPresColor(HWND hwnd, ULONG ulIndex, LONG lColor);
|
---|
[354] | 894 | // XWP V1.0.8 (2007-05-08) [pr]
|
---|
| 895 | typedef BOOL XWPENTRY WINHSETPRESCOLOR(HWND hwnd, ULONG ulIndex, LONG lColor);
|
---|
| 896 | typedef WINHSETPRESCOLOR *PWINHSETPRESCOLOR;
|
---|
[111] | 897 |
|
---|
[7] | 898 | /* ******************************************************************
|
---|
[14] | 899 | *
|
---|
| 900 | * Help instance helpers
|
---|
| 901 | *
|
---|
[7] | 902 | ********************************************************************/
|
---|
| 903 |
|
---|
| 904 | #ifdef INCL_WINHELP
|
---|
[14] | 905 | HWND XWPENTRY winhCreateHelp(HWND hwndFrame,
|
---|
[25] | 906 | const char *pcszFileName,
|
---|
[14] | 907 | HMODULE hmod,
|
---|
| 908 | PHELPTABLE pHelpTable,
|
---|
[25] | 909 | const char *pcszWindowTitle);
|
---|
[7] | 910 |
|
---|
[31] | 911 | ULONG winhDisplayHelpPanel(HWND hwndHelpInstance,
|
---|
| 912 | ULONG ulHelpPanel);
|
---|
| 913 |
|
---|
[14] | 914 | void XWPENTRY winhDestroyHelp(HWND hwndHelp, HWND hwndFrame);
|
---|
[7] | 915 | #endif
|
---|
| 916 |
|
---|
| 917 | /* ******************************************************************
|
---|
| 918 | *
|
---|
| 919 | * Application control
|
---|
| 920 | *
|
---|
| 921 | ********************************************************************/
|
---|
| 922 |
|
---|
[25] | 923 | BOOL XWPENTRY winhAnotherInstance(const char *pcszSemName, BOOL fSwitch);
|
---|
[7] | 924 |
|
---|
[14] | 925 | HSWITCH XWPENTRY winhAddToTasklist(HWND hwnd, HPOINTER hIcon);
|
---|
[7] | 926 |
|
---|
[243] | 927 | BOOL XWPENTRY winhUpdateTasklist(HWND hwnd, PCSZ pcszNewTitle);
|
---|
| 928 |
|
---|
[7] | 929 | /* ******************************************************************
|
---|
[14] | 930 | *
|
---|
| 931 | * Miscellaneous
|
---|
| 932 | *
|
---|
[7] | 933 | ********************************************************************/
|
---|
| 934 |
|
---|
[14] | 935 | VOID XWPENTRY winhFree(PVOID p);
|
---|
| 936 | typedef VOID XWPENTRY WINHFREE(PVOID p);
|
---|
| 937 | typedef WINHFREE *PWINHFREE;
|
---|
[7] | 938 |
|
---|
[232] | 939 | /*
|
---|
| 940 | *@@ winhMyAnchorBlock:
|
---|
| 941 | * returns the HAB of the current thread.
|
---|
| 942 | *
|
---|
| 943 | * Many Win* functions require an HAB to be
|
---|
| 944 | * passed in. While many of them will work
|
---|
| 945 | * when passing in NULLHANDLE, some (such as
|
---|
| 946 | * WinGetMsg) won't. If you don't know the
|
---|
| 947 | * anchor block of the calling thread, use
|
---|
| 948 | * this function.
|
---|
| 949 | *
|
---|
| 950 | * The HAB is simply a LONG whose hiword has
|
---|
| 951 | * the current PID and the lowword has the
|
---|
| 952 | * current TID. The previous function that
|
---|
| 953 | * created a temporary window to figure this
|
---|
| 954 | * out has been replaced with this macro, since
|
---|
| 955 | * WinQueryAnchorBlock(HWND_DESKTOP) yields the
|
---|
| 956 | * same result.
|
---|
| 957 | *
|
---|
| 958 | *@@added V1.0.1 (2002-11-30) [umoeller]
|
---|
| 959 | */
|
---|
| 960 |
|
---|
| 961 | #define winhMyAnchorBlock() WinQueryAnchorBlock(HWND_DESKTOP)
|
---|
| 962 |
|
---|
| 963 | /*
|
---|
[62] | 964 | HAB XWPENTRY winhMyAnchorBlock(VOID);
|
---|
| 965 | typedef HAB XWPENTRY WINHMYANCHORBLOCK(VOID);
|
---|
| 966 | typedef WINHMYANCHORBLOCK *PWINHMYANCHORBLOCK;
|
---|
[232] | 967 | */
|
---|
[62] | 968 |
|
---|
[46] | 969 | VOID XWPENTRY winhSleep(ULONG ulSleep);
|
---|
[14] | 970 |
|
---|
[7] | 971 | #define WINH_FOD_SAVEDLG 0x0001
|
---|
| 972 | #define WINH_FOD_INILOADDIR 0x0010
|
---|
| 973 | #define WINH_FOD_INISAVEDIR 0x0020
|
---|
| 974 |
|
---|
[14] | 975 | BOOL XWPENTRY winhFileDlg(HWND hwndOwner,
|
---|
| 976 | PSZ pszFile,
|
---|
| 977 | ULONG flFlags,
|
---|
| 978 | HINI hini,
|
---|
[25] | 979 | const char *pcszApplication,
|
---|
| 980 | const char *pcszKey);
|
---|
[7] | 981 |
|
---|
[232] | 982 | HPOINTER XWPENTRY winhQueryWaitPointer(VOID);
|
---|
| 983 |
|
---|
[14] | 984 | HPOINTER XWPENTRY winhSetWaitPointer(VOID);
|
---|
[7] | 985 |
|
---|
[239] | 986 | PSZ XWPENTRY winhQueryWindowText2(HWND hwnd,
|
---|
| 987 | PULONG pulExtra);
|
---|
| 988 |
|
---|
[14] | 989 | PSZ XWPENTRY winhQueryWindowText(HWND hwnd);
|
---|
[7] | 990 |
|
---|
[108] | 991 | BOOL XWPENTRY winhSetWindowText(HWND hwnd,
|
---|
| 992 | const char *pcszFormat,
|
---|
| 993 | ...);
|
---|
| 994 |
|
---|
[239] | 995 | PSZ XWPENTRY winhQueryDlgItemText2(HWND hwnd,
|
---|
| 996 | USHORT usItemID,
|
---|
| 997 | PULONG pulExtra);
|
---|
| 998 |
|
---|
[7] | 999 | /*
|
---|
| 1000 | *@@ winhQueryDlgItemText:
|
---|
| 1001 | * like winhQueryWindowText, but for the dialog item
|
---|
| 1002 | * in hwnd which has the ID usItemID.
|
---|
[239] | 1003 | *
|
---|
| 1004 | *@@changed V1.0.1 (2003-01-05) [umoeller]: now using winhQueryDlgItemText2
|
---|
[7] | 1005 | */
|
---|
| 1006 |
|
---|
[239] | 1007 | #define winhQueryDlgItemText(hwnd, usItemID) winhQueryDlgItemText2(hwnd, usItemID, NULL)
|
---|
[7] | 1008 |
|
---|
[239] | 1009 | BOOL XWPENTRY winhAppendWindowEllipseText(HWND hwnd);
|
---|
| 1010 |
|
---|
| 1011 | BOOL XWPENTRY winhAppendDlgItemEllipseText(HWND hwnd,
|
---|
| 1012 | USHORT usItemID);
|
---|
| 1013 |
|
---|
[14] | 1014 | BOOL XWPENTRY winhReplaceWindowText(HWND hwnd,
|
---|
[25] | 1015 | const char *pcszSearch,
|
---|
| 1016 | const char *pcszReplaceWith);
|
---|
[7] | 1017 |
|
---|
[14] | 1018 | ULONG XWPENTRY winhCenteredDlgBox(HWND hwndParent, HWND hwndOwner,
|
---|
[7] | 1019 | PFNWP pfnDlgProc, HMODULE hmod, ULONG idDlg, PVOID pCreateParams);
|
---|
[14] | 1020 | typedef ULONG XWPENTRY WINHCENTEREDDLGBOX(HWND hwndParent, HWND hwndOwner,
|
---|
| 1021 | PFNWP pfnDlgProc, HMODULE hmod, ULONG idDlg, PVOID pCreateParams);
|
---|
| 1022 | typedef WINHCENTEREDDLGBOX *PWINHCENTEREDDLGBOX;
|
---|
[7] | 1023 |
|
---|
[14] | 1024 | ULONG XWPENTRY winhEnableControls(HWND hwndDlg,
|
---|
| 1025 | USHORT usIDFirst,
|
---|
| 1026 | USHORT usIDLast,
|
---|
| 1027 | BOOL fEnable);
|
---|
[7] | 1028 |
|
---|
[166] | 1029 | ULONG winhEnableControls2(HWND hwndDlg,
|
---|
| 1030 | const ULONG *paulIDs,
|
---|
| 1031 | ULONG cIDs,
|
---|
| 1032 | BOOL fEnable);
|
---|
| 1033 |
|
---|
[14] | 1034 | HWND XWPENTRY winhCreateStdWindow(HWND hwndFrameParent,
|
---|
| 1035 | PSWP pswpFrame,
|
---|
| 1036 | ULONG flFrameCreateFlags,
|
---|
| 1037 | ULONG ulFrameStyle,
|
---|
[25] | 1038 | const char *pcszFrameTitle,
|
---|
[14] | 1039 | ULONG ulResourcesID,
|
---|
[25] | 1040 | const char *pcszClassClient,
|
---|
[14] | 1041 | ULONG flStyleClient,
|
---|
| 1042 | ULONG ulID,
|
---|
| 1043 | PVOID pClientCtlData,
|
---|
| 1044 | PHWND phwndClient);
|
---|
[7] | 1045 |
|
---|
[48] | 1046 | HWND XWPENTRY winhCreateObjectWindow(const char *pcszWindowClass,
|
---|
| 1047 | PVOID pvCreateParam);
|
---|
[7] | 1048 |
|
---|
[216] | 1049 | HWND XWPENTRY winhCreateControl(HWND hwndParent,
|
---|
| 1050 | HWND hwndOwner,
|
---|
[48] | 1051 | const char *pcszClass,
|
---|
| 1052 | const char *pcszText,
|
---|
| 1053 | ULONG ulStyle,
|
---|
| 1054 | ULONG ulID);
|
---|
| 1055 |
|
---|
[242] | 1056 | BOOL XWPENTRY winhSetParentAndOwner(HWND hwnd,
|
---|
| 1057 | HWND hwndNewParent,
|
---|
| 1058 | BOOL fRedraw);
|
---|
| 1059 |
|
---|
[14] | 1060 | VOID XWPENTRY winhRepaintWindows(HWND hwndParent);
|
---|
[7] | 1061 |
|
---|
[14] | 1062 | HMQ XWPENTRY winhFindMsgQueue(PID pid, TID tid, HAB* phab);
|
---|
[7] | 1063 |
|
---|
[14] | 1064 | VOID XWPENTRY winhFindPMErrorWindows(HWND *phwndHardError, HWND *phwndSysError);
|
---|
[7] | 1065 |
|
---|
[14] | 1066 | HWND XWPENTRY winhCreateFakeDesktop(HWND hwndSibling);
|
---|
[7] | 1067 |
|
---|
[215] | 1068 | // Warp 4 notebook button style
|
---|
| 1069 | #ifndef BS_NOTEBOOKBUTTON
|
---|
| 1070 | #define BS_NOTEBOOKBUTTON 8L
|
---|
| 1071 | #endif
|
---|
| 1072 |
|
---|
[14] | 1073 | BOOL XWPENTRY winhAssertWarp4Notebook(HWND hwndDlg,
|
---|
[159] | 1074 | USHORT usIdThreshold);
|
---|
[7] | 1075 |
|
---|
[25] | 1076 | ULONG XWPENTRY winhDrawFormattedText(HPS hps, PRECTL prcl, const char *pcszText, ULONG flCmd);
|
---|
[7] | 1077 |
|
---|
[14] | 1078 | #ifdef INCL_WINSWITCHLIST
|
---|
| 1079 | PSWBLOCK XWPENTRY winhQuerySwitchList(HAB hab);
|
---|
| 1080 | typedef PSWBLOCK XWPENTRY WINHQUERYSWITCHLIST(HAB hab);
|
---|
| 1081 | typedef WINHQUERYSWITCHLIST *PWINHQUERYSWITCHLIST;
|
---|
[156] | 1082 |
|
---|
| 1083 | HSWITCH XWPENTRY winhHSWITCHfromHAPP(HAPP happ);
|
---|
[14] | 1084 | #endif
|
---|
[7] | 1085 |
|
---|
[14] | 1086 | HWND XWPENTRY winhQueryTasklistWindow(VOID);
|
---|
| 1087 | typedef HWND XWPENTRY WINHQUERYTASKLISTWINDOW(VOID);
|
---|
| 1088 | typedef WINHQUERYTASKLISTWINDOW *PWINHQUERYTASKLISTWINDOW;
|
---|
[7] | 1089 |
|
---|
[14] | 1090 | VOID XWPENTRY winhKillTasklist(VOID);
|
---|
[7] | 1091 |
|
---|
[14] | 1092 | ULONG XWPENTRY winhQueryPendingSpoolJobs(VOID);
|
---|
| 1093 |
|
---|
| 1094 | VOID XWPENTRY winhSetNumLock(BOOL fState);
|
---|
| 1095 |
|
---|
[217] | 1096 | BOOL XWPENTRY winhSetClipboardText(HAB hab,
|
---|
| 1097 | PCSZ pcsz,
|
---|
| 1098 | ULONG cbSize);
|
---|
| 1099 |
|
---|
[7] | 1100 | /* ******************************************************************
|
---|
[14] | 1101 | *
|
---|
| 1102 | * WPS Class List helpers
|
---|
| 1103 | *
|
---|
[7] | 1104 | ********************************************************************/
|
---|
| 1105 |
|
---|
[14] | 1106 | PBYTE XWPENTRY winhQueryWPSClassList(VOID);
|
---|
[7] | 1107 |
|
---|
[14] | 1108 | PBYTE XWPENTRY winhQueryWPSClass(PBYTE pObjClass, const char *pszClass);
|
---|
[7] | 1109 |
|
---|
[14] | 1110 | APIRET XWPENTRY winhRegisterClass(const char* pcszClassName,
|
---|
| 1111 | const char* pcszModule,
|
---|
| 1112 | PSZ pszBuf,
|
---|
| 1113 | ULONG cbBuf);
|
---|
[7] | 1114 |
|
---|
[14] | 1115 | BOOL XWPENTRY winhIsClassRegistered(const char *pcszClass);
|
---|
[7] | 1116 |
|
---|
[276] | 1117 | extern BOOL32 APIENTRY WinRestartWorkplace(void);
|
---|
| 1118 |
|
---|
[14] | 1119 | ULONG XWPENTRY winhResetWPS(HAB hab);
|
---|
[69] | 1120 |
|
---|
[7] | 1121 | #endif
|
---|
| 1122 |
|
---|
| 1123 | #if __cplusplus
|
---|
| 1124 | }
|
---|
| 1125 | #endif
|
---|
| 1126 |
|
---|