00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
#include "precomp.h"
00012
#pragma hdrstop
00013
00014 #define SfnDDEINIT SfnDWORD
00015 #define SfnKERNELONLY SfnDWORD
00016
00017
#ifdef FE_SB
00018
00019
00020
00021
#define SfnEMGETSEL SfnOPTOUTLPDWORDOPTOUTLPDWORD
00022
#define SfnEMSETSEL SfnDWORD
00023
#define SfnCBGETEDITSEL SfnOPTOUTLPDWORDOPTOUTLPDWORD
00024
#endif // FE_SB
00025
00026 #define MSGFN(func) Sfn ## func
00027 #define FNSCSENDMESSAGE SFNSCSENDMESSAGE
00028
#include <messages.h>
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 LRESULT
SfnINLBOXSTRING(
00040
PWND pwnd,
00041 UINT msg,
00042 WPARAM wParam,
00043 LPARAM lParam,
00044 ULONG_PTR xParam,
00045 PROC xpfn,
00046 DWORD dwSCMSFlags,
00047 PSMS psms)
00048 {
00049
DWORD dw;
00050
00051
00052
00053
00054
00055
if (!
RevalidateHwnd(
HW(pwnd))) {
00056
return 0
L;
00057 }
00058 dw = pwnd->style;
00059
00060
if (!(dw & LBS_HASSTRINGS) &&
00061 (dw & (LBS_OWNERDRAWFIXED | LBS_OWNERDRAWVARIABLE))) {
00062
00063
00064
00065
00066
return SfnDWORD(pwnd,
msg, wParam, lParam, xParam, xpfn, dwSCMSFlags, psms);
00067 }
00068
00069
00070
00071
00072
00073
00074
switch (
msg) {
00075
default:
00076
return SfnINSTRING(pwnd,
msg, wParam, lParam, xParam, xpfn, dwSCMSFlags, psms);
00077
break;
00078
00079
case LB_FINDSTRING:
00080
return SfnINSTRINGNULL(pwnd,
msg, wParam, lParam, xParam, xpfn, dwSCMSFlags, psms);
00081
break;
00082 }
00083 }
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095 LRESULT
SfnOUTLBOXSTRING(
00096
PWND pwnd,
00097 UINT msg,
00098 WPARAM wParam,
00099 LPARAM lParam,
00100 ULONG_PTR xParam,
00101 PROC xpfn,
00102 DWORD dwSCMSFlags,
00103 PSMS psms)
00104 {
00105
DWORD dw;
00106
BOOL bNotString;
00107
DWORD dwRet;
00108
TL tlpwnd;
00109
00110
00111
00112
00113
00114
if (!
RevalidateHwnd(
HW(pwnd))) {
00115
return 0
L;
00116 }
00117 dw = pwnd->style;
00118
00119
00120
00121
00122
00123 bNotString = (!(dw & LBS_HASSTRINGS) &&
00124 (dw & (LBS_OWNERDRAWFIXED | LBS_OWNERDRAWVARIABLE)));
00125
00126
00127
00128
00129
ThreadLock(pwnd, &tlpwnd);
00130 dwRet =
ClientGetListboxString(pwnd,
msg, wParam,
00131 (
PLARGE_UNICODE_STRING)lParam,
00132 xParam, xpfn, dwSCMSFlags, bNotString, psms);
00133
ThreadUnlock(&tlpwnd);
00134
return dwRet;
00135 }
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147 LRESULT
SfnINCBOXSTRING(
00148
PWND pwnd,
00149 UINT msg,
00150 WPARAM wParam,
00151 LPARAM lParam,
00152 ULONG_PTR xParam,
00153 PROC xpfn,
00154 DWORD dwSCMSFlags,
00155 PSMS psms)
00156 {
00157
DWORD dw;
00158
00159
00160
00161
00162
00163
if (!
RevalidateHwnd(
HW(pwnd))) {
00164
return 0
L;
00165 }
00166 dw = pwnd->style;
00167
00168
if (!(dw & CBS_HASSTRINGS) &&
00169 (dw & (CBS_OWNERDRAWFIXED | CBS_OWNERDRAWVARIABLE))) {
00170
00171
00172
00173
00174
return SfnDWORD(pwnd,
msg, wParam, lParam, xParam, xpfn, dwSCMSFlags, psms);
00175 }
00176
00177
00178
00179
00180
00181
00182
switch (
msg) {
00183
default:
00184
return SfnINSTRING(pwnd,
msg, wParam, lParam, xParam, xpfn, dwSCMSFlags, psms);
00185
break;
00186
00187
case CB_FINDSTRING:
00188
return SfnINSTRINGNULL(pwnd,
msg, wParam, lParam, xParam, xpfn, dwSCMSFlags, psms);
00189
break;
00190 }
00191 }
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203 LRESULT
SfnOUTCBOXSTRING(
00204
PWND pwnd,
00205 UINT msg,
00206 WPARAM wParam,
00207 LPARAM lParam,
00208 ULONG_PTR xParam,
00209 PROC xpfn,
00210 DWORD dwSCMSFlags,
00211 PSMS psms)
00212 {
00213
DWORD dw;
00214
BOOL bNotString;
00215
DWORD dwRet;
00216
TL tlpwnd;
00217
00218
00219
00220
00221
00222
00223
if (!
RevalidateHwnd(
HW(pwnd))) {
00224
return 0
L;
00225 }
00226 dw = pwnd->style;
00227
00228 bNotString = (!(dw & CBS_HASSTRINGS) &&
00229 (dw & (CBS_OWNERDRAWFIXED | CBS_OWNERDRAWVARIABLE)));
00230
00231
00232
00233
00234
ThreadLock(pwnd, &tlpwnd);
00235 dwRet =
ClientGetListboxString(pwnd,
msg, wParam,
00236 (
PLARGE_UNICODE_STRING)lParam,
00237 xParam, xpfn, dwSCMSFlags, bNotString, psms);
00238
ThreadUnlock(&tlpwnd);
00239
return dwRet;
00240 }
00241
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252 LRESULT
SfnPOWERBROADCAST(
00253
PWND pwnd,
00254 UINT msg,
00255 WPARAM wParam,
00256 LPARAM lParam,
00257 ULONG_PTR xParam,
00258 PROC xpfn,
00259 DWORD dwSCMSFlags,
00260 PSMS psms)
00261 {
00262
switch (wParam) {
00263
case PBT_APMQUERYSUSPEND:
00264
SetWF(pwnd,
WFGOTQUERYSUSPENDMSG);
00265
break;
00266
case PBT_APMQUERYSUSPENDFAILED:
00267
if (!
TestWF(pwnd,
WFGOTQUERYSUSPENDMSG))
00268
return 0;
00269
ClrWF(pwnd,
WFGOTQUERYSUSPENDMSG);
00270
break;
00271
case PBT_APMSUSPEND:
00272
ClrWF(pwnd,
WFGOTQUERYSUSPENDMSG);
00273
SetWF(pwnd,
WFGOTSUSPENDMSG);
00274
break;
00275
case PBT_APMRESUMESUSPEND:
00276
if (
TestWF(pwnd,
WFGOTSUSPENDMSG)) {
00277
break;
00278 }
00279 wParam = PBT_APMRESUMECRITICAL;
00280
00281
case PBT_APMRESUMECRITICAL:
00282
ClrWF(pwnd,
WFGOTQUERYSUSPENDMSG);
00283
ClrWF(pwnd,
WFGOTSUSPENDMSG);
00284
break;
00285 }
00286
00287
return SfnDWORD(pwnd,
msg, wParam, lParam, xParam, xpfn, dwSCMSFlags, psms);
00288 }
00289
00290