00223 {
00224
UINT code;
00225
PWND pwndFirstFound =
NULL;
00226
int count = 0;
00227
TL tlpwnd;
00228
PWND pwndT;
00229 HWND hwnd;
00230
00231
CheckLock(pwndDlg);
00232
CheckLock(pwnd);
00233
00234
ThreadLock(pwnd, &tlpwnd);
00235
00236
00237
00238
00239
while (count < 256 * 2) {
00240
00241
00242
00243
00244
if ((pwnd =
xxxGNM_FindNextMnem(pwndDlg, pwnd, ch)) ==
NULL) {
00245
ThreadUnlock(&tlpwnd);
00246
return NULL;
00247 }
00248 hwnd =
HWq(pwnd);
00249
00250
ThreadUnlock(&tlpwnd);
00251
ThreadLock(pwnd, &tlpwnd);
00252
00253 code = (
UINT)
SendMessage(hwnd, WM_GETDLGCODE, 0, 0L);
00254
00255
00256
00257
00258
if (code & DLGC_STATIC && !
TestWF(pwnd, WFDISABLED)) {
00259 pwndT =
_GetNextDlgTabItem(pwndDlg, pwnd, FALSE);
00260
00261
00262
00263
00264
if (pwndT ==
NULL)
00265
continue;
00266 pwnd = pwndT;
00267 hwnd =
HWq(pwnd);
00268
00269
ThreadUnlock(&tlpwnd);
00270
ThreadLock(pwnd, &tlpwnd);
00271
00272
00273
00274
00275
00276
00277
00278 code = (
UINT)
SendMessage(hwnd, WM_GETDLGCODE, 0, 0L);
00279 }
00280
00281
if (!
TestWF(pwnd, WFDISABLED)) {
00282
00283
00284
00285
00286
if (!(code & DLGC_BUTTON)) {
00287
00288
00289
00290
00291
DlgSetFocus(hwnd);
00292 }
else {
00293
00294
00295
00296
00297
if ((code & DLGC_DEFPUSHBUTTON) || (code & DLGC_UNDEFPUSHBUTTON)) {
00298
00299
00300
00301
00302
SendMessage(hwnd, BM_SETSTATE, TRUE, 0L);
00303
00304
00305
00306
00307
#ifdef LATER
00308
00309
00310
for (i = 0; i < 10000; i++)
00311 ;
00312
#else
00313
Sleep(1);
00314
#endif
00315
00316
00317
00318
00319
SendMessage(hwnd, BM_SETSTATE, FALSE, 0L);
00320
00321
00322
00323
00324 pwndT =
REBASEPWND(pwnd, spwndParent);
00325
SendMessage(
HW(pwndT), WM_COMMAND,
00326 MAKELONG(
PTR_TO_ID(pwnd->
spmenu), BN_CLICKED), (LPARAM)hwnd);
00327
ThreadUnlock(&tlpwnd);
00328
return (
PWND)1;
00329 }
else {
00330
00331
00332
00333
00334
00335
00336
00337
BOOL fIsNTButton;
00338
PBUTN pbutn;
00339
00340 fIsNTButton = (pwnd->fnid ==
FNID_BUTTON);
00341
if (fIsNTButton) {
00342 pbutn = ((
PBUTNWND)pwnd)->pbutn;
00343
BUTTONSTATE(pbutn) |=
BST_DONTCLICK;
00344 }
else {
00345 RIPMSG0(RIP_WARNING,
"xxxGotoNextMnem: fnid != FNID_BUTTON");
00346 }
00347
00348
DlgSetFocus(hwnd);
00349
00350
if (fIsNTButton) {
00351
BUTTONSTATE(pbutn) &= ~
BST_DONTCLICK;
00352 }
00353
00354
00355
00356
00357
if (
xxxGNM_FindNextMnem(pwndDlg, pwnd, ch) == pwnd) {
00358
SendMessage(hwnd, BM_CLICK, TRUE, 0L);
00359 }
00360 }
00361 }
00362
00363
ThreadUnlock(&tlpwnd);
00364
return pwnd;
00365 }
else {
00366
00367
00368
00369
00370
if (pwnd == pwndFirstFound) {
00371
ThreadUnlock(&tlpwnd);
00372
return NULL;
00373 }
00374
00375
if (pwndFirstFound ==
NULL)
00376 pwndFirstFound = pwnd;
00377 }
00378
00379 count++;
00380
00381 }
00382
00383
ThreadUnlock(&tlpwnd);
00384
return NULL;
00385 }