Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • foresee/4C
  • gutsch/4C
2 results
Show changes
Showing
with 9134 additions and 41 deletions
......@@ -32,7 +32,6 @@ character a
character(8) actdate
character(10) acttime, helpsim, text1, text2
real time1, time2, time3
logical lhelp
unit_err=getunit()
if(flag_multi.eq.5) dirout = './'
......@@ -46,20 +45,6 @@ write (unit_trace, '(I4,I10,A)') iday, time_cur, ' sim_control'
! check daily output
if (year > 5 .and. flag_dayout .ge. 1) then
lhelp = .true.
do i = 1,outd_n
if (outd(i)%out_flag .eq. flag_dayout) then
select CASE (outd(i)%kind_name)
CASE ('day_short')
lhelp = .false.
end select
endif
enddo
if (lhelp) then
write(*,*) ' Warning: Your choice of daily output is ON with a simulation time of'
write(*,'(I6,A,I8,A)') year,' years. This option will create ',365*year,' data records per file!'
write(*,'(A)',advance='no') ' Do you really want do use daily output (y/n)? '
......@@ -67,7 +52,6 @@ if (year > 5 .and. flag_dayout .ge. 1) then
IF (a .eq. 'n' .or. a .eq. 'N') then
flag_dayout = 0
ENDIF
endif ! lhelp
ENDIF
! open file ycomp (yearly compressed output (multi run))
......@@ -136,10 +120,14 @@ time3 = 0.
case (5)
print*,ip, ' stop in readsoil, soil ID not found ', adjustl(soilid(ip))
case (6)
write(*,'(A,I5)') ' >>>foresee message: stop in read_cli - no climate data for year ',time_b
write(*,'(A,I5)') ' >>>foresee message: stop in read_cli, no climate data for year ',time_b
call finish_simul
stop
case (7)
print*,ip, ' stop in readsoil, error during reading soil data ', adjustl(soilid(ip))
call finish_simul
stop
case default
case default
print*,ip, 'flag_end = ', flag_end
end select
......@@ -228,7 +216,7 @@ if (flag_trace) write (unit_trace, '(I4,I10,A)') iday, time_cur, ' simulation_4C
DO time = 1, year
iday = 1
! Update population variable for new year if population is changed through interventions
if (flag_standup .gt. 0 .or. flag_dis==1) then
if (flag_standup .gt. 0 .or. flag_dis==1 .or. flag_dis==1) then
call stand_balance
call standup
flag_standup = 0
......@@ -239,7 +227,10 @@ if (flag_trace) write (unit_trace, '(I4,I10,A)') iday, time_cur, ' simulation_4C
! read or create Redn for areal application
IF (time.EQ.1 .and. flag_redn) CALL RedN_ini
IF (flag_dis .eq. 1) CALL dis_manag
IF (flag_dis .eq. 1 .or. flag_dis .eq. 2) then
CALL dis_manag
endif
! simulation of processes with subannual resolution (fluxes and soil)
CALL stand_daily
......
......@@ -453,12 +453,6 @@ CASE (0, 10, 20, 30, 40) ! de Vries
tcond0 = numera/denom * 86400. ! s --> day
CASE(2, 12, 22, 32, 42) ! sum like resistor; wie Widerstaende addieren
tcond2 = water%vf / water%tc + quarz%vf / quarz%tc + clay%vf / clay%tc + &
silt%vf / silt%tc + humus%vf / humus%tc + air%vf / air%tc + stone%vf / stone%tc + ice%vf / ice%tc
tcond2 = 86400. / tcond2
CASE(3, 13, 23, 33, 43) ! Campbell
vfm = clay%vf + silt%vf + stone%vf
vfs = vfm + quarz%vf + humus%vf
......@@ -504,13 +498,6 @@ CASE (1, 11, 21, 31, 41) ! Neusypina
hcapi = hcap1
tcondi = tcond1
CASE (2, 12, 22, 32, 42) ! sum like resitors; Widerstnde addieren
if ((tcond2 .gt. 8000.) .or. (tcond2 .le. 0.)) then
continue
endif
hcapi = hcap0
tcondi = tcond2
CASE (3, 13, 23, 33, 43) ! Campbell
hcapi = hcap0
tcondi = tcond3
......
......@@ -104,7 +104,12 @@ do
sumbio = sumbio + ntr * zeig%coh%totBio
sumNPP = sumNPP + ntr * zeig%coh%NPP
Ndem = Ndem + ntr * zeig%coh%Ndemc_c
autresp = autresp + ntr * zeig%coh%maintres
select case (flag_dis)
case (0,1)
autresp = autresp + ntr * zeig%coh%maintres
case (2)
autresp = autresp + ntr * (zeig%coh%maintres+zeig%coh%biocost_all)
end select
totfol = totfol + ntr * zeig%coh%x_fol
totsap = totsap + ntr * zeig%coh%x_sap
totfrt = totfrt + ntr * zeig%coh%x_frt
......@@ -498,10 +503,6 @@ svar%frt = 0.
END SELECT
Enddo
IF(spar(spec_new)%phmodel==4) THEN
svar(spec_new)%daybb = svar(spec_new)%ext_daybb
ELSE
......@@ -543,7 +544,7 @@ do i=1,nspecies
svar(i)%mean_diam = svar(i)%mean_diam / ntr
svar(i)%mean_jrb = svar(i)%mean_jrb / ntr
svar(i)%basal_area = pi*ntr*(svar(i)%med_diam*svar(i)%med_diam/40000)*10000/kpatchsize
svar(i)%basal_area = pi*(ntr-helpdiam(i))*(svar(i)%med_diam*svar(i)%med_diam/40000)*10000/kpatchsize
else
svar(i)%sum_ntreea = 0.
endif
......@@ -1083,8 +1084,14 @@ IMPLICIT NONE
DO
IF(.not.associated(zeig)) exit
if (zeig%coh%species.ne.nspec_tree+2) then ! exclude mistletoe from senescence
zeig%coh%sfol = spar(zeig%coh%species)%psf * zeig%coh%x_fol
zeig%coh%sfrt = spar(zeig%coh%species)%psr * zeig%coh%x_frt
select case (flag_dis)
! case (1,2)
! zeig%coh%sfol = spar(zeig%coh%species)%psf * zeig%coh%x_fol + zeig%coh%x_fol_loss
! zeig%coh%sfrt = spar(zeig%coh%species)%psr * zeig%coh%x_frt + zeig%coh%x_frt_loss
case (0,1,2)
zeig%coh%sfol = spar(zeig%coh%species)%psf * zeig%coh%x_fol
zeig%coh%sfrt = spar(zeig%coh%species)%psr * zeig%coh%x_frt
end select
IF (zeig%coh%height.ge.thr_height .and.zeig%coh%species.LE. nspec_tree) THEN
zeig%coh%ssap = spar(zeig%coh%species)%pss * zeig%coh%x_sap
ELSE
......
!MS$FREEFORM
! Microsoft Developer Studio generated include file.
! Used by script1.rc
!
integer, parameter :: IDD_4C = 101
integer, parameter :: IDD_4C_ctr = 102
integer, parameter :: IDD_4C_flags = 109
integer, parameter :: IDD_4C_files = 111
integer, parameter :: IDB_BITMAP3 = 115
integer, parameter :: IDD_4C_out = 116
integer, parameter :: IDD_4C_yearly = 118
integer, parameter :: IDD_4C_daily = 119
integer, parameter :: IDD_4C_coh_yearly = 120
integer, parameter :: IDD_4C_coh_daily = 121
integer, parameter :: IDD_default_dir = 122
integer, parameter :: IDD_4C_default_dir = 122
integer, parameter :: IDD_4C_main = 123
integer, parameter :: IDD_4C_ids = 126
integer, parameter :: IDB_BITMAP1 = 131
integer, parameter :: IDC_STATIC_Control = 1005
integer, parameter :: IDC_STATIC_4C = 1017
integer, parameter :: IDC_COMBO_runv = 1019
integer, parameter :: IDC_RADIO_ctrfile = 1020
integer, parameter :: IDC_COMBO_runv3 = 1020
integer, parameter :: IDC_RADIO_ctredit = 1024
integer, parameter :: IDC_STATIC_simul = 1034
integer, parameter :: IDC_STATIC_runv = 1036
integer, parameter :: IDC_STATIC_runnr = 1037
integer, parameter :: IDC_STATIC_runv3 = 1038
integer, parameter :: IDC_EDIT_runnr = 1044
integer, parameter :: IDC_STATIC_runo = 1046
integer, parameter :: IDC_STATIC_runo3 = 1047
integer, parameter :: IDC_EDIT_yearn = 1048
integer, parameter :: IDC_EDIT_start = 1049
integer, parameter :: IDC_STATIC_yearn = 1050
integer, parameter :: IDC_STATIC_start = 1051
integer, parameter :: IDC_EDIT_patch = 1052
integer, parameter :: IDC_STATIC_patch = 1053
integer, parameter :: IDC_STATIC_model = 1055
integer, parameter :: IDC_EDIT_thickf = 1056
integer, parameter :: IDC_EDIT_timeph = 1057
integer, parameter :: IDC_STATIC_thickf = 1058
integer, parameter :: IDC_STATIC_timeph = 1059
integer, parameter :: IDC_STATIC_mort = 1060
integer, parameter :: IDC_STATIC_reg = 1061
integer, parameter :: IDC_STATIC_forska = 1062
integer, parameter :: IDC_COMBO_mort = 1063
integer, parameter :: IDC_COMBO_reg = 1064
integer, parameter :: IDC_COMBO_forska = 1065
integer, parameter :: IDC_STATIC_stand = 1066
integer, parameter :: IDC_STATIC_sveg = 1067
integer, parameter :: IDC_STATIC_mg = 1068
integer, parameter :: IDC_STATIC_dis = 1069
integer, parameter :: IDC_STATIC_light = 1070
integer, parameter :: IDC_STATIC_folhei = 1071
integer, parameter :: IDC_COMBO_stand = 1072
integer, parameter :: IDC_COMBO_sveg = 1073
integer, parameter :: IDC_COMBO_mg = 1074
integer, parameter :: IDC_COMBO_dis = 1075
integer, parameter :: IDC_COMBO_light = 1076
integer, parameter :: IDC_COMBO_folhei = 1077
integer, parameter :: IDC_COMBO_volfunc = 1078
integer, parameter :: IDC_STATIC_volfunc = 1079
integer, parameter :: IDC_STATIC_resp = 1080
integer, parameter :: IDC_STATIC_limi = 1081
integer, parameter :: IDC_STATIC_decomp = 1082
integer, parameter :: IDC_STATIC_sign = 1083
integer, parameter :: IDC_STATIC_wred = 1084
integer, parameter :: IDC_STATIC_wurz = 1085
integer, parameter :: IDC_STATIC_cond = 1086
integer, parameter :: IDC_COMBO_resp = 1088
integer, parameter :: IDC_COMBO_limi = 1089
integer, parameter :: IDC_COMBO_decomp = 1090
integer, parameter :: IDC_COMBO_sign = 1091
integer, parameter :: IDC_COMBO_wred = 1092
integer, parameter :: IDC_COMBO_wurz = 1093
integer, parameter :: IDC_COMBO_cond = 1094
integer, parameter :: IDC_COMBO_int = 1095
integer, parameter :: IDC_COMBO_eva = 1096
integer, parameter :: IDC_STATIC_int = 1097
integer, parameter :: IDC_STATIC_eva = 1098
integer, parameter :: IDC_STATIC_sort = 1099
integer, parameter :: IDC_STATIC_wpm = 1100
integer, parameter :: IDC_COMBO_CO2 = 1101
integer, parameter :: IDC_STATIC_stat = 1102
integer, parameter :: IDC_COMBO_sort = 1103
integer, parameter :: IDC_COMBO_wpm = 1104
integer, parameter :: IDC_COMBO_stat = 1105
integer, parameter :: IDC_STATIC_files = 1108
integer, parameter :: IDC_STATIC_specpar = 1109
integer, parameter :: IDC_EDIT_specpar = 1110
integer, parameter :: IDC_BUTTON_specpar = 1111
integer, parameter :: IDC_BUTTON_ini = 1112
integer, parameter :: IDC_BUTTON_sop = 1113
integer, parameter :: IDC_STATIC_dir1 = 1114
integer, parameter :: IDC_STATIC_dirin = 1114
integer, parameter :: IDC_BUTTON_soi = 1115
integer, parameter :: IDC_STATIC_dirout = 1115
integer, parameter :: IDC_STATIC_soi = 1116
integer, parameter :: IDC_EDIT_sop = 1117
integer, parameter :: IDC_EDIT_soi = 1118
integer, parameter :: IDC_STATIC_ini = 1119
integer, parameter :: IDC_EDIT_ini = 1120
integer, parameter :: IDC_STATIC_ini1 = 1121
integer, parameter :: IDC_BUTTON_man = 1122
integer, parameter :: IDC_STATIC_cli = 1123
integer, parameter :: IDC_BUTTON_dep = 1124
integer, parameter :: IDC_BUTTON_red = 1125
integer, parameter :: IDC_BUTTON_lit = 1126
integer, parameter :: IDC_RADIO_single_ini = 1127
integer, parameter :: IDC_RADIO_multi_ini = 1128
integer, parameter :: IDC_STATIC_standid = 1129
integer, parameter :: IDC_EDIT_standid = 1130
integer, parameter :: IDC_STATIC_man = 1131
integer, parameter :: IDC_EDIT_man = 1132
integer, parameter :: IDC_STATIC_dep = 1133
integer, parameter :: IDC_EDIT_dep = 1134
integer, parameter :: IDC_EDIT_red = 1135
integer, parameter :: IDC_EDIT_lit = 1136
integer, parameter :: IDC_STATIC_lit = 1137
integer, parameter :: IDC_STATIC_red = 1138
integer, parameter :: IDC_STATIC_dir2 = 1139
integer, parameter :: IDC_STATIC_sop = 1140
integer, parameter :: IDC_EDIT_cli = 1141
integer, parameter :: IDC_BUTTON_cli = 1142
integer, parameter :: IDC_BUTTON_DIR = 1143
integer, parameter :: IDC_EDIT_cli2 = 1144
integer, parameter :: IDC_EDIT_DIR = 1144
integer, parameter :: IDC_EDIT_DIR_IN = 1144
integer, parameter :: IDC_STATIC_name = 1145
integer, parameter :: IDC_EDIT_DIR_OUT = 1145
integer, parameter :: IDC_EDIT_sitename = 1147
integer, parameter :: IDC_STATIC_nameall = 1148
integer, parameter :: IDC_RADIO_idy = 1149
integer, parameter :: IDC_RADIO_idn = 1150
integer, parameter :: IDC_STATIC_id = 1151
integer, parameter :: IDC_STATIC_year = 1152
integer, parameter :: IDC_STATIC_yearly = 1153
integer, parameter :: IDC_CHECK_y1 = 1161
integer, parameter :: IDC_CHECK_y2 = 1162
integer, parameter :: IDC_CHECK_y3 = 1163
integer, parameter :: IDC_CHECK_y4 = 1164
integer, parameter :: IDC_CHECK_y5 = 1165
integer, parameter :: IDC_CHECK_y6 = 1166
integer, parameter :: IDC_CHECK_y7 = 1167
integer, parameter :: IDC_CHECK_y8 = 1168
integer, parameter :: IDC_CHECK_y9 = 1169
integer, parameter :: IDC_CHECK_y10 = 1170
integer, parameter :: IDC_CHECK_y11 = 1171
integer, parameter :: IDC_CHECK_y12 = 1172
integer, parameter :: IDC_CHECK_y13 = 1173
integer, parameter :: IDC_CHECK_y14 = 1174
integer, parameter :: IDC_CHECK_y15 = 1175
integer, parameter :: IDC_CHECK_y16 = 1176
integer, parameter :: IDC_CHECK_y17 = 1177
integer, parameter :: IDC_CHECK_y18 = 1178
integer, parameter :: IDC_CHECK_y19 = 1179
integer, parameter :: IDC_CHECK_y20 = 1180
integer, parameter :: IDC_CHECK_y21 = 1181
integer, parameter :: IDC_CHECK_y22 = 1182
integer, parameter :: IDC_CHECK_y23 = 1183
integer, parameter :: IDC_CHECK_y24 = 1184
integer, parameter :: IDC_CHECK_y25 = 1185
integer, parameter :: IDC_CHECK_y26 = 1186
integer, parameter :: IDC_CHECK_y27 = 1187
integer, parameter :: IDC_CHECK_y28 = 1188
integer, parameter :: IDC_STATIC_yfile = 1189
integer, parameter :: IDC_BUTTON_yearly = 1190
integer, parameter :: IDC_CHECK_y29 = 1190
integer, parameter :: IDC_BUTTON_daily = 1191
integer, parameter :: IDC_CHECK_y30 = 1191
integer, parameter :: IDC_BUTTON_coh_yearly = 1192
integer, parameter :: IDC_CHECK_y31 = 1192
integer, parameter :: IDC_BUTTON_coh_daily = 1193
integer, parameter :: IDC_CHECK_y32 = 1193
integer, parameter :: IDC_STATIC_choice_out = 1194
integer, parameter :: IDC_CHECK_y33 = 1194
integer, parameter :: IDC_STATIC_daily = 1195
integer, parameter :: IDC_CHECK_y34 = 1195
integer, parameter :: IDC_COMBO_daily = 1196
integer, parameter :: IDC_CHECK_y35 = 1196
integer, parameter :: IDC_STATIC_coh_daily = 1197
integer, parameter :: IDC_CHECK_y36 = 1197
integer, parameter :: IDC_COMBO_coh_daily = 1198
integer, parameter :: IDC_CHECK_y37 = 1198
integer, parameter :: IDC_CHECK_y38 = 1199
integer, parameter :: IDC_CHECK_y39 = 1200
integer, parameter :: IDC_CHECK_y40 = 1201
integer, parameter :: IDC_CHECK_y41 = 1202
integer, parameter :: IDC_CHECK_y42 = 1203
integer, parameter :: IDC_COMBO_coh_yearly = 1204
integer, parameter :: IDC_STATIC_coh_yearly = 1205
integer, parameter :: IDC_STATIC_SUM = 1206
integer, parameter :: IDC_CHECK_y43 = 1206
integer, parameter :: ID4C_BUTTON_OK = 1208
integer, parameter :: ID_CTR_BUTTON_FLAGS = 1209
integer, parameter :: ID_CTR_BUTTON_OK = 1210
integer, parameter :: ID_FILES_BUTTON_OK = 1211
integer, parameter :: ID_CTR_BUTTON_FILES = 1212
integer, parameter :: ID_OUT_BUTTON_BACK = 1213
integer, parameter :: ID_START = 1214
integer, parameter :: ID_SAVE = 1215
integer, parameter :: ID_YEARLY_BUTTON_OK = 1216
integer, parameter :: ID_DAILY_BUTTON_OK = 1217
integer, parameter :: ID_YEARLYCOH_BUTTON_OK = 1218
integer, parameter :: ID_FLAGS_BUTTON_OK = 1219
integer, parameter :: ID_DAILYCOH_BUTTON_OK = 1220
integer, parameter :: ID_CTR_BUTTON_RUNNR = 1221
integer, parameter :: ID_DEFAULT_DIR_BUTTON_OK = 1222
integer, parameter :: ID_START_4C = 1226
integer, parameter :: IDSTOP = 1227
integer, parameter :: IDC_RADIO_start = 1229
integer, parameter :: IDC_RADIO_start_dir = 1230
integer, parameter :: IDC_RADIO_edit = 1231
integer, parameter :: ID_CANCEL_FLAGS = 1232
integer, parameter :: IDC_EDIT_ID = 1233
integer, parameter :: ID_CANCEL_FILES = 1233
integer, parameter :: IDC_COMBO_standid = 1234
integer, parameter :: ID_CANCEL_IDS = 1234
integer, parameter :: IDC_STATIC_spinup = 1235
integer, parameter :: IDC_EDIT_spinup = 1236
integer, parameter :: IDC_EDIT_wpm = 1236
integer, parameter :: ID_CANCEL_OUTF = 1236
integer, parameter :: IDC_BUTTON_spinup = 1237
integer, parameter :: IDC_STATIC_mes = 1237
integer, parameter :: ID_CTR_BUTTON_IDS = 1238
integer, parameter :: IDC_EDIT_mes = 1238
integer, parameter :: IDC_COMBO_yearly = 1239
integer, parameter :: IDC_COMBO_sum = 1240
integer, parameter :: ID_IDS_BUTTON_OK = 1242
integer, parameter :: ID_YEARLY_BUTTON_SELECT = 1248
integer, parameter :: ID_YEARLY_BUTTON_DESELECT = 1249
integer, parameter :: IDC_BUTTON_wpm = 1250
integer, parameter :: ID_DAILY_BUTTON_SELECT = 1250
integer, parameter :: IDC_BUTTON_mes = 1251
integer, parameter :: ID_DAILY_BUTTON_DESELECT = 1251
integer, parameter :: ID_DAILYCOH_BUTTON_SELECT = 1252
integer, parameter :: ID_DAILYCOH_BUTTON_DESELECT = 1253
integer, parameter :: ID_YEARLYCOH_BUTTON_SELECT = 1254
integer, parameter :: ID_YEARLYCOH_BUTTON_DESELECT = 1255
integer, parameter :: IDC_CHECK_y44 = 1256
integer, parameter :: IDC_STATIC_CO2 = 1256
integer, parameter :: IDC_CHECK_y45 = 1257
integer, parameter :: IDC_CHECK_y46 = 1258
integer, parameter :: IDC_CHECK_y47 = 1259
integer, parameter :: IDC_CHECK_y48 = 1260
integer, parameter :: IDC_CHECK_y49 = 1261
integer, parameter :: IDC_REBAR1 = 1262
integer, parameter :: IDC_CHECK_y50 = 1001
integer, parameter :: IDC_CHECK_y51 = 1002
#ifndef IDC_STATIC
#define IDC_STATIC (-1)
#endif
#define IDD_4C_ctr 102
#define IDD_4C_flags 109
#define IDD_4C_files 111
#define IDD_4C_out 116
#define IDD_4C_yearly 118
#define IDD_4C_daily 119
#define IDD_4C_coh_yearly 120
#define IDD_4C_coh_daily 121
#define IDD_4C_default_dir 122
#define IDD_4C_main 123
#define IDD_4C_ids 126
#define IDB_BITMAP1 131
#define IDD_DIALOG1 136
#define IDC_STATIC_day 1000
#define IDC_CHECK_y50 1001
#define IDC_CHECK_y51 1002
#define IDC_REBAR1 1002
#define IDC_STATIC_pic 1003
#define IDC_STATIC_Control 1005
#define IDC_STATIC_4C 1017
#define IDC_COMBO_runv 1019
#define IDC_COMBO_runv3 1020
#define IDC_STATIC_simul 1034
#define IDC_STATIC_runv 1036
#define IDC_STATIC_runnr 1037
#define IDC_STATIC_runv3 1038
#define IDC_EDIT_runnr 1044
#define IDC_STATIC_runo 1046
#define IDC_STATIC_runo3 1047
#define IDC_EDIT_yearn 1048
#define IDC_EDIT_start 1049
#define IDC_STATIC_yearn 1050
#define IDC_STATIC_start 1051
#define IDC_EDIT_patch 1052
#define IDC_STATIC_patch 1053
#define IDC_STATIC_model 1055
#define IDC_EDIT_thickf 1056
#define IDC_EDIT_timeph 1057
#define IDC_STATIC_thickf 1058
#define IDC_STATIC_timeph 1059
#define IDC_STATIC_mort 1060
#define IDC_STATIC_reg 1061
#define IDC_STATIC_forska 1062
#define IDC_COMBO_mort 1063
#define IDC_COMBO_reg 1064
#define IDC_COMBO_forska 1065
#define IDC_STATIC_stand 1066
#define IDC_STATIC_sveg 1067
#define IDC_STATIC_mg 1068
#define IDC_STATIC_dis 1069
#define IDC_STATIC_light 1070
#define IDC_STATIC_folhei 1071
#define IDC_COMBO_stand 1072
#define IDC_COMBO_sveg 1073
#define IDC_COMBO_mg 1074
#define IDC_COMBO_dis 1075
#define IDC_COMBO_light 1076
#define IDC_COMBO_folhei 1077
#define IDC_COMBO_volfunc 1078
#define IDC_STATIC_volfunc 1079
#define IDC_STATIC_resp 1080
#define IDC_STATIC_limi 1081
#define IDC_STATIC_decomp 1082
#define IDC_STATIC_sign 1083
#define IDC_STATIC_wred 1084
#define IDC_STATIC_wurz 1085
#define IDC_STATIC_cond 1086
#define IDC_COMBO_resp 1088
#define IDC_COMBO_limi 1089
#define IDC_COMBO_decomp 1090
#define IDC_COMBO_sign 1091
#define IDC_COMBO_wred 1092
#define IDC_COMBO_wurz 1093
#define IDC_COMBO_cond 1094
#define IDC_COMBO_int 1095
#define IDC_COMBO_eva 1096
#define IDC_STATIC_int 1097
#define IDC_STATIC_eva 1098
#define IDC_STATIC_sort 1099
#define IDC_STATIC_wpm 1100
#define IDC_COMBO_CO2 1101
#define IDC_STATIC_stat 1102
#define IDC_COMBO_sort 1103
#define IDC_COMBO_wpm 1104
#define IDC_COMBO_stat 1105
#define IDC_STATIC_files 1108
#define IDC_STATIC_specpar 1109
#define IDC_EDIT_specpar 1110
#define IDC_BUTTON_specpar 1111
#define IDC_BUTTON_ini 1112
#define IDC_BUTTON_sop 1113
#define IDC_STATIC_dirin 1114
#define IDC_BUTTON_soi 1115
#define IDC_STATIC_dirout 1115
#define IDC_STATIC_soi 1116
#define IDC_EDIT_sop 1117
#define IDC_EDIT_soi 1118
#define IDC_STATIC_ini 1119
#define IDC_EDIT_ini 1120
#define IDC_STATIC_ini1 1121
#define IDC_BUTTON_man 1122
#define IDC_STATIC_cli 1123
#define IDC_BUTTON_dep 1124
#define IDC_BUTTON_red 1125
#define IDC_BUTTON_lit 1126
#define IDC_STATIC_standid 1129
#define IDC_EDIT_standid 1130
#define IDC_STATIC_man 1131
#define IDC_EDIT_man 1132
#define IDC_STATIC_dep 1133
#define IDC_EDIT_dep 1134
#define IDC_EDIT_red 1135
#define IDC_EDIT_lit 1136
#define IDC_STATIC_lit 1137
#define IDC_STATIC_red 1138
#define IDC_STATIC_sop 1140
#define IDC_EDIT_cli 1141
#define IDC_BUTTON_cli 1142
#define IDC_EDIT_DIR_IN 1144
#define IDC_EDIT_DIR_OUT 1145
#define IDC_STATIC_year 1152
#define IDC_CHECK_y1 1161
#define IDC_CHECK_y2 1162
#define IDC_CHECK_y3 1163
#define IDC_CHECK_y4 1164
#define IDC_CHECK_y5 1165
#define IDC_CHECK_y6 1166
#define IDC_CHECK_y7 1167
#define IDC_CHECK_y8 1168
#define IDC_CHECK_y9 1169
#define IDC_CHECK_y10 1170
#define IDC_CHECK_y11 1171
#define IDC_CHECK_y12 1172
#define IDC_CHECK_y13 1173
#define IDC_CHECK_y14 1174
#define IDC_CHECK_y15 1175
#define IDC_CHECK_y16 1176
#define IDC_CHECK_y17 1177
#define IDC_CHECK_y18 1178
#define IDC_CHECK_y19 1179
#define IDC_CHECK_y20 1180
#define IDC_CHECK_y21 1181
#define IDC_CHECK_y22 1182
#define IDC_CHECK_y23 1183
#define IDC_CHECK_y24 1184
#define IDC_CHECK_y25 1185
#define IDC_CHECK_y26 1186
#define IDC_CHECK_y27 1187
#define IDC_CHECK_y28 1188
#define IDC_STATIC_yfile 1189
#define IDC_BUTTON_yearly 1190
#define IDC_CHECK_y29 1190
#define IDC_BUTTON_daily 1191
#define IDC_CHECK_y30 1191
#define IDC_BUTTON_coh_yearly 1192
#define IDC_CHECK_y31 1192
#define IDC_BUTTON_coh_daily 1193
#define IDC_CHECK_y32 1193
#define IDC_CHECK_y33 1194
#define IDC_STATIC_choice_out 1194
#define IDC_CHECK_y34 1195
#define IDC_CHECK_y35 1196
#define IDC_COMBO_daily 1196
#define IDC_CHECK_y36 1197
#define IDC_CHECK_y37 1198
#define IDC_COMBO_coh_daily 1198
#define IDC_CHECK_y38 1199
#define IDC_CHECK_y39 1200
#define IDC_CHECK_y40 1201
#define IDC_CHECK_y41 1202
#define IDC_CHECK_y42 1203
#define IDC_COMBO_coh_yearly 1204
#define IDC_CHECK_y43 1206
#define IDC_STATIC_SUM 1206
#define ID_CTR_BUTTON_FLAGS 1209
#define ID_CTR_BUTTON_OK 1210
#define ID_FILES_BUTTON_OK 1211
#define ID_CTR_BUTTON_FILES 1212
#define ID_OUT_BUTTON_BACK 1213
#define ID_START 1214
#define ID_SAVE 1215
#define ID_YEARLY_BUTTON_OK 1216
#define ID_DAILY_BUTTON_OK 1217
#define ID_YEARLYCOH_BUTTON_OK 1218
#define ID_FLAGS_BUTTON_OK 1219
#define ID_DAILYCOH_BUTTON_OK 1220
#define ID_CTR_BUTTON_RUNNR 1221
#define ID_DEFAULT_DIR_BUTTON_OK 1222
#define ID_START_4C 1226
#define IDSTOP 1227
#define IDC_RADIO_start 1229
#define IDC_RADIO_edit 1231
#define ID_CANCEL_FLAGS 1232
#define IDC_EDIT_ID 1233
#define ID_CANCEL_FILES 1233
#define IDC_COMBO_standid 1234
#define ID_CANCEL_IDS 1234
#define IDC_STATIC_spinup 1235
#define IDC_EDIT_wpm 1236
#define ID_CANCEL_OUTF 1236
#define IDC_STATIC_mes 1237
#define IDC_EDIT_mes 1238
#define ID_CTR_BUTTON_IDS 1238
#define IDC_COMBO_yearly 1239
#define IDC_COMBO_sum 1240
#define ID_IDS_BUTTON_OK 1242
#define ID_YEARLY_BUTTON_SELECT 1248
#define ID_YEARLY_BUTTON_DESELECT 1249
#define IDC_BUTTON_wpm 1250
#define ID_DAILY_BUTTON_SELECT 1250
#define IDC_BUTTON_mes 1251
#define ID_DAILY_BUTTON_DESELECT 1251
#define ID_DAILYCOH_BUTTON_SELECT 1252
#define ID_DAILYCOH_BUTTON_DESELECT 1253
#define ID_YEARLYCOH_BUTTON_SELECT 1254
#define ID_YEARLYCOH_BUTTON_DESELECT 1255
#define IDC_CHECK_y44 1256
#define IDC_STATIC_CO2 1256
#define IDC_CHECK_y45 1257
#define IDC_CHECK_y46 1258
#define IDC_CHECK_y47 1259
#define IDC_CHECK_y48 1260
#define IDC_CHECK_y49 1261
/*****************************************************************************\
* *
* commctrl.h - - Interface for the Windows Common Controls *
* *
* Version 1.2 *
* *
* Copyright 1991-1998, Microsoft Corp. All rights reserved. *
* *
\*****************************************************************************/
#ifndef _INC_COMMCTRL
#define _INC_COMMCTRL
#ifndef _WIN32_IE
#define _WIN32_IE 0x0400
#else
#if (_WIN32_IE < 0x0400) && defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0500)
#error _WIN32_IE setting conflicts with _WIN32_WINNT setting
#endif
#endif
#ifndef _HRESULT_DEFINED
#define _HRESULT_DEFINED
typedef LONG HRESULT;
#endif // _HRESULT_DEFINED
#ifndef NOUSER
//
// Define API decoration for direct importing of DLL references.
//
#ifndef WINCOMMCTRLAPI
#if !defined(_COMCTL32_) && defined(_WIN32)
#define WINCOMMCTRLAPI DECLSPEC_IMPORT
#else
#define WINCOMMCTRLAPI
#endif
#endif // WINCOMMCTRLAPI
//
// For compilers that don't support nameless unions
//
#ifndef DUMMYUNIONNAME
#ifdef NONAMELESSUNION
#define DUMMYUNIONNAME u
#define DUMMYUNIONNAME2 u2
#define DUMMYUNIONNAME3 u3
#define DUMMYUNIONNAME4 u4
#define DUMMYUNIONNAME5 u5
#else
#define DUMMYUNIONNAME
#define DUMMYUNIONNAME2
#define DUMMYUNIONNAME3
#define DUMMYUNIONNAME4
#define DUMMYUNIONNAME5
#endif
#endif // DUMMYUNIONNAME
#ifdef _WIN32
#include <pshpack1.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
//
// Users of this header may define any number of these constants to avoid
// the definitions of each functional group.
//
// NOTOOLBAR Customizable bitmap-button toolbar control.
// NOUPDOWN Up and Down arrow increment/decrement control.
// NOSTATUSBAR Status bar control.
// NOMENUHELP APIs to help manage menus, especially with a status bar.
// NOTRACKBAR Customizable column-width tracking control.
// NODRAGLIST APIs to make a listbox source and sink drag&drop actions.
// NOPROGRESS Progress gas gauge.
// NOHOTKEY HotKey control
// NOHEADER Header bar control.
// NOIMAGEAPIS ImageList apis.
// NOLISTVIEW ListView control.
// NOTREEVIEW TreeView control.
// NOTABCONTROL Tab control.
// NOANIMATE Animate control.
//
//=============================================================================
#include <prsht.h>
#ifndef SNDMSG
#ifdef __cplusplus
#ifndef _MAC
#define SNDMSG ::SendMessage
#else
#define SNDMSG ::AfxSendMessage
#endif
#else
#ifndef _MAC
#define SNDMSG SendMessage
#else
#define SNDMSG AfxSendMessage
#endif //_MAC
#endif
#endif // ifndef SNDMSG
#ifdef _MAC
#ifndef RC_INVOKED
#ifndef _WLM_NOFORCE_LIBS
#ifndef _WLMDLL
#ifdef _DEBUG
#pragma comment(lib, "comctld.lib")
#else
#pragma comment(lib, "comctl.lib")
#endif
#pragma comment(linker, "/macres:comctl.rsc")
#else
#ifdef _DEBUG
#pragma comment(lib, "msvcctld.lib")
#else
#pragma comment(lib, "msvcctl.lib")
#endif
#endif // _WLMDLL
#endif // _WLM_NOFORCE_LIBS
#endif // RC_INVOKED
#endif //_MAC
WINCOMMCTRLAPI void WINAPI InitCommonControls(void);
#if (_WIN32_IE >= 0x0300)
typedef struct tagINITCOMMONCONTROLSEX {
DWORD dwSize; // size of this structure
DWORD dwICC; // flags indicating which classes to be initialized
} INITCOMMONCONTROLSEX, *LPINITCOMMONCONTROLSEX;
#define ICC_LISTVIEW_CLASSES 0x00000001 // listview, header
#define ICC_TREEVIEW_CLASSES 0x00000002 // treeview, tooltips
#define ICC_BAR_CLASSES 0x00000004 // toolbar, statusbar, trackbar, tooltips
#define ICC_TAB_CLASSES 0x00000008 // tab, tooltips
#define ICC_UPDOWN_CLASS 0x00000010 // updown
#define ICC_PROGRESS_CLASS 0x00000020 // progress
#define ICC_HOTKEY_CLASS 0x00000040 // hotkey
#define ICC_ANIMATE_CLASS 0x00000080 // animate
#define ICC_WIN95_CLASSES 0x000000FF
#define ICC_DATE_CLASSES 0x00000100 // month picker, date picker, time picker, updown
#define ICC_USEREX_CLASSES 0x00000200 // comboex
#define ICC_COOL_CLASSES 0x00000400 // rebar (coolbar) control
#if (_WIN32_IE >= 0x0400)
#define ICC_INTERNET_CLASSES 0x00000800
#define ICC_PAGESCROLLER_CLASS 0x00001000 // page scroller
#define ICC_NATIVEFNTCTL_CLASS 0x00002000 // native font control
#endif
WINCOMMCTRLAPI BOOL WINAPI InitCommonControlsEx(LPINITCOMMONCONTROLSEX);
#endif // _WIN32_IE >= 0x0300
#define ODT_HEADER 100
#define ODT_TAB 101
#define ODT_LISTVIEW 102
//====== Ranges for control message IDs =======================================
#define LVM_FIRST 0x1000 // ListView messages
#define TV_FIRST 0x1100 // TreeView messages
#define HDM_FIRST 0x1200 // Header messages
#define TCM_FIRST 0x1300 // Tab control messages
#if (_WIN32_IE >= 0x0400)
#define PGM_FIRST 0x1400 // Pager control messages
#define CCM_FIRST 0x2000 // Common control shared messages
#define CCM_SETBKCOLOR (CCM_FIRST + 1) // lParam is bkColor
typedef struct tagCOLORSCHEME {
DWORD dwSize;
COLORREF clrBtnHighlight; // highlight color
COLORREF clrBtnShadow; // shadow color
} COLORSCHEME, *LPCOLORSCHEME;
#define CCM_SETCOLORSCHEME (CCM_FIRST + 2) // lParam is color scheme
#define CCM_GETCOLORSCHEME (CCM_FIRST + 3) // fills in COLORSCHEME pointed to by lParam
#define CCM_GETDROPTARGET (CCM_FIRST + 4)
#define CCM_SETUNICODEFORMAT (CCM_FIRST + 5)
#define CCM_GETUNICODEFORMAT (CCM_FIRST + 6)
#endif
#if (_WIN32_IE >= 0x0400)
// for tooltips
#define INFOTIPSIZE 1024
#endif
//====== WM_NOTIFY Macros =====================================================
#define HANDLE_WM_NOTIFY(hwnd, wParam, lParam, fn) \
(fn)((hwnd), (int)(wParam), (NMHDR FAR*)(lParam))
#define FORWARD_WM_NOTIFY(hwnd, idFrom, pnmhdr, fn) \
(LRESULT)(fn)((hwnd), WM_NOTIFY, (WPARAM)(int)(idFrom), (LPARAM)(NMHDR FAR*)(pnmhdr))
//====== Generic WM_NOTIFY notification codes =================================
#define NM_OUTOFMEMORY (NM_FIRST-1)
#define NM_CLICK (NM_FIRST-2) // uses NMCLICK struct
#define NM_DBLCLK (NM_FIRST-3)
#define NM_RETURN (NM_FIRST-4)
#define NM_RCLICK (NM_FIRST-5) // uses NMCLICK struct
#define NM_RDBLCLK (NM_FIRST-6)
#define NM_SETFOCUS (NM_FIRST-7)
#define NM_KILLFOCUS (NM_FIRST-8)
#if (_WIN32_IE >= 0x0300)
#define NM_CUSTOMDRAW (NM_FIRST-12)
#define NM_HOVER (NM_FIRST-13)
#endif
#if (_WIN32_IE >= 0x0400)
#define NM_NCHITTEST (NM_FIRST-14) // uses NMMOUSE struct
#define NM_KEYDOWN (NM_FIRST-15) // uses NMKEY struct
#define NM_RELEASEDCAPTURE (NM_FIRST-16)
#define NM_SETCURSOR (NM_FIRST-17) // uses NMMOUSE struct
#define NM_CHAR (NM_FIRST-18) // uses NMCHAR struct
#endif
#ifndef CCSIZEOF_STRUCT
#define CCSIZEOF_STRUCT(structname, member) (((int)((LPBYTE)(&((structname*)0)->member) - ((LPBYTE)((structname*)0)))) + sizeof(((structname*)0)->member))
#endif
#if (_WIN32_IE >= 0x0400)
//====== Generic WM_NOTIFY notification structures ============================
typedef struct tagNMMOUSE {
NMHDR hdr;
DWORD dwItemSpec;
DWORD dwItemData;
POINT pt;
DWORD dwHitInfo; // any specifics about where on the item or control the mouse is
} NMMOUSE, FAR* LPNMMOUSE;
typedef NMMOUSE NMCLICK;
typedef LPNMMOUSE LPNMCLICK;
// Generic structure to request an object of a specific type.
typedef struct tagNMOBJECTNOTIFY {
NMHDR hdr;
int iItem;
#ifdef __IID_DEFINED__
const IID *piid;
#else
const void *piid;
#endif
void *pObject;
HRESULT hResult;
DWORD dwFlags; // control specific flags (hints as to where in iItem it hit)
} NMOBJECTNOTIFY, *LPNMOBJECTNOTIFY;
// Generic structure for a key
typedef struct tagNMKEY
{
NMHDR hdr;
UINT nVKey;
UINT uFlags;
} NMKEY, FAR *LPNMKEY;
// Generic structure for a character
typedef struct tagNMCHAR {
NMHDR hdr;
UINT ch;
DWORD dwItemPrev; // Item previously selected
DWORD dwItemNext; // Item to be selected
} NMCHAR, FAR* LPNMCHAR;
#endif // _WIN32_IE >= 0x0400
//====== WM_NOTIFY codes (NMHDR.code values) ==================================
#define NM_FIRST (0U- 0U) // generic to all controls
#define NM_LAST (0U- 99U)
#define LVN_FIRST (0U-100U) // listview
#define LVN_LAST (0U-199U)
#define HDN_FIRST (0U-300U) // header
#define HDN_LAST (0U-399U)
#define TVN_FIRST (0U-400U) // treeview
#define TVN_LAST (0U-499U)
#define TTN_FIRST (0U-520U) // tooltips
#define TTN_LAST (0U-549U)
#define TCN_FIRST (0U-550U) // tab control
#define TCN_LAST (0U-580U)
// Shell reserved (0U-580U) - (0U-589U)
#define CDN_FIRST (0U-601U) // common dialog (new)
#define CDN_LAST (0U-699U)
#define TBN_FIRST (0U-700U) // toolbar
#define TBN_LAST (0U-720U)
#define UDN_FIRST (0U-721) // updown
#define UDN_LAST (0U-740)
#if (_WIN32_IE >= 0x0300)
#define MCN_FIRST (0U-750U) // monthcal
#define MCN_LAST (0U-759U)
#define DTN_FIRST (0U-760U) // datetimepick
#define DTN_LAST (0U-799U)
#define CBEN_FIRST (0U-800U) // combo box ex
#define CBEN_LAST (0U-830U)
#define RBN_FIRST (0U-831U) // rebar
#define RBN_LAST (0U-859U)
#endif
#if (_WIN32_IE >= 0x0400)
#define IPN_FIRST (0U-860U) // internet address
#define IPN_LAST (0U-879U) // internet address
#define SBN_FIRST (0U-880U) // status bar
#define SBN_LAST (0U-899U)
#define PGN_FIRST (0U-900U) // Pager Control
#define PGN_LAST (0U-950U)
#endif
#define MSGF_COMMCTRL_BEGINDRAG 0x4200
#define MSGF_COMMCTRL_SIZEHEADER 0x4201
#define MSGF_COMMCTRL_DRAGSELECT 0x4202
#define MSGF_COMMCTRL_TOOLBARCUST 0x4203
#if (_WIN32_IE >= 0x0300)
//==================== CUSTOM DRAW ==========================================
// custom draw return flags
// values under 0x00010000 are reserved for global custom draw values.
// above that are for specific controls
#define CDRF_DODEFAULT 0x00000000
#define CDRF_NEWFONT 0x00000002
#define CDRF_SKIPDEFAULT 0x00000004
#define CDRF_NOTIFYPOSTPAINT 0x00000010
#define CDRF_NOTIFYITEMDRAW 0x00000020
#if (_WIN32_IE >= 0x0400)
#define CDRF_NOTIFYSUBITEMDRAW 0x00000020 // flags are the same, we can distinguish by context
#endif
#define CDRF_NOTIFYPOSTERASE 0x00000040
// drawstage flags
// values under 0x00010000 are reserved for global custom draw values.
// above that are for specific controls
#define CDDS_PREPAINT 0x00000001
#define CDDS_POSTPAINT 0x00000002
#define CDDS_PREERASE 0x00000003
#define CDDS_POSTERASE 0x00000004
// the 0x000010000 bit means it's individual item specific
#define CDDS_ITEM 0x00010000
#define CDDS_ITEMPREPAINT (CDDS_ITEM | CDDS_PREPAINT)
#define CDDS_ITEMPOSTPAINT (CDDS_ITEM | CDDS_POSTPAINT)
#define CDDS_ITEMPREERASE (CDDS_ITEM | CDDS_PREERASE)
#define CDDS_ITEMPOSTERASE (CDDS_ITEM | CDDS_POSTERASE)
#if (_WIN32_IE >= 0x0400)
#define CDDS_SUBITEM 0x00020000
#endif
// itemState flags
#define CDIS_SELECTED 0x0001
#define CDIS_GRAYED 0x0002
#define CDIS_DISABLED 0x0004
#define CDIS_CHECKED 0x0008
#define CDIS_FOCUS 0x0010
#define CDIS_DEFAULT 0x0020
#define CDIS_HOT 0x0040
#define CDIS_MARKED 0x0080
#define CDIS_INDETERMINATE 0x0100
typedef struct tagNMCUSTOMDRAWINFO
{
NMHDR hdr;
DWORD dwDrawStage;
HDC hdc;
RECT rc;
DWORD dwItemSpec; // this is control specific, but it's how to specify an item. valid only with CDDS_ITEM bit set
UINT uItemState;
LPARAM lItemlParam;
} NMCUSTOMDRAW, FAR * LPNMCUSTOMDRAW;
typedef struct tagNMTTCUSTOMDRAW
{
NMCUSTOMDRAW nmcd;
UINT uDrawFlags;
} NMTTCUSTOMDRAW, FAR * LPNMTTCUSTOMDRAW;
#endif // _WIN32_IE >= 0x0300
//====== IMAGE APIS ===========================================================
#ifndef NOIMAGEAPIS
#define CLR_NONE 0xFFFFFFFFL
#define CLR_DEFAULT 0xFF000000L
struct _IMAGELIST;
typedef struct _IMAGELIST NEAR* HIMAGELIST;
#if (_WIN32_IE >= 0x0300)
typedef struct _IMAGELISTDRAWPARAMS {
DWORD cbSize;
HIMAGELIST himl;
int i;
HDC hdcDst;
int x;
int y;
int cx;
int cy;
int xBitmap; // x offest from the upperleft of bitmap
int yBitmap; // y offset from the upperleft of bitmap
COLORREF rgbBk;
COLORREF rgbFg;
UINT fStyle;
DWORD dwRop;
} IMAGELISTDRAWPARAMS, FAR * LPIMAGELISTDRAWPARAMS;
#endif // _WIN32_IE >= 0x0300
#define ILC_MASK 0x0001
#define ILC_COLOR 0x0000
#define ILC_COLORDDB 0x00FE
#define ILC_COLOR4 0x0004
#define ILC_COLOR8 0x0008
#define ILC_COLOR16 0x0010
#define ILC_COLOR24 0x0018
#define ILC_COLOR32 0x0020
#define ILC_PALETTE 0x0800 // (not implemented)
WINCOMMCTRLAPI HIMAGELIST WINAPI ImageList_Create(int cx, int cy, UINT flags, int cInitial, int cGrow);
WINCOMMCTRLAPI BOOL WINAPI ImageList_Destroy(HIMAGELIST himl);
WINCOMMCTRLAPI int WINAPI ImageList_GetImageCount(HIMAGELIST himl);
#if (_WIN32_IE >= 0x0300)
WINCOMMCTRLAPI BOOL WINAPI ImageList_SetImageCount(HIMAGELIST himl, UINT uNewCount);
#endif
WINCOMMCTRLAPI int WINAPI ImageList_Add(HIMAGELIST himl, HBITMAP hbmImage, HBITMAP hbmMask);
WINCOMMCTRLAPI int WINAPI ImageList_ReplaceIcon(HIMAGELIST himl, int i, HICON hicon);
WINCOMMCTRLAPI COLORREF WINAPI ImageList_SetBkColor(HIMAGELIST himl, COLORREF clrBk);
WINCOMMCTRLAPI COLORREF WINAPI ImageList_GetBkColor(HIMAGELIST himl);
WINCOMMCTRLAPI BOOL WINAPI ImageList_SetOverlayImage(HIMAGELIST himl, int iImage, int iOverlay);
#define ImageList_AddIcon(himl, hicon) ImageList_ReplaceIcon(himl, -1, hicon)
#define ILD_NORMAL 0x0000
#define ILD_TRANSPARENT 0x0001
#define ILD_MASK 0x0010
#define ILD_IMAGE 0x0020
#if (_WIN32_IE >= 0x0300)
#define ILD_ROP 0x0040
#endif
#define ILD_BLEND25 0x0002
#define ILD_BLEND50 0x0004
#define ILD_OVERLAYMASK 0x0F00
#define INDEXTOOVERLAYMASK(i) ((i) << 8)
#define ILD_SELECTED ILD_BLEND50
#define ILD_FOCUS ILD_BLEND25
#define ILD_BLEND ILD_BLEND50
#define CLR_HILIGHT CLR_DEFAULT
WINCOMMCTRLAPI BOOL WINAPI ImageList_Draw(HIMAGELIST himl, int i, HDC hdcDst, int x, int y, UINT fStyle);
#ifdef _WIN32
WINCOMMCTRLAPI BOOL WINAPI ImageList_Replace(HIMAGELIST himl, int i, HBITMAP hbmImage, HBITMAP hbmMask);
WINCOMMCTRLAPI int WINAPI ImageList_AddMasked(HIMAGELIST himl, HBITMAP hbmImage, COLORREF crMask);
WINCOMMCTRLAPI BOOL WINAPI ImageList_DrawEx(HIMAGELIST himl, int i, HDC hdcDst, int x, int y, int dx, int dy, COLORREF rgbBk, COLORREF rgbFg, UINT fStyle);
#if (_WIN32_IE >= 0x0300)
WINCOMMCTRLAPI BOOL WINAPI ImageList_DrawIndirect(IMAGELISTDRAWPARAMS* pimldp);
#endif
WINCOMMCTRLAPI BOOL WINAPI ImageList_Remove(HIMAGELIST himl, int i);
WINCOMMCTRLAPI HICON WINAPI ImageList_GetIcon(HIMAGELIST himl, int i, UINT flags);
WINCOMMCTRLAPI HIMAGELIST WINAPI ImageList_LoadImageA(HINSTANCE hi, LPCSTR lpbmp, int cx, int cGrow, COLORREF crMask, UINT uType, UINT uFlags);
WINCOMMCTRLAPI HIMAGELIST WINAPI ImageList_LoadImageW(HINSTANCE hi, LPCWSTR lpbmp, int cx, int cGrow, COLORREF crMask, UINT uType, UINT uFlags);
#ifdef UNICODE
#define ImageList_LoadImage ImageList_LoadImageW
#else
#define ImageList_LoadImage ImageList_LoadImageA
#endif
#if (_WIN32_IE >= 0x0300)
#define ILCF_MOVE (0x00000000)
#define ILCF_SWAP (0x00000001)
WINCOMMCTRLAPI BOOL WINAPI ImageList_Copy(HIMAGELIST himlDst, int iDst, HIMAGELIST himlSrc, int iSrc, UINT uFlags);
#endif
WINCOMMCTRLAPI BOOL WINAPI ImageList_BeginDrag(HIMAGELIST himlTrack, int iTrack, int dxHotspot, int dyHotspot);
WINCOMMCTRLAPI void WINAPI ImageList_EndDrag();
WINCOMMCTRLAPI BOOL WINAPI ImageList_DragEnter(HWND hwndLock, int x, int y);
WINCOMMCTRLAPI BOOL WINAPI ImageList_DragLeave(HWND hwndLock);
WINCOMMCTRLAPI BOOL WINAPI ImageList_DragMove(int x, int y);
WINCOMMCTRLAPI BOOL WINAPI ImageList_SetDragCursorImage(HIMAGELIST himlDrag, int iDrag, int dxHotspot, int dyHotspot);
WINCOMMCTRLAPI BOOL WINAPI ImageList_DragShowNolock(BOOL fShow);
WINCOMMCTRLAPI HIMAGELIST WINAPI ImageList_GetDragImage(POINT FAR* ppt,POINT FAR* pptHotspot);
#define ImageList_RemoveAll(himl) ImageList_Remove(himl, -1)
#define ImageList_ExtractIcon(hi, himl, i) ImageList_GetIcon(himl, i, 0)
#define ImageList_LoadBitmap(hi, lpbmp, cx, cGrow, crMask) ImageList_LoadImage(hi, lpbmp, cx, cGrow, crMask, IMAGE_BITMAP, 0)
#ifdef __IStream_INTERFACE_DEFINED__
WINCOMMCTRLAPI HIMAGELIST WINAPI ImageList_Read(LPSTREAM pstm);
WINCOMMCTRLAPI BOOL WINAPI ImageList_Write(HIMAGELIST himl, LPSTREAM pstm);
#endif
typedef struct _IMAGEINFO
{
HBITMAP hbmImage;
HBITMAP hbmMask;
int Unused1;
int Unused2;
RECT rcImage;
} IMAGEINFO, FAR *LPIMAGEINFO;
WINCOMMCTRLAPI BOOL WINAPI ImageList_GetIconSize(HIMAGELIST himl, int FAR *cx, int FAR *cy);
WINCOMMCTRLAPI BOOL WINAPI ImageList_SetIconSize(HIMAGELIST himl, int cx, int cy);
WINCOMMCTRLAPI BOOL WINAPI ImageList_GetImageInfo(HIMAGELIST himl, int i, IMAGEINFO FAR* pImageInfo);
WINCOMMCTRLAPI HIMAGELIST WINAPI ImageList_Merge(HIMAGELIST himl1, int i1, HIMAGELIST himl2, int i2, int dx, int dy);
#if (_WIN32_IE >= 0x0400)
WINCOMMCTRLAPI HIMAGELIST WINAPI ImageList_Duplicate(HIMAGELIST himl);
#endif
#endif
#endif
//====== HEADER CONTROL =======================================================
#ifndef NOHEADER
#ifdef _WIN32
#define WC_HEADERA "SysHeader32"
#define WC_HEADERW L"SysHeader32"
#ifdef UNICODE
#define WC_HEADER WC_HEADERW
#else
#define WC_HEADER WC_HEADERA
#endif
#else
#define WC_HEADER "SysHeader"
#endif
// begin_r_commctrl
#define HDS_HORZ 0x0000
#define HDS_BUTTONS 0x0002
#if (_WIN32_IE >= 0x0300)
#define HDS_HOTTRACK 0x0004
#endif
#define HDS_HIDDEN 0x0008
#if (_WIN32_IE >= 0x0300)
#define HDS_DRAGDROP 0x0040
#define HDS_FULLDRAG 0x0080
#endif
// end_r_commctrl
#if (_WIN32_IE >= 0x0300)
#define HD_ITEMA HDITEMA
#define HD_ITEMW HDITEMW
#else
#define HDITEMW HD_ITEMW
#define HDITEMA HD_ITEMA
#endif
#define HD_ITEM HDITEM
typedef struct _HD_ITEMA
{
UINT mask;
int cxy;
LPSTR pszText;
HBITMAP hbm;
int cchTextMax;
int fmt;
LPARAM lParam;
#if (_WIN32_IE >= 0x0300)
int iImage; // index of bitmap in ImageList
int iOrder; // where to draw this item
#endif
} HDITEMA, FAR * LPHDITEMA;
#define HDITEMA_V1_SIZE CCSIZEOF_STRUCT(HDITEMA, lParam)
#define HDITEMW_V1_SIZE CCSIZEOF_STRUCT(HDITEMW, lParam)
typedef struct _HD_ITEMW
{
UINT mask;
int cxy;
LPWSTR pszText;
HBITMAP hbm;
int cchTextMax;
int fmt;
LPARAM lParam;
#if (_WIN32_IE >= 0x0300)
int iImage; // index of bitmap in ImageList
int iOrder;
#endif
} HDITEMW, FAR * LPHDITEMW;
#ifdef UNICODE
#define HDITEM HDITEMW
#define LPHDITEM LPHDITEMW
#define HDITEM_V1_SIZE HDITEMW_V1_SIZE
#else
#define HDITEM HDITEMA
#define LPHDITEM LPHDITEMA
#define HDITEM_V1_SIZE HDITEMA_V1_SIZE
#endif
#define HDI_WIDTH 0x0001
#define HDI_HEIGHT HDI_WIDTH
#define HDI_TEXT 0x0002
#define HDI_FORMAT 0x0004
#define HDI_LPARAM 0x0008
#define HDI_BITMAP 0x0010
#if (_WIN32_IE >= 0x0300)
#define HDI_IMAGE 0x0020
#define HDI_DI_SETITEM 0x0040
#define HDI_ORDER 0x0080
#endif
#define HDF_LEFT 0
#define HDF_RIGHT 1
#define HDF_CENTER 2
#define HDF_JUSTIFYMASK 0x0003
#define HDF_RTLREADING 4
#define HDF_OWNERDRAW 0x8000
#define HDF_STRING 0x4000
#define HDF_BITMAP 0x2000
#if (_WIN32_IE >= 0x0300)
#define HDF_BITMAP_ON_RIGHT 0x1000
#define HDF_IMAGE 0x0800
#endif
#define HDM_GETITEMCOUNT (HDM_FIRST + 0)
#define Header_GetItemCount(hwndHD) \
(int)SNDMSG((hwndHD), HDM_GETITEMCOUNT, 0, 0L)
#define HDM_INSERTITEMA (HDM_FIRST + 1)
#define HDM_INSERTITEMW (HDM_FIRST + 10)
#ifdef UNICODE
#define HDM_INSERTITEM HDM_INSERTITEMW
#else
#define HDM_INSERTITEM HDM_INSERTITEMA
#endif
#define Header_InsertItem(hwndHD, i, phdi) \
(int)SNDMSG((hwndHD), HDM_INSERTITEM, (WPARAM)(int)(i), (LPARAM)(const HD_ITEM FAR*)(phdi))
#define HDM_DELETEITEM (HDM_FIRST + 2)
#define Header_DeleteItem(hwndHD, i) \
(BOOL)SNDMSG((hwndHD), HDM_DELETEITEM, (WPARAM)(int)(i), 0L)
#define HDM_GETITEMA (HDM_FIRST + 3)
#define HDM_GETITEMW (HDM_FIRST + 11)
#ifdef UNICODE
#define HDM_GETITEM HDM_GETITEMW
#else
#define HDM_GETITEM HDM_GETITEMA
#endif
#define Header_GetItem(hwndHD, i, phdi) \
(BOOL)SNDMSG((hwndHD), HDM_GETITEM, (WPARAM)(int)(i), (LPARAM)(HD_ITEM FAR*)(phdi))
#define HDM_SETITEMA (HDM_FIRST + 4)
#define HDM_SETITEMW (HDM_FIRST + 12)
#ifdef UNICODE
#define HDM_SETITEM HDM_SETITEMW
#else
#define HDM_SETITEM HDM_SETITEMA
#endif
#define Header_SetItem(hwndHD, i, phdi) \
(BOOL)SNDMSG((hwndHD), HDM_SETITEM, (WPARAM)(int)(i), (LPARAM)(const HD_ITEM FAR*)(phdi))
#if (_WIN32_IE >= 0x0300)
#define HD_LAYOUT HDLAYOUT
#else
#define HDLAYOUT HD_LAYOUT
#endif
typedef struct _HD_LAYOUT
{
RECT FAR* prc;
WINDOWPOS FAR* pwpos;
} HDLAYOUT, FAR *LPHDLAYOUT;
#define HDM_LAYOUT (HDM_FIRST + 5)
#define Header_Layout(hwndHD, playout) \
(BOOL)SNDMSG((hwndHD), HDM_LAYOUT, 0, (LPARAM)(HD_LAYOUT FAR*)(playout))
#define HHT_NOWHERE 0x0001
#define HHT_ONHEADER 0x0002
#define HHT_ONDIVIDER 0x0004
#define HHT_ONDIVOPEN 0x0008
#define HHT_ABOVE 0x0100
#define HHT_BELOW 0x0200
#define HHT_TORIGHT 0x0400
#define HHT_TOLEFT 0x0800
#if (_WIN32_IE >= 0x0300)
#define HD_HITTESTINFO HDHITTESTINFO
#else
#define HDHITTESTINFO HD_HITTESTINFO
#endif
typedef struct _HD_HITTESTINFO
{
POINT pt;
UINT flags;
int iItem;
} HDHITTESTINFO, FAR *LPHDHITTESTINFO;
#define HDM_HITTEST (HDM_FIRST + 6)
#if (_WIN32_IE >= 0x0300)
#define HDM_GETITEMRECT (HDM_FIRST + 7)
#define Header_GetItemRect(hwnd, iItem, lprc) \
(BOOL)SNDMSG((hwnd), HDM_GETITEMRECT, (WPARAM)iItem, (LPARAM)lprc)
#define HDM_SETIMAGELIST (HDM_FIRST + 8)
#define Header_SetImageList(hwnd, himl) \
(HIMAGELIST)SNDMSG((hwnd), HDM_SETIMAGELIST, 0, (LPARAM)himl)
#define HDM_GETIMAGELIST (HDM_FIRST + 9)
#define Header_GetImageList(hwnd) \
(HIMAGELIST)SNDMSG((hwnd), HDM_GETIMAGELIST, 0, 0)
#define HDM_ORDERTOINDEX (HDM_FIRST + 15)
#define Header_OrderToIndex(hwnd, i) \
(int)SNDMSG((hwnd), HDM_ORDERTOINDEX, (WPARAM)i, 0)
#define HDM_CREATEDRAGIMAGE (HDM_FIRST + 16) // wparam = which item (by index)
#define Header_CreateDragImage(hwnd, i) \
(HIMAGELIST)SNDMSG((hwnd), HDM_CREATEDRAGIMAGE, (WPARAM)i, 0)
#define HDM_GETORDERARRAY (HDM_FIRST + 17)
#define Header_GetOrderArray(hwnd, iCount, lpi) \
(BOOL)SNDMSG((hwnd), HDM_GETORDERARRAY, (WPARAM)iCount, (LPARAM)lpi)
#define HDM_SETORDERARRAY (HDM_FIRST + 18)
#define Header_SetOrderArray(hwnd, iCount, lpi) \
(BOOL)SNDMSG((hwnd), HDM_SETORDERARRAY, (WPARAM)iCount, (LPARAM)lpi)
// lparam = int array of size HDM_GETITEMCOUNT
// the array specifies the order that all items should be displayed.
// e.g. { 2, 0, 1}
// says the index 2 item should be shown in the 0ths position
// index 0 should be shown in the 1st position
// index 1 should be shown in the 2nd position
#define HDM_SETHOTDIVIDER (HDM_FIRST + 19)
#define Header_SetHotDivider(hwnd, fPos, dw) \
(int)SNDMSG((hwnd), HDM_SETHOTDIVIDER, (WPARAM)fPos, (LPARAM)dw)
// convenience message for external dragdrop
// wParam = BOOL specifying whether the lParam is a dwPos of the cursor
// position or the index of which divider to hotlight
// lParam = depends on wParam (-1 and wParm = FALSE turns off hotlight)
#endif // _WIN32_IE >= 0x0300
#if (_WIN32_IE >= 0x0400)
#define HDM_SETUNICODEFORMAT CCM_SETUNICODEFORMAT
#define Header_SetUnicodeFormat(hwnd, fUnicode) \
(BOOL)SNDMSG((hwnd), HDM_SETUNICODEFORMAT, (WPARAM)(fUnicode), 0)
#define HDM_GETUNICODEFORMAT CCM_GETUNICODEFORMAT
#define Header_GetUnicodeFormat(hwnd) \
(BOOL)SNDMSG((hwnd), HDM_GETUNICODEFORMAT, 0, 0)
#endif
#define HDN_ITEMCHANGINGA (HDN_FIRST-0)
#define HDN_ITEMCHANGINGW (HDN_FIRST-20)
#define HDN_ITEMCHANGEDA (HDN_FIRST-1)
#define HDN_ITEMCHANGEDW (HDN_FIRST-21)
#define HDN_ITEMCLICKA (HDN_FIRST-2)
#define HDN_ITEMCLICKW (HDN_FIRST-22)
#define HDN_ITEMDBLCLICKA (HDN_FIRST-3)
#define HDN_ITEMDBLCLICKW (HDN_FIRST-23)
#define HDN_DIVIDERDBLCLICKA (HDN_FIRST-5)
#define HDN_DIVIDERDBLCLICKW (HDN_FIRST-25)
#define HDN_BEGINTRACKA (HDN_FIRST-6)
#define HDN_BEGINTRACKW (HDN_FIRST-26)
#define HDN_ENDTRACKA (HDN_FIRST-7)
#define HDN_ENDTRACKW (HDN_FIRST-27)
#define HDN_TRACKA (HDN_FIRST-8)
#define HDN_TRACKW (HDN_FIRST-28)
#if (_WIN32_IE >= 0x0300)
#define HDN_GETDISPINFOA (HDN_FIRST-9)
#define HDN_GETDISPINFOW (HDN_FIRST-29)
#define HDN_BEGINDRAG (HDN_FIRST-10)
#define HDN_ENDDRAG (HDN_FIRST-11)
#endif
#ifdef UNICODE
#define HDN_ITEMCHANGING HDN_ITEMCHANGINGW
#define HDN_ITEMCHANGED HDN_ITEMCHANGEDW
#define HDN_ITEMCLICK HDN_ITEMCLICKW
#define HDN_ITEMDBLCLICK HDN_ITEMDBLCLICKW
#define HDN_DIVIDERDBLCLICK HDN_DIVIDERDBLCLICKW
#define HDN_BEGINTRACK HDN_BEGINTRACKW
#define HDN_ENDTRACK HDN_ENDTRACKW
#define HDN_TRACK HDN_TRACKW
#if (_WIN32_IE >= 0x0300)
#define HDN_GETDISPINFO HDN_GETDISPINFOW
#endif
#else
#define HDN_ITEMCHANGING HDN_ITEMCHANGINGA
#define HDN_ITEMCHANGED HDN_ITEMCHANGEDA
#define HDN_ITEMCLICK HDN_ITEMCLICKA
#define HDN_ITEMDBLCLICK HDN_ITEMDBLCLICKA
#define HDN_DIVIDERDBLCLICK HDN_DIVIDERDBLCLICKA
#define HDN_BEGINTRACK HDN_BEGINTRACKA
#define HDN_ENDTRACK HDN_ENDTRACKA
#define HDN_TRACK HDN_TRACKA
#if (_WIN32_IE >= 0x0300)
#define HDN_GETDISPINFO HDN_GETDISPINFOA
#endif
#endif
#if (_WIN32_IE >= 0x0300)
#define HD_NOTIFYA NMHEADERA
#define HD_NOTIFYW NMHEADERW
#else
#define tagNMHEADERA _HD_NOTIFY
#define NMHEADERA HD_NOTIFYA
#define tagHMHEADERW _HD_NOTIFYW
#define NMHEADERW HD_NOTIFYW
#endif
#define HD_NOTIFY NMHEADER
typedef struct tagNMHEADERA
{
NMHDR hdr;
int iItem;
int iButton;
HDITEMA FAR* pitem;
} NMHEADERA, FAR* LPNMHEADERA;
typedef struct tagNMHEADERW
{
NMHDR hdr;
int iItem;
int iButton;
HDITEMW FAR* pitem;
} NMHEADERW, FAR* LPNMHEADERW;
#ifdef UNICODE
#define NMHEADER NMHEADERW
#define LPNMHEADER LPNMHEADERW
#else
#define NMHEADER NMHEADERA
#define LPNMHEADER LPNMHEADERA
#endif
typedef struct tagNMHDDISPINFOW
{
NMHDR hdr;
int iItem;
UINT mask;
LPWSTR pszText;
int cchTextMax;
int iImage;
LPARAM lParam;
} NMHDDISPINFOW, FAR* LPNMHDDISPINFOW;
typedef struct tagNMHDDISPINFOA
{
NMHDR hdr;
int iItem;
UINT mask;
LPSTR pszText;
int cchTextMax;
int iImage;
LPARAM lParam;
} NMHDDISPINFOA, FAR* LPNMHDDISPINFOA;
#ifdef UNICODE
#define NMHDDISPINFO NMHDDISPINFOW
#define LPNMHDDISPINFO LPNMHDDISPINFOW
#else
#define NMHDDISPINFO NMHDDISPINFOA
#define LPNMHDDISPINFO LPNMHDDISPINFOA
#endif
#endif // NOHEADER
//====== TOOLBAR CONTROL ======================================================
#ifndef NOTOOLBAR
#ifdef _WIN32
#define TOOLBARCLASSNAMEW L"ToolbarWindow32"
#define TOOLBARCLASSNAMEA "ToolbarWindow32"
#ifdef UNICODE
#define TOOLBARCLASSNAME TOOLBARCLASSNAMEW
#else
#define TOOLBARCLASSNAME TOOLBARCLASSNAMEA
#endif
#else
#define TOOLBARCLASSNAME "ToolbarWindow"
#endif
typedef struct _TBBUTTON {
int iBitmap;
int idCommand;
BYTE fsState;
BYTE fsStyle;
#ifdef _WIN32
BYTE bReserved[2];
#endif
DWORD dwData;
int iString;
} TBBUTTON, NEAR* PTBBUTTON, FAR* LPTBBUTTON;
typedef const TBBUTTON FAR* LPCTBBUTTON;
typedef struct _COLORMAP {
COLORREF from;
COLORREF to;
} COLORMAP, FAR* LPCOLORMAP;
WINCOMMCTRLAPI HWND WINAPI CreateToolbarEx(HWND hwnd, DWORD ws, UINT wID, int nBitmaps,
HINSTANCE hBMInst, UINT wBMID, LPCTBBUTTON lpButtons,
int iNumButtons, int dxButton, int dyButton,
int dxBitmap, int dyBitmap, UINT uStructSize);
WINCOMMCTRLAPI HBITMAP WINAPI CreateMappedBitmap(HINSTANCE hInstance, int idBitmap,
UINT wFlags, LPCOLORMAP lpColorMap,
int iNumMaps);
#define CMB_MASKED 0x02
#define TBSTATE_CHECKED 0x01
#define TBSTATE_PRESSED 0x02
#define TBSTATE_ENABLED 0x04
#define TBSTATE_HIDDEN 0x08
#define TBSTATE_INDETERMINATE 0x10
#define TBSTATE_WRAP 0x20
#if (_WIN32_IE >= 0x0300)
#define TBSTATE_ELLIPSES 0x40
#endif
#if (_WIN32_IE >= 0x0400)
#define TBSTATE_MARKED 0x80
#endif
#define TBSTYLE_BUTTON 0x0000
#define TBSTYLE_SEP 0x0001
#define TBSTYLE_CHECK 0x0002
#define TBSTYLE_GROUP 0x0004
#define TBSTYLE_CHECKGROUP (TBSTYLE_GROUP | TBSTYLE_CHECK)
#if (_WIN32_IE >= 0x0300)
#define TBSTYLE_DROPDOWN 0x0008
#endif
#if (_WIN32_IE >= 0x0400)
#define TBSTYLE_AUTOSIZE 0x0010 // automatically calculate the cx of the button
#define TBSTYLE_NOPREFIX 0x0020 // if this button should not have accel prefix
#endif
#define TBSTYLE_TOOLTIPS 0x0100
#define TBSTYLE_WRAPABLE 0x0200
#define TBSTYLE_ALTDRAG 0x0400
#if (_WIN32_IE >= 0x0300)
#define TBSTYLE_FLAT 0x0800
#define TBSTYLE_LIST 0x1000
#define TBSTYLE_CUSTOMERASE 0x2000
#endif
#if (_WIN32_IE >= 0x0400)
#define TBSTYLE_REGISTERDROP 0x4000
#define TBSTYLE_TRANSPARENT 0x8000
#define TBSTYLE_EX_DRAWDDARROWS 0x00000001
#endif
#if (_WIN32_IE >= 0x0400)
// Custom Draw Structure
typedef struct _NMTBCUSTOMDRAW {
NMCUSTOMDRAW nmcd;
HBRUSH hbrMonoDither;
HBRUSH hbrLines; // For drawing lines on buttons
HPEN hpenLines; // For drawing lines on buttons
COLORREF clrText; // Color of text
COLORREF clrMark; // Color of text bk when marked. (only if TBSTATE_MARKED)
COLORREF clrTextHighlight; // Color of text when highlighted
COLORREF clrBtnFace; // Background of the button
COLORREF clrBtnHighlight; // 3D highlight
COLORREF clrHighlightHotTrack; // In conjunction with fHighlightHotTrack
// will cause button to highlight like a menu
RECT rcText; // Rect for text
int nStringBkMode;
int nHLStringBkMode;
} NMTBCUSTOMDRAW, * LPNMTBCUSTOMDRAW;
// Toolbar custom draw return flags
#define TBCDRF_NOEDGES 0x00010000 // Don't draw button edges
#define TBCDRF_HILITEHOTTRACK 0x00020000 // Use color of the button bk when hottracked
#define TBCDRF_NOOFFSET 0x00040000 // Don't offset button if pressed
#define TBCDRF_NOMARK 0x00080000 // Don't draw default highlight of image/text for TBSTATE_MARKED
#define TBCDRF_NOETCHEDEFFECT 0x00100000 // Don't draw etched effect for disabled items
#endif
#define TB_ENABLEBUTTON (WM_USER + 1)
#define TB_CHECKBUTTON (WM_USER + 2)
#define TB_PRESSBUTTON (WM_USER + 3)
#define TB_HIDEBUTTON (WM_USER + 4)
#define TB_INDETERMINATE (WM_USER + 5)
#if (_WIN32_IE >= 0x0400)
#define TB_MARKBUTTON (WM_USER + 6)
#endif
#define TB_ISBUTTONENABLED (WM_USER + 9)
#define TB_ISBUTTONCHECKED (WM_USER + 10)
#define TB_ISBUTTONPRESSED (WM_USER + 11)
#define TB_ISBUTTONHIDDEN (WM_USER + 12)
#define TB_ISBUTTONINDETERMINATE (WM_USER + 13)
#if (_WIN32_IE >= 0x0400)
#define TB_ISBUTTONHIGHLIGHTED (WM_USER + 14)
#endif
#define TB_SETSTATE (WM_USER + 17)
#define TB_GETSTATE (WM_USER + 18)
#define TB_ADDBITMAP (WM_USER + 19)
#ifdef _WIN32
typedef struct tagTBADDBITMAP {
HINSTANCE hInst;
UINT nID;
} TBADDBITMAP, *LPTBADDBITMAP;
#define HINST_COMMCTRL ((HINSTANCE)-1)
#define IDB_STD_SMALL_COLOR 0
#define IDB_STD_LARGE_COLOR 1
#define IDB_VIEW_SMALL_COLOR 4
#define IDB_VIEW_LARGE_COLOR 5
#if (_WIN32_IE >= 0x0300)
#define IDB_HIST_SMALL_COLOR 8
#define IDB_HIST_LARGE_COLOR 9
#endif
// icon indexes for standard bitmap
#define STD_CUT 0
#define STD_COPY 1
#define STD_PASTE 2
#define STD_UNDO 3
#define STD_REDOW 4
#define STD_DELETE 5
#define STD_FILENEW 6
#define STD_FILEOPEN 7
#define STD_FILESAVE 8
#define STD_PRINTPRE 9
#define STD_PROPERTIES 10
#define STD_HELP 11
#define STD_FIND 12
#define STD_REPLACE 13
#define STD_PRINT 14
// icon indexes for standard view bitmap
#define VIEW_LARGEICONS 0
#define VIEW_SMALLICONS 1
#define VIEW_LIST 2
#define VIEW_DETAILS 3
#define VIEW_SORTNAME 4
#define VIEW_SORTSIZE 5
#define VIEW_SORTDATE 6
#define VIEW_SORTTYPE 7
#define VIEW_PARENTFOLDER 8
#define VIEW_NETCONNECT 9
#define VIEW_NETDISCONNECT 10
#define VIEW_NEWFOLDER 11
#if (_WIN32_IE >= 0x0400)
#define VIEW_VIEWMENU 12
#endif
#if (_WIN32_IE >= 0x0300)
#define HIST_BACK 0
#define HIST_FORWARD 1
#define HIST_FAVORITES 2
#define HIST_ADDTOFAVORITES 3
#define HIST_VIEWTREE 4
#endif
#endif
#if (_WIN32_IE >= 0x0400)
#define TB_ADDBUTTONSA (WM_USER + 20)
#define TB_INSERTBUTTONA (WM_USER + 21)
#else
#define TB_ADDBUTTONS (WM_USER + 20)
#define TB_INSERTBUTTON (WM_USER + 21)
#endif
#define TB_DELETEBUTTON (WM_USER + 22)
#define TB_GETBUTTON (WM_USER + 23)
#define TB_BUTTONCOUNT (WM_USER + 24)
#define TB_COMMANDTOINDEX (WM_USER + 25)
#ifdef _WIN32
typedef struct tagTBSAVEPARAMSA {
HKEY hkr;
LPCSTR pszSubKey;
LPCSTR pszValueName;
} TBSAVEPARAMSA, FAR* LPTBSAVEPARAMSA;
typedef struct tagTBSAVEPARAMSW {
HKEY hkr;
LPCWSTR pszSubKey;
LPCWSTR pszValueName;
} TBSAVEPARAMSW, FAR *LPTBSAVEPARAMW;
#ifdef UNICODE
#define TBSAVEPARAMS TBSAVEPARAMSW
#define LPTBSAVEPARAMS LPTBSAVEPARAMSW
#else
#define TBSAVEPARAMS TBSAVEPARAMSA
#define LPTBSAVEPARAMS LPTBSAVEPARAMSA
#endif
#endif // _WIN32
#define TB_SAVERESTOREA (WM_USER + 26)
#define TB_SAVERESTOREW (WM_USER + 76)
#define TB_CUSTOMIZE (WM_USER + 27)
#define TB_ADDSTRINGA (WM_USER + 28)
#define TB_ADDSTRINGW (WM_USER + 77)
#define TB_GETITEMRECT (WM_USER + 29)
#define TB_BUTTONSTRUCTSIZE (WM_USER + 30)
#define TB_SETBUTTONSIZE (WM_USER + 31)
#define TB_SETBITMAPSIZE (WM_USER + 32)
#define TB_AUTOSIZE (WM_USER + 33)
#define TB_GETTOOLTIPS (WM_USER + 35)
#define TB_SETTOOLTIPS (WM_USER + 36)
#define TB_SETPARENT (WM_USER + 37)
#define TB_SETROWS (WM_USER + 39)
#define TB_GETROWS (WM_USER + 40)
#define TB_SETCMDID (WM_USER + 42)
#define TB_CHANGEBITMAP (WM_USER + 43)
#define TB_GETBITMAP (WM_USER + 44)
#define TB_GETBUTTONTEXTA (WM_USER + 45)
#define TB_GETBUTTONTEXTW (WM_USER + 75)
#define TB_REPLACEBITMAP (WM_USER + 46)
#if (_WIN32_IE >= 0x0300)
#define TB_SETINDENT (WM_USER + 47)
#define TB_SETIMAGELIST (WM_USER + 48)
#define TB_GETIMAGELIST (WM_USER + 49)
#define TB_LOADIMAGES (WM_USER + 50)
#define TB_GETRECT (WM_USER + 51) // wParam is the Cmd instead of index
#define TB_SETHOTIMAGELIST (WM_USER + 52)
#define TB_GETHOTIMAGELIST (WM_USER + 53)
#define TB_SETDISABLEDIMAGELIST (WM_USER + 54)
#define TB_GETDISABLEDIMAGELIST (WM_USER + 55)
#define TB_SETSTYLE (WM_USER + 56)
#define TB_GETSTYLE (WM_USER + 57)
#define TB_GETBUTTONSIZE (WM_USER + 58)
#define TB_SETBUTTONWIDTH (WM_USER + 59)
#define TB_SETMAXTEXTROWS (WM_USER + 60)
#define TB_GETTEXTROWS (WM_USER + 61)
#endif // _WIN32_IE >= 0x0300
#ifdef UNICODE
#define TB_GETBUTTONTEXT TB_GETBUTTONTEXTW
#define TB_SAVERESTORE TB_SAVERESTOREW
#define TB_ADDSTRING TB_ADDSTRINGW
#else
#define TB_GETBUTTONTEXT TB_GETBUTTONTEXTA
#define TB_SAVERESTORE TB_SAVERESTOREA
#define TB_ADDSTRING TB_ADDSTRINGA
#endif
#if (_WIN32_IE >= 0x0400)
#define TB_GETOBJECT (WM_USER + 62) // wParam == IID, lParam void **ppv
#define TB_GETHOTITEM (WM_USER + 71)
#define TB_SETHOTITEM (WM_USER + 72) // wParam == iHotItem
#define TB_SETANCHORHIGHLIGHT (WM_USER + 73) // wParam == TRUE/FALSE
#define TB_GETANCHORHIGHLIGHT (WM_USER + 74)
#define TB_MAPACCELERATORA (WM_USER + 78) // wParam == ch, lParam int * pidBtn
typedef struct {
int iButton;
DWORD dwFlags;
} TBINSERTMARK, * LPTBINSERTMARK;
#define TBIMHT_AFTER 0x00000001 // TRUE = insert After iButton, otherwise before
#define TBIMHT_BACKGROUND 0x00000002 // TRUE iff missed buttons completely
#define TB_GETINSERTMARK (WM_USER + 79) // lParam == LPTBINSERTMARK
#define TB_SETINSERTMARK (WM_USER + 80) // lParam == LPTBINSERTMARK
#define TB_INSERTMARKHITTEST (WM_USER + 81) // wParam == LPPOINT lParam == LPTBINSERTMARK
#define TB_MOVEBUTTON (WM_USER + 82)
#define TB_GETMAXSIZE (WM_USER + 83) // lParam == LPSIZE
#define TB_SETEXTENDEDSTYLE (WM_USER + 84) // For TBSTYLE_EX_*
#define TB_GETEXTENDEDSTYLE (WM_USER + 85) // For TBSTYLE_EX_*
#define TB_GETPADDING (WM_USER + 86)
#define TB_SETPADDING (WM_USER + 87)
#define TB_SETINSERTMARKCOLOR (WM_USER + 88)
#define TB_GETINSERTMARKCOLOR (WM_USER + 89)
#define TB_SETCOLORSCHEME CCM_SETCOLORSCHEME // lParam is color scheme
#define TB_GETCOLORSCHEME CCM_GETCOLORSCHEME // fills in COLORSCHEME pointed to by lParam
#define TB_SETUNICODEFORMAT CCM_SETUNICODEFORMAT
#define TB_GETUNICODEFORMAT CCM_GETUNICODEFORMAT
#define TB_MAPACCELERATORW (WM_USER + 90) // wParam == ch, lParam int * pidBtn
#ifdef UNICODE
#define TB_MAPACCELERATOR TB_MAPACCELERATORW
#else
#define TB_MAPACCELERATOR TB_MAPACCELERATORA
#endif
#endif // _WIN32_IE >= 0x0400
typedef struct {
HINSTANCE hInstOld;
UINT nIDOld;
HINSTANCE hInstNew;
UINT nIDNew;
int nButtons;
} TBREPLACEBITMAP, *LPTBREPLACEBITMAP;
#ifdef _WIN32
#define TBBF_LARGE 0x0001
#define TB_GETBITMAPFLAGS (WM_USER + 41)
#if (_WIN32_IE >= 0x0400)
#define TBIF_IMAGE 0x00000001
#define TBIF_TEXT 0x00000002
#define TBIF_STATE 0x00000004
#define TBIF_STYLE 0x00000008
#define TBIF_LPARAM 0x00000010
#define TBIF_COMMAND 0x00000020
#define TBIF_SIZE 0x00000040
typedef struct {
UINT cbSize;
DWORD dwMask;
int idCommand;
int iImage;
BYTE fsState;
BYTE fsStyle;
WORD cx;
DWORD lParam;
LPSTR pszText;
int cchText;
} TBBUTTONINFOA, *LPTBBUTTONINFOA;
typedef struct {
UINT cbSize;
DWORD dwMask;
int idCommand;
int iImage;
BYTE fsState;
BYTE fsStyle;
WORD cx;
DWORD lParam;
LPWSTR pszText;
int cchText;
} TBBUTTONINFOW, *LPTBBUTTONINFOW;
#ifdef UNICODE
#define TBBUTTONINFO TBBUTTONINFOW
#define LPTBBUTTONINFO LPTBBUTTONINFOW
#else
#define TBBUTTONINFO TBBUTTONINFOA
#define LPTBBUTTONINFO LPTBBUTTONINFOA
#endif
// BUTTONINFO APIs do NOT support the string pool.
#define TB_GETBUTTONINFOW (WM_USER + 63)
#define TB_SETBUTTONINFOW (WM_USER + 64)
#define TB_GETBUTTONINFOA (WM_USER + 65)
#define TB_SETBUTTONINFOA (WM_USER + 66)
#ifdef UNICODE
#define TB_GETBUTTONINFO TB_GETBUTTONINFOW
#define TB_SETBUTTONINFO TB_SETBUTTONINFOW
#else
#define TB_GETBUTTONINFO TB_GETBUTTONINFOA
#define TB_SETBUTTONINFO TB_SETBUTTONINFOA
#endif
#define TB_INSERTBUTTONW (WM_USER + 67)
#define TB_ADDBUTTONSW (WM_USER + 68)
#define TB_HITTEST (WM_USER + 69)
// New post Win95/NT4 for InsertButton and AddButton. if iString member
// is a pointer to a string, it will be handled as a string like listview
// (although LPSTR_TEXTCALLBACK is not supported).
#ifdef UNICODE
#define TB_INSERTBUTTON TB_INSERTBUTTONW
#define TB_ADDBUTTONS TB_ADDBUTTONSW
#else
#define TB_INSERTBUTTON TB_INSERTBUTTONA
#define TB_ADDBUTTONS TB_ADDBUTTONSA
#endif
#define TB_SETDRAWTEXTFLAGS (WM_USER + 70) // wParam == mask lParam == bit values
#endif // _WIN32_IE >= 0x0400
#define TBN_GETBUTTONINFOA (TBN_FIRST-0)
#define TBN_GETBUTTONINFOW (TBN_FIRST-20)
#define TBN_BEGINDRAG (TBN_FIRST-1)
#define TBN_ENDDRAG (TBN_FIRST-2)
#define TBN_BEGINADJUST (TBN_FIRST-3)
#define TBN_ENDADJUST (TBN_FIRST-4)
#define TBN_RESET (TBN_FIRST-5)
#define TBN_QUERYINSERT (TBN_FIRST-6)
#define TBN_QUERYDELETE (TBN_FIRST-7)
#define TBN_TOOLBARCHANGE (TBN_FIRST-8)
#define TBN_CUSTHELP (TBN_FIRST-9)
#if (_WIN32_IE >= 0x0300)
#define TBN_DROPDOWN (TBN_FIRST - 10)
#endif
#if (_WIN32_IE >= 0x0400)
#define TBN_GETOBJECT (TBN_FIRST - 12)
// Structure for TBN_HOTITEMCHANGE notification
//
typedef struct tagNMTBHOTITEM
{
NMHDR hdr;
int idOld;
int idNew;
DWORD dwFlags; // HICF_*
} NMTBHOTITEM, * LPNMTBHOTITEM;
// Hot item change flags
#define HICF_OTHER 0x00000000
#define HICF_MOUSE 0x00000001 // Triggered by mouse
#define HICF_ARROWKEYS 0x00000002 // Triggered by arrow keys
#define HICF_ACCELERATOR 0x00000004 // Triggered by accelerator
#define HICF_DUPACCEL 0x00000008 // This accelerator is not unique
#define HICF_ENTERING 0x00000010 // idOld is invalid
#define HICF_LEAVING 0x00000020 // idNew is invalid
#define HICF_RESELECT 0x00000040 // hot item reselected
#define TBN_HOTITEMCHANGE (TBN_FIRST - 13)
#define TBN_DRAGOUT (TBN_FIRST - 14) // this is sent when the user clicks down on a button then drags off the button
#define TBN_DELETINGBUTTON (TBN_FIRST - 15) // uses TBNOTIFY
#define TBN_GETDISPINFOA (TBN_FIRST - 16) // This is sent when the toolbar needs some display information
#define TBN_GETDISPINFOW (TBN_FIRST - 17) // This is sent when the toolbar needs some display information
#define TBN_GETINFOTIPA (TBN_FIRST - 18)
#define TBN_GETINFOTIPW (TBN_FIRST - 19)
typedef struct tagNMTBGETINFOTIPA
{
NMHDR hdr;
LPSTR pszText;
int cchTextMax;
int iItem;
LPARAM lParam;
} NMTBGETINFOTIPA, *LPNMTBGETINFOTIPA;
typedef struct tagNMTBGETINFOTIPW
{
NMHDR hdr;
LPWSTR pszText;
int cchTextMax;
int iItem;
LPARAM lParam;
} NMTBGETINFOTIPW, *LPNMTBGETINFOTIPW;
#ifdef UNICODE
#define TBN_GETINFOTIP TBN_GETINFOTIPW
#define NMTBGETINFOTIP NMTBGETINFOTIPW
#define LPNMTBGETINFOTIP LPNMTBGETINFOTIPW
#else
#define TBN_GETINFOTIP TBN_GETINFOTIPA
#define NMTBGETINFOTIP NMTBGETINFOTIPA
#define LPNMTBGETINFOTIP LPNMTBGETINFOTIPA
#endif
#define TBNF_IMAGE 0x00000001
#define TBNF_TEXT 0x00000002
#define TBNF_DI_SETITEM 0x10000000
typedef struct {
NMHDR hdr;
DWORD dwMask; // [in] Specifies the values requested .[out] Client ask the data to be set for future use
int idCommand; // [in] id of button we're requesting info for
DWORD lParam; // [in] lParam of button
int iImage; // [out] image index
LPSTR pszText; // [out] new text for item
int cchText; // [in] size of buffer pointed to by pszText
} NMTBDISPINFOA, *LPNMTBDISPINFOA;
typedef struct {
NMHDR hdr;
DWORD dwMask; //[in] Specifies the values requested .[out] Client ask the data to be set for future use
int idCommand; // [in] id of button we're requesting info for
DWORD lParam; // [in] lParam of button
int iImage; // [out] image index
LPWSTR pszText; // [out] new text for item
int cchText; // [in] size of buffer pointed to by pszText
} NMTBDISPINFOW, *LPNMTBDISPINFOW;
#ifdef UNICODE
#define TBN_GETDISPINFO TBN_GETDISPINFOW
#define NMTBDISPINFO NMTBDISPINFOW
#define LPNMTBDISPINFO LPNMTBDISPINFOW
#else
#define TBN_GETDISPINFO TBN_GETDISPINFOA
#define NMTBDISPINFO NMTBDISPINFOA
#define LPNMTBDISPINFO LPNMTBDISPINFOA
#endif
// Return codes for TBN_DROPDOWN
#define TBDDRET_DEFAULT 0
#define TBDDRET_NODEFAULT 1
#define TBDDRET_TREATPRESSED 2 // Treat as a standard press button
#endif
#ifdef UNICODE
#define TBN_GETBUTTONINFO TBN_GETBUTTONINFOW
#else
#define TBN_GETBUTTONINFO TBN_GETBUTTONINFOA
#endif
#if (_WIN32_IE >= 0x0300)
#define TBNOTIFYA NMTOOLBARA
#define TBNOTIFYW NMTOOLBARW
#define LPTBNOTIFYA LPNMTOOLBARA
#define LPTBNOTIFYW LPNMTOOLBARW
#else
#define tagNMTOOLBARA tagTBNOTIFYA
#define NMTOOLBARA TBNOTIFYA
#define LPNMTOOLBARA LPTBNOTIFYA
#define tagNMTOOLBARW tagTBNOTIFYW
#define NMTOOLBARW TBNOTIFYW
#define LPNMTOOLBARW LPTBNOTIFYW
#endif
#define TBNOTIFY NMTOOLBAR
#define LPTBNOTIFY LPNMTOOLBAR
#if (_WIN32_IE >= 0x0300)
typedef struct tagNMTOOLBARA {
NMHDR hdr;
int iItem;
TBBUTTON tbButton;
int cchText;
LPSTR pszText;
} NMTOOLBARA, FAR* LPNMTOOLBARA;
#endif
#if (_WIN32_IE >= 0x0300)
typedef struct tagNMTOOLBARW {
NMHDR hdr;
int iItem;
TBBUTTON tbButton;
int cchText;
LPWSTR pszText;
} NMTOOLBARW, FAR* LPNMTOOLBARW;
#endif
#ifdef UNICODE
#define NMTOOLBAR NMTOOLBARW
#define LPNMTOOLBAR LPNMTOOLBARW
#else
#define NMTOOLBAR NMTOOLBARA
#define LPNMTOOLBAR LPNMTOOLBARA
#endif
#endif
#endif // NOTOOLBAR
#if (_WIN32_IE >= 0x0300)
//====== REBAR CONTROL ========================================================
#ifndef NOREBAR
#ifdef _WIN32
#define REBARCLASSNAMEW L"ReBarWindow32"
#define REBARCLASSNAMEA "ReBarWindow32"
#ifdef UNICODE
#define REBARCLASSNAME REBARCLASSNAMEW
#else
#define REBARCLASSNAME REBARCLASSNAMEA
#endif
#else
#define REBARCLASSNAME "ReBarWindow"
#endif
#define RBIM_IMAGELIST 0x00000001
#if (_WIN32_IE >= 0x0400)
#define RBS_TOOLTIPS 0x0100
#define RBS_VARHEIGHT 0x0200
#define RBS_BANDBORDERS 0x0400
#define RBS_FIXEDORDER 0x0800
#define RBS_REGISTERDROP 0x1000
#define RBS_AUTOSIZE 0x2000
#define RBS_VERTICALGRIPPER 0x4000 // this always has the vertical gripper (default for horizontal mode)
#define RBS_DBLCLKTOGGLE 0x8000
#else
#define RBS_TOOLTIPS 0x00000100
#define RBS_VARHEIGHT 0x00000200
#define RBS_BANDBORDERS 0x00000400
#define RBS_FIXEDORDER 0x00000800
#endif // _WIN32_IE >= 0x0400
typedef struct tagREBARINFO
{
UINT cbSize;
UINT fMask;
#ifndef NOIMAGEAPIS
HIMAGELIST himl;
#else
HANDLE himl;
#endif
} REBARINFO, FAR *LPREBARINFO;
#define RBBS_BREAK 0x00000001 // break to new line
#define RBBS_FIXEDSIZE 0x00000002 // band can't be sized
#define RBBS_CHILDEDGE 0x00000004 // edge around top & bottom of child window
#define RBBS_HIDDEN 0x00000008 // don't show
#define RBBS_NOVERT 0x00000010 // don't show when vertical
#define RBBS_FIXEDBMP 0x00000020 // bitmap doesn't move during band resize
#if (_WIN32_IE >= 0x0400)
#define RBBS_VARIABLEHEIGHT 0x00000040 // allow autosizing of this child vertically
#define RBBS_GRIPPERALWAYS 0x00000080 // always show the gripper
#define RBBS_NOGRIPPER 0x00000100 // never show the gripper
#endif
#define RBBIM_STYLE 0x00000001
#define RBBIM_COLORS 0x00000002
#define RBBIM_TEXT 0x00000004
#define RBBIM_IMAGE 0x00000008
#define RBBIM_CHILD 0x00000010
#define RBBIM_CHILDSIZE 0x00000020
#define RBBIM_SIZE 0x00000040
#define RBBIM_BACKGROUND 0x00000080
#define RBBIM_ID 0x00000100
#if (_WIN32_IE >= 0x0400)
#define RBBIM_IDEALSIZE 0x00000200
#define RBBIM_LPARAM 0x00000400
#define RBBIM_HEADERSIZE 0x00000800 // control the size of the header
#endif
typedef struct tagREBARBANDINFOA
{
UINT cbSize;
UINT fMask;
UINT fStyle;
COLORREF clrFore;
COLORREF clrBack;
LPSTR lpText;
UINT cch;
int iImage;
HWND hwndChild;
UINT cxMinChild;
UINT cyMinChild;
UINT cx;
HBITMAP hbmBack;
UINT wID;
#if (_WIN32_IE >= 0x0400)
UINT cyChild;
UINT cyMaxChild;
UINT cyIntegral;
UINT cxIdeal;
LPARAM lParam;
UINT cxHeader;
#endif
} REBARBANDINFOA, FAR *LPREBARBANDINFOA;
typedef REBARBANDINFOA CONST FAR *LPCREBARBANDINFOA;
#define REBARBANDINFOA_V3_SIZE CCSIZEOF_STRUCT(REBARBANDINFOA, wID)
#define REBARBANDINFOW_V3_SIZE CCSIZEOF_STRUCT(REBARBANDINFOW, wID)
typedef struct tagREBARBANDINFOW
{
UINT cbSize;
UINT fMask;
UINT fStyle;
COLORREF clrFore;
COLORREF clrBack;
LPWSTR lpText;
UINT cch;
int iImage;
HWND hwndChild;
UINT cxMinChild;
UINT cyMinChild;
UINT cx;
HBITMAP hbmBack;
UINT wID;
#if (_WIN32_IE >= 0x0400)
UINT cyChild;
UINT cyMaxChild;
UINT cyIntegral;
UINT cxIdeal;
LPARAM lParam;
UINT cxHeader;
#endif
} REBARBANDINFOW, FAR *LPREBARBANDINFOW;
typedef REBARBANDINFOW CONST FAR *LPCREBARBANDINFOW;
#ifdef UNICODE
#define REBARBANDINFO REBARBANDINFOW
#define LPREBARBANDINFO LPREBARBANDINFOW
#define LPCREBARBANDINFO LPCREBARBANDINFOW
#define REBARBANDINFO_V3_SIZE REBARBANDINFOW_V3_SIZE
#else
#define REBARBANDINFO REBARBANDINFOA
#define LPREBARBANDINFO LPREBARBANDINFOA
#define LPCREBARBANDINFO LPCREBARBANDINFOA
#define REBARBANDINFO_V3_SIZE REBARBANDINFOA_V3_SIZE
#endif
#define RB_INSERTBANDA (WM_USER + 1)
#define RB_DELETEBAND (WM_USER + 2)
#define RB_GETBARINFO (WM_USER + 3)
#define RB_SETBARINFO (WM_USER + 4)
#if (_WIN32_IE < 0x0400)
#define RB_GETBANDINFO (WM_USER + 5)
#endif
#define RB_SETBANDINFOA (WM_USER + 6)
#define RB_SETPARENT (WM_USER + 7)
#if (_WIN32_IE >= 0x0400)
#define RB_HITTEST (WM_USER + 8)
#define RB_GETRECT (WM_USER + 9)
#endif
#define RB_INSERTBANDW (WM_USER + 10)
#define RB_SETBANDINFOW (WM_USER + 11)
#define RB_GETBANDCOUNT (WM_USER + 12)
#define RB_GETROWCOUNT (WM_USER + 13)
#define RB_GETROWHEIGHT (WM_USER + 14)
#if (_WIN32_IE >= 0x0400)
#define RB_IDTOINDEX (WM_USER + 16) // wParam == id
#define RB_GETTOOLTIPS (WM_USER + 17)
#define RB_SETTOOLTIPS (WM_USER + 18)
#define RB_SETBKCOLOR (WM_USER + 19) // sets the default BK color
#define RB_GETBKCOLOR (WM_USER + 20) // defaults to CLR_NONE
#define RB_SETTEXTCOLOR (WM_USER + 21)
#define RB_GETTEXTCOLOR (WM_USER + 22) // defaults to 0x00000000
#define RB_SIZETORECT (WM_USER + 23) // resize the rebar/break bands and such to this rect (lparam)
#endif // _WIN32_IE >= 0x0400
#define RB_SETCOLORSCHEME CCM_SETCOLORSCHEME // lParam is color scheme
#define RB_GETCOLORSCHEME CCM_GETCOLORSCHEME // fills in COLORSCHEME pointed to by lParam
#ifdef UNICODE
#define RB_INSERTBAND RB_INSERTBANDW
#define RB_SETBANDINFO RB_SETBANDINFOW
#else
#define RB_INSERTBAND RB_INSERTBANDA
#define RB_SETBANDINFO RB_SETBANDINFOA
#endif
#if (_WIN32_IE >= 0x0400)
// for manual drag control
// lparam == cursor pos
// -1 means do it yourself.
// -2 means use what you had saved before
#define RB_BEGINDRAG (WM_USER + 24)
#define RB_ENDDRAG (WM_USER + 25)
#define RB_DRAGMOVE (WM_USER + 26)
#define RB_GETBARHEIGHT (WM_USER + 27)
#define RB_GETBANDINFOW (WM_USER + 28)
#define RB_GETBANDINFOA (WM_USER + 29)
#ifdef UNICODE
#define RB_GETBANDINFO RB_GETBANDINFOW
#else
#define RB_GETBANDINFO RB_GETBANDINFOA
#endif
#define RB_MINIMIZEBAND (WM_USER + 30)
#define RB_MAXIMIZEBAND (WM_USER + 31)
#define RB_GETDROPTARGET (CCM_GETDROPTARGET)
#define RB_GETBANDBORDERS (WM_USER + 34) // returns in lparam = lprc the amount of edges added to band wparam
#define RB_SHOWBAND (WM_USER + 35) // show/hide band
#define RB_SETPALETTE (WM_USER + 37)
#define RB_GETPALETTE (WM_USER + 38)
#define RB_MOVEBAND (WM_USER + 39)
#define RB_SETUNICODEFORMAT CCM_SETUNICODEFORMAT
#define RB_GETUNICODEFORMAT CCM_GETUNICODEFORMAT
#endif // _WIN32_IE >= 0x0400
#define RBN_HEIGHTCHANGE (RBN_FIRST - 0)
#if (_WIN32_IE >= 0x0400)
#define RBN_GETOBJECT (RBN_FIRST - 1)
#define RBN_LAYOUTCHANGED (RBN_FIRST - 2)
#define RBN_AUTOSIZE (RBN_FIRST - 3)
#define RBN_BEGINDRAG (RBN_FIRST - 4)
#define RBN_ENDDRAG (RBN_FIRST - 5)
#define RBN_DELETINGBAND (RBN_FIRST - 6) // Uses NMREBAR
#define RBN_DELETEDBAND (RBN_FIRST - 7) // Uses NMREBAR
#define RBN_CHILDSIZE (RBN_FIRST - 8)
typedef struct tagNMREBARCHILDSIZE
{
NMHDR hdr;
UINT uBand;
UINT wID;
RECT rcChild;
RECT rcBand;
} NMREBARCHILDSIZE, *LPNMREBARCHILDSIZE;
typedef struct tagNMREBAR
{
NMHDR hdr;
DWORD dwMask; // RBNM_*
UINT uBand;
UINT fStyle;
UINT wID;
LPARAM lParam;
} NMREBAR, *LPNMREBAR;
// Mask flags for NMREBAR
#define RBNM_ID 0x00000001
#define RBNM_STYLE 0x00000002
#define RBNM_LPARAM 0x00000004
typedef struct tagNMRBAUTOSIZE
{
NMHDR hdr;
BOOL fChanged;
RECT rcTarget;
RECT rcActual;
} NMRBAUTOSIZE, *LPNMRBAUTOSIZE;
#define RBHT_NOWHERE 0x0001
#define RBHT_CAPTION 0x0002
#define RBHT_CLIENT 0x0003
#define RBHT_GRABBER 0x0004
typedef struct _RB_HITTESTINFO
{
POINT pt;
UINT flags;
int iBand;
} RBHITTESTINFO, FAR *LPRBHITTESTINFO;
#endif // _WIN32_IE >= 0x0400
#endif // NOREBAR
#endif // _WIN32_IE >= 0x0300
//====== TOOLTIPS CONTROL =====================================================
#ifndef NOTOOLTIPS
#ifdef _WIN32
#define TOOLTIPS_CLASSW L"tooltips_class32"
#define TOOLTIPS_CLASSA "tooltips_class32"
#ifdef UNICODE
#define TOOLTIPS_CLASS TOOLTIPS_CLASSW
#else
#define TOOLTIPS_CLASS TOOLTIPS_CLASSA
#endif
#else
#define TOOLTIPS_CLASS "tooltips_class"
#endif
#if (_WIN32_IE >= 0x0300)
#define LPTOOLINFOA LPTTTOOLINFOA
#define LPTOOLINFOW LPTTTOOLINFOW
#define TOOLINFOA TTTOOLINFOA
#define TOOLINFOW TTTOOLINFOW
#else
#define TTTOOLINFOA TOOLINFOA
#define LPTTTOOLINFOA LPTOOLINFOA
#define TTTOOLINFOW TOOLINFOW
#define LPTTTOOLINFOW LPTOOLINFOW
#endif
#define LPTOOLINFO LPTTTOOLINFO
#define TOOLINFO TTTOOLINFO
#define TTTOOLINFOA_V1_SIZE CCSIZEOF_STRUCT(TTTOOLINFOA, lpszText)
#define TTTOOLINFOW_V1_SIZE CCSIZEOF_STRUCT(TTTOOLINFOW, lpszText)
typedef struct tagTOOLINFOA {
UINT cbSize;
UINT uFlags;
HWND hwnd;
UINT uId;
RECT rect;
HINSTANCE hinst;
LPSTR lpszText;
#if (_WIN32_IE >= 0x0300)
LPARAM lParam;
#endif
} TTTOOLINFOA, NEAR *PTOOLINFOA, FAR *LPTTTOOLINFOA;
typedef struct tagTOOLINFOW {
UINT cbSize;
UINT uFlags;
HWND hwnd;
UINT uId;
RECT rect;
HINSTANCE hinst;
LPWSTR lpszText;
#if (_WIN32_IE >= 0x0300)
LPARAM lParam;
#endif
} TTTOOLINFOW, NEAR *PTOOLINFOW, FAR* LPTTTOOLINFOW;
#ifdef UNICODE
#define TTTOOLINFO TTTOOLINFOW
#define PTOOLINFO PTOOLINFOW
#define LPTTTOOLINFO LPTTTOOLINFOW
#define TTTOOLINFO_V1_SIZE TTTOOLINFOW_V1_SIZE
#else
#define PTOOLINFO PTOOLINFOA
#define TTTOOLINFO TTTOOLINFOA
#define LPTTTOOLINFO LPTTTOOLINFOA
#define TTTOOLINFO_V1_SIZE TTTOOLINFOA_V1_SIZE
#endif
// begin_r_commctrl
#define TTS_ALWAYSTIP 0x01
#define TTS_NOPREFIX 0x02
// end_r_commctrl
#define TTF_IDISHWND 0x0001
// Use this to center around trackpoint in trackmode
// -OR- to center around tool in normal mode.
// Use TTF_ABSOLUTE to place the tip exactly at the track coords when
// in tracking mode. TTF_ABSOLUTE can be used in conjunction with TTF_CENTERTIP
// to center the tip absolutely about the track point.
#define TTF_CENTERTIP 0x0002
#define TTF_RTLREADING 0x0004
#define TTF_SUBCLASS 0x0010
#if (_WIN32_IE >= 0x0300)
#define TTF_TRACK 0x0020
#define TTF_ABSOLUTE 0x0080
#define TTF_TRANSPARENT 0x0100
#define TTF_DI_SETITEM 0x8000 // valid only on the TTN_NEEDTEXT callback
#endif // _WIN32_IE >= 0x0300
#define TTDT_AUTOMATIC 0
#define TTDT_RESHOW 1
#define TTDT_AUTOPOP 2
#define TTDT_INITIAL 3
#define TTM_ACTIVATE (WM_USER + 1)
#define TTM_SETDELAYTIME (WM_USER + 3)
#define TTM_ADDTOOLA (WM_USER + 4)
#define TTM_ADDTOOLW (WM_USER + 50)
#define TTM_DELTOOLA (WM_USER + 5)
#define TTM_DELTOOLW (WM_USER + 51)
#define TTM_NEWTOOLRECTA (WM_USER + 6)
#define TTM_NEWTOOLRECTW (WM_USER + 52)
#define TTM_RELAYEVENT (WM_USER + 7)
#define TTM_GETTOOLINFOA (WM_USER + 8)
#define TTM_GETTOOLINFOW (WM_USER + 53)
#define TTM_SETTOOLINFOA (WM_USER + 9)
#define TTM_SETTOOLINFOW (WM_USER + 54)
#define TTM_HITTESTA (WM_USER +10)
#define TTM_HITTESTW (WM_USER +55)
#define TTM_GETTEXTA (WM_USER +11)
#define TTM_GETTEXTW (WM_USER +56)
#define TTM_UPDATETIPTEXTA (WM_USER +12)
#define TTM_UPDATETIPTEXTW (WM_USER +57)
#define TTM_GETTOOLCOUNT (WM_USER +13)
#define TTM_ENUMTOOLSA (WM_USER +14)
#define TTM_ENUMTOOLSW (WM_USER +58)
#define TTM_GETCURRENTTOOLA (WM_USER + 15)
#define TTM_GETCURRENTTOOLW (WM_USER + 59)
#define TTM_WINDOWFROMPOINT (WM_USER + 16)
#if (_WIN32_IE >= 0x0300)
#define TTM_TRACKACTIVATE (WM_USER + 17) // wParam = TRUE/FALSE start end lparam = LPTOOLINFO
#define TTM_TRACKPOSITION (WM_USER + 18) // lParam = dwPos
#define TTM_SETTIPBKCOLOR (WM_USER + 19)
#define TTM_SETTIPTEXTCOLOR (WM_USER + 20)
#define TTM_GETDELAYTIME (WM_USER + 21)
#define TTM_GETTIPBKCOLOR (WM_USER + 22)
#define TTM_GETTIPTEXTCOLOR (WM_USER + 23)
#define TTM_SETMAXTIPWIDTH (WM_USER + 24)
#define TTM_GETMAXTIPWIDTH (WM_USER + 25)
#define TTM_SETMARGIN (WM_USER + 26) // lParam = lprc
#define TTM_GETMARGIN (WM_USER + 27) // lParam = lprc
#define TTM_POP (WM_USER + 28)
#endif
#if (_WIN32_IE >= 0x0400)
#define TTM_UPDATE (WM_USER + 29)
#endif
#ifdef UNICODE
#define TTM_ADDTOOL TTM_ADDTOOLW
#define TTM_DELTOOL TTM_DELTOOLW
#define TTM_NEWTOOLRECT TTM_NEWTOOLRECTW
#define TTM_GETTOOLINFO TTM_GETTOOLINFOW
#define TTM_SETTOOLINFO TTM_SETTOOLINFOW
#define TTM_HITTEST TTM_HITTESTW
#define TTM_GETTEXT TTM_GETTEXTW
#define TTM_UPDATETIPTEXT TTM_UPDATETIPTEXTW
#define TTM_ENUMTOOLS TTM_ENUMTOOLSW
#define TTM_GETCURRENTTOOL TTM_GETCURRENTTOOLW
#else
#define TTM_ADDTOOL TTM_ADDTOOLA
#define TTM_DELTOOL TTM_DELTOOLA
#define TTM_NEWTOOLRECT TTM_NEWTOOLRECTA
#define TTM_GETTOOLINFO TTM_GETTOOLINFOA
#define TTM_SETTOOLINFO TTM_SETTOOLINFOA
#define TTM_HITTEST TTM_HITTESTA
#define TTM_GETTEXT TTM_GETTEXTA
#define TTM_UPDATETIPTEXT TTM_UPDATETIPTEXTA
#define TTM_ENUMTOOLS TTM_ENUMTOOLSA
#define TTM_GETCURRENTTOOL TTM_GETCURRENTTOOLA
#endif
#if (_WIN32_IE >= 0x0300)
#define LPHITTESTINFOW LPTTHITTESTINFOW
#define LPHITTESTINFOA LPTTHITTESTINFOA
#else
#define LPTTHITTESTINFOA LPHITTESTINFOA
#define LPTTHITTESTINFOW LPHITTESTINFOW
#endif
#define LPHITTESTINFO LPTTHITTESTINFO
typedef struct _TT_HITTESTINFOA {
HWND hwnd;
POINT pt;
TTTOOLINFOA ti;
} TTHITTESTINFOA, FAR * LPTTHITTESTINFOA;
typedef struct _TT_HITTESTINFOW {
HWND hwnd;
POINT pt;
TTTOOLINFOW ti;
} TTHITTESTINFOW, FAR * LPTTHITTESTINFOW;
#ifdef UNICODE
#define TTHITTESTINFO TTHITTESTINFOW
#define LPTTHITTESTINFO LPTTHITTESTINFOW
#else
#define TTHITTESTINFO TTHITTESTINFOA
#define LPTTHITTESTINFO LPTTHITTESTINFOA
#endif
#define TTN_GETDISPINFOA (TTN_FIRST - 0)
#define TTN_GETDISPINFOW (TTN_FIRST - 10)
#define TTN_SHOW (TTN_FIRST - 1)
#define TTN_POP (TTN_FIRST - 2)
#ifdef UNICODE
#define TTN_GETDISPINFO TTN_GETDISPINFOW
#else
#define TTN_GETDISPINFO TTN_GETDISPINFOA
#endif
#define TTN_NEEDTEXT TTN_GETDISPINFO
#define TTN_NEEDTEXTA TTN_GETDISPINFOA
#define TTN_NEEDTEXTW TTN_GETDISPINFOW
#if (_WIN32_IE >= 0x0300)
#define TOOLTIPTEXTW NMTTDISPINFOW
#define TOOLTIPTEXTA NMTTDISPINFOA
#define LPTOOLTIPTEXTA LPNMTTDISPINFOA
#define LPTOOLTIPTEXTW LPNMTTDISPINFOW
#else
#define tagNMTTDISPINFOA tagTOOLTIPTEXTA
#define NMTTDISPINFOA TOOLTIPTEXTA
#define LPNMTTDISPINFOA LPTOOLTIPTEXTA
#define tagNMTTDISPINFOW tagTOOLTIPTEXTW
#define NMTTDISPINFOW TOOLTIPTEXTW
#define LPNMTTDISPINFOW LPTOOLTIPTEXTW
#endif
#define TOOLTIPTEXT NMTTDISPINFO
#define LPTOOLTIPTEXT LPNMTTDISPINFO
#define NMTTDISPINFOA_V1_SIZE CCSIZEOF_STRUCT(NMTTDISPINFOA, uFlags)
#define NMTTDISPINFOW_V1_SIZE CCSIZEOF_STRUCT(NMTTDISPINFOW, uFlags)
typedef struct tagNMTTDISPIFNOA {
NMHDR hdr;
LPSTR lpszText;
char szText[80];
HINSTANCE hinst;
UINT uFlags;
#if (_WIN32_IE >= 0x0300)
LPARAM lParam;
#endif
} NMTTDISPINFOA, FAR *LPNMTTDISPINFOA;
typedef struct tagNMTTDISPINFOW {
NMHDR hdr;
LPWSTR lpszText;
WCHAR szText[80];
HINSTANCE hinst;
UINT uFlags;
#if (_WIN32_IE >= 0x0300)
LPARAM lParam;
#endif
} NMTTDISPINFOW, FAR *LPNMTTDISPINFOW;
#ifdef UNICODE
#define NMTTDISPINFO NMTTDISPINFOW
#define LPNMTTDISPINFO LPNMTTDISPINFOW
#define NMTTDISPINFO_V1_SIZE NMTTDISPINFOW_V1_SIZE
#else
#define NMTTDISPINFO NMTTDISPINFOA
#define LPNMTTDISPINFO LPNMTTDISPINFOA
#define NMTTDISPINFO_V1_SIZE NMTTDISPINFOA_V1_SIZE
#endif
#endif // NOTOOLTIPS
//====== STATUS BAR CONTROL ===================================================
#ifndef NOSTATUSBAR
// begin_r_commctrl
#define SBARS_SIZEGRIP 0x0100
// end_r_commctrl
WINCOMMCTRLAPI void WINAPI DrawStatusTextA(HDC hDC, LPRECT lprc, LPCSTR pszText, UINT uFlags);
WINCOMMCTRLAPI void WINAPI DrawStatusTextW(HDC hDC, LPRECT lprc, LPCWSTR pszText, UINT uFlags);
WINCOMMCTRLAPI HWND WINAPI CreateStatusWindowA(LONG style, LPCSTR lpszText, HWND hwndParent, UINT wID);
WINCOMMCTRLAPI HWND WINAPI CreateStatusWindowW(LONG style, LPCWSTR lpszText, HWND hwndParent, UINT wID);
#ifdef UNICODE
#define CreateStatusWindow CreateStatusWindowW
#define DrawStatusText DrawStatusTextW
#else
#define CreateStatusWindow CreateStatusWindowA
#define DrawStatusText DrawStatusTextA
#endif
#ifdef _WIN32
#define STATUSCLASSNAMEW L"msctls_statusbar32"
#define STATUSCLASSNAMEA "msctls_statusbar32"
#ifdef UNICODE
#define STATUSCLASSNAME STATUSCLASSNAMEW
#else
#define STATUSCLASSNAME STATUSCLASSNAMEA
#endif
#else
#define STATUSCLASSNAME "msctls_statusbar"
#endif
#define SB_SETTEXTA (WM_USER+1)
#define SB_SETTEXTW (WM_USER+11)
#define SB_GETTEXTA (WM_USER+2)
#define SB_GETTEXTW (WM_USER+13)
#define SB_GETTEXTLENGTHA (WM_USER+3)
#define SB_GETTEXTLENGTHW (WM_USER+12)
#ifdef UNICODE
#define SB_GETTEXT SB_GETTEXTW
#define SB_SETTEXT SB_SETTEXTW
#define SB_GETTEXTLENGTH SB_GETTEXTLENGTHW
#if (_WIN32_IE >= 0x0400)
#define SB_SETTIPTEXT SB_SETTIPTEXTW
#define SB_GETTIPTEXT SB_GETTIPTEXTW
#endif
#else
#define SB_GETTEXT SB_GETTEXTA
#define SB_SETTEXT SB_SETTEXTA
#define SB_GETTEXTLENGTH SB_GETTEXTLENGTHA
#if (_WIN32_IE >= 0x0400)
#define SB_SETTIPTEXT SB_SETTIPTEXTA
#define SB_GETTIPTEXT SB_GETTIPTEXTA
#endif
#endif
#define SB_SETPARTS (WM_USER+4)
#define SB_GETPARTS (WM_USER+6)
#define SB_GETBORDERS (WM_USER+7)
#define SB_SETMINHEIGHT (WM_USER+8)
#define SB_SIMPLE (WM_USER+9)
#define SB_GETRECT (WM_USER+10)
#if (_WIN32_IE >= 0x0300)
#define SB_ISSIMPLE (WM_USER+14)
#endif
#if (_WIN32_IE >= 0x0400)
#define SB_SETICON (WM_USER+15)
#define SB_SETTIPTEXTA (WM_USER+16)
#define SB_SETTIPTEXTW (WM_USER+17)
#define SB_GETTIPTEXTA (WM_USER+18)
#define SB_GETTIPTEXTW (WM_USER+19)
#define SB_GETICON (WM_USER+20)
#define SB_SETUNICODEFORMAT CCM_SETUNICODEFORMAT
#define SB_GETUNICODEFORMAT CCM_GETUNICODEFORMAT
#endif
#define SBT_OWNERDRAW 0x1000
#define SBT_NOBORDERS 0x0100
#define SBT_POPOUT 0x0200
#define SBT_RTLREADING 0x0400
#if (_WIN32_IE >= 0x0400)
#define SBT_TOOLTIPS 0x0800
#endif
#define SB_SETBKCOLOR CCM_SETBKCOLOR // lParam = bkColor
/// status bar notifications
#if (_WIN32_IE >= 0x0400)
#define SBN_SIMPLEMODECHANGE (SBN_FIRST - 0)
#endif
#endif // NOSTATUSBAR
//====== MENU HELP ============================================================
#ifndef NOMENUHELP
WINCOMMCTRLAPI void WINAPI MenuHelp(UINT uMsg, WPARAM wParam, LPARAM lParam, HMENU hMainMenu, HINSTANCE hInst, HWND hwndStatus, UINT FAR *lpwIDs);
WINCOMMCTRLAPI BOOL WINAPI ShowHideMenuCtl(HWND hWnd, UINT uFlags, LPINT lpInfo);
WINCOMMCTRLAPI void WINAPI GetEffectiveClientRect(HWND hWnd, LPRECT lprc, LPINT lpInfo);
#define MINSYSCOMMAND SC_SIZE
#endif
//====== TRACKBAR CONTROL =====================================================
#ifndef NOTRACKBAR
#ifdef _WIN32
#define TRACKBAR_CLASSA "msctls_trackbar32"
#define TRACKBAR_CLASSW L"msctls_trackbar32"
#ifdef UNICODE
#define TRACKBAR_CLASS TRACKBAR_CLASSW
#else
#define TRACKBAR_CLASS TRACKBAR_CLASSA
#endif
#else
#define TRACKBAR_CLASS "msctls_trackbar"
#endif
// begin_r_commctrl
#define TBS_AUTOTICKS 0x0001
#define TBS_VERT 0x0002
#define TBS_HORZ 0x0000
#define TBS_TOP 0x0004
#define TBS_BOTTOM 0x0000
#define TBS_LEFT 0x0004
#define TBS_RIGHT 0x0000
#define TBS_BOTH 0x0008
#define TBS_NOTICKS 0x0010
#define TBS_ENABLESELRANGE 0x0020
#define TBS_FIXEDLENGTH 0x0040
#define TBS_NOTHUMB 0x0080
#if (_WIN32_IE >= 0x0300)
#define TBS_TOOLTIPS 0x0100
#endif
// end_r_commctrl
#define TBM_GETPOS (WM_USER)
#define TBM_GETRANGEMIN (WM_USER+1)
#define TBM_GETRANGEMAX (WM_USER+2)
#define TBM_GETTIC (WM_USER+3)
#define TBM_SETTIC (WM_USER+4)
#define TBM_SETPOS (WM_USER+5)
#define TBM_SETRANGE (WM_USER+6)
#define TBM_SETRANGEMIN (WM_USER+7)
#define TBM_SETRANGEMAX (WM_USER+8)
#define TBM_CLEARTICS (WM_USER+9)
#define TBM_SETSEL (WM_USER+10)
#define TBM_SETSELSTART (WM_USER+11)
#define TBM_SETSELEND (WM_USER+12)
#define TBM_GETPTICS (WM_USER+14)
#define TBM_GETTICPOS (WM_USER+15)
#define TBM_GETNUMTICS (WM_USER+16)
#define TBM_GETSELSTART (WM_USER+17)
#define TBM_GETSELEND (WM_USER+18)
#define TBM_CLEARSEL (WM_USER+19)
#define TBM_SETTICFREQ (WM_USER+20)
#define TBM_SETPAGESIZE (WM_USER+21)
#define TBM_GETPAGESIZE (WM_USER+22)
#define TBM_SETLINESIZE (WM_USER+23)
#define TBM_GETLINESIZE (WM_USER+24)
#define TBM_GETTHUMBRECT (WM_USER+25)
#define TBM_GETCHANNELRECT (WM_USER+26)
#define TBM_SETTHUMBLENGTH (WM_USER+27)
#define TBM_GETTHUMBLENGTH (WM_USER+28)
#if (_WIN32_IE >= 0x0300)
#define TBM_SETTOOLTIPS (WM_USER+29)
#define TBM_GETTOOLTIPS (WM_USER+30)
#define TBM_SETTIPSIDE (WM_USER+31)
// TrackBar Tip Side flags
#define TBTS_TOP 0
#define TBTS_LEFT 1
#define TBTS_BOTTOM 2
#define TBTS_RIGHT 3
#define TBM_SETBUDDY (WM_USER+32) // wparam = BOOL fLeft; (or right)
#define TBM_GETBUDDY (WM_USER+33) // wparam = BOOL fLeft; (or right)
#endif
#if (_WIN32_IE >= 0x0400)
#define TBM_SETUNICODEFORMAT CCM_SETUNICODEFORMAT
#define TBM_GETUNICODEFORMAT CCM_GETUNICODEFORMAT
#endif
#define TB_LINEUP 0
#define TB_LINEDOWN 1
#define TB_PAGEUP 2
#define TB_PAGEDOWN 3
#define TB_THUMBPOSITION 4
#define TB_THUMBTRACK 5
#define TB_TOP 6
#define TB_BOTTOM 7
#define TB_ENDTRACK 8
#if (_WIN32_IE >= 0x0300)
// custom draw item specs
#define TBCD_TICS 0x0001
#define TBCD_THUMB 0x0002
#define TBCD_CHANNEL 0x0003
#endif
#endif // trackbar
//====== DRAG LIST CONTROL ====================================================
#ifndef NODRAGLIST
typedef struct tagDRAGLISTINFO {
UINT uNotification;
HWND hWnd;
POINT ptCursor;
} DRAGLISTINFO, FAR *LPDRAGLISTINFO;
#define DL_BEGINDRAG (WM_USER+133)
#define DL_DRAGGING (WM_USER+134)
#define DL_DROPPED (WM_USER+135)
#define DL_CANCELDRAG (WM_USER+136)
#define DL_CURSORSET 0
#define DL_STOPCURSOR 1
#define DL_COPYCURSOR 2
#define DL_MOVECURSOR 3
#define DRAGLISTMSGSTRING TEXT("commctrl_DragListMsg")
WINCOMMCTRLAPI BOOL WINAPI MakeDragList(HWND hLB);
WINCOMMCTRLAPI void WINAPI DrawInsert(HWND handParent, HWND hLB, int nItem);
WINCOMMCTRLAPI int WINAPI LBItemFromPt(HWND hLB, POINT pt, BOOL bAutoScroll);
#endif
//====== UPDOWN CONTROL =======================================================
#ifndef NOUPDOWN
#ifdef _WIN32
#define UPDOWN_CLASSA "msctls_updown32"
#define UPDOWN_CLASSW L"msctls_updown32"
#ifdef UNICODE
#define UPDOWN_CLASS UPDOWN_CLASSW
#else
#define UPDOWN_CLASS UPDOWN_CLASSA
#endif
#else
#define UPDOWN_CLASS "msctls_updown"
#endif
typedef struct _UDACCEL {
UINT nSec;
UINT nInc;
} UDACCEL, FAR *LPUDACCEL;
#define UD_MAXVAL 0x7fff
#define UD_MINVAL (-UD_MAXVAL)
// begin_r_commctrl
#define UDS_WRAP 0x0001
#define UDS_SETBUDDYINT 0x0002
#define UDS_ALIGNRIGHT 0x0004
#define UDS_ALIGNLEFT 0x0008
#define UDS_AUTOBUDDY 0x0010
#define UDS_ARROWKEYS 0x0020
#define UDS_HORZ 0x0040
#define UDS_NOTHOUSANDS 0x0080
#if (_WIN32_IE >= 0x0300)
#define UDS_HOTTRACK 0x0100
#endif
// end_r_commctrl
#define UDM_SETRANGE (WM_USER+101)
#define UDM_GETRANGE (WM_USER+102)
#define UDM_SETPOS (WM_USER+103)
#define UDM_GETPOS (WM_USER+104)
#define UDM_SETBUDDY (WM_USER+105)
#define UDM_GETBUDDY (WM_USER+106)
#define UDM_SETACCEL (WM_USER+107)
#define UDM_GETACCEL (WM_USER+108)
#define UDM_SETBASE (WM_USER+109)
#define UDM_GETBASE (WM_USER+110)
#if (_WIN32_IE >= 0x0400)
#define UDM_SETRANGE32 (WM_USER+111)
#define UDM_GETRANGE32 (WM_USER+112) // wParam & lParam are LPINT
#define UDM_SETUNICODEFORMAT CCM_SETUNICODEFORMAT
#define UDM_GETUNICODEFORMAT CCM_GETUNICODEFORMAT
#endif
WINCOMMCTRLAPI HWND WINAPI CreateUpDownControl(DWORD dwStyle, int x, int y, int cx, int cy,
HWND hParent, int nID, HINSTANCE hInst,
HWND hBuddy,
int nUpper, int nLower, int nPos);
#if (_WIN32_IE >= 0x0300)
#define NM_UPDOWN NMUPDOWN
#define LPNM_UPDOWN LPNMUPDOWN
#else
#define NMUPDOWN NM_UPDOWN
#define LPNMUPDOWN LPNM_UPDOWN
#endif
typedef struct _NM_UPDOWN
{
NMHDR hdr;
int iPos;
int iDelta;
} NMUPDOWN, FAR *LPNMUPDOWN;
#define UDN_DELTAPOS (UDN_FIRST - 1)
#endif // NOUPDOWN
//====== PROGRESS CONTROL =====================================================
#ifndef NOPROGRESS
#ifdef _WIN32
#define PROGRESS_CLASSA "msctls_progress32"
#define PROGRESS_CLASSW L"msctls_progress32"
#ifdef UNICODE
#define PROGRESS_CLASS PROGRESS_CLASSW
#else
#define PROGRESS_CLASS PROGRESS_CLASSA
#endif
#else
#define PROGRESS_CLASS "msctls_progress"
#endif
#if (_WIN32_IE >= 0x0300)
#define PBS_SMOOTH 0x01
#define PBS_VERTICAL 0x04
#endif
#define PBM_SETRANGE (WM_USER+1)
#define PBM_SETPOS (WM_USER+2)
#define PBM_DELTAPOS (WM_USER+3)
#define PBM_SETSTEP (WM_USER+4)
#define PBM_STEPIT (WM_USER+5)
#if (_WIN32_IE >= 0x0300)
#define PBM_SETRANGE32 (WM_USER+6) // lParam = high, wParam = low
typedef struct
{
int iLow;
int iHigh;
} PBRANGE, *PPBRANGE;
#define PBM_GETRANGE (WM_USER+7) // wParam = return (TRUE ? low : high). lParam = PPBRANGE or NULL
#define PBM_GETPOS (WM_USER+8)
#if (_WIN32_IE >= 0x0400)
#define PBM_SETBARCOLOR (WM_USER+9) // lParam = bar color
#endif // _WIN32_IE >= 0x0400
#define PBM_SETBKCOLOR CCM_SETBKCOLOR // lParam = bkColor
#endif // _WIN32_IE >= 0x0300
#endif // NOPROGRESS
//====== HOTKEY CONTROL =======================================================
#ifndef NOHOTKEY
#define HOTKEYF_SHIFT 0x01
#define HOTKEYF_CONTROL 0x02
#define HOTKEYF_ALT 0x04
#ifdef _MAC
#define HOTKEYF_EXT 0x80
#else
#define HOTKEYF_EXT 0x08
#endif
#define HKCOMB_NONE 0x0001
#define HKCOMB_S 0x0002
#define HKCOMB_C 0x0004
#define HKCOMB_A 0x0008
#define HKCOMB_SC 0x0010
#define HKCOMB_SA 0x0020
#define HKCOMB_CA 0x0040
#define HKCOMB_SCA 0x0080
#define HKM_SETHOTKEY (WM_USER+1)
#define HKM_GETHOTKEY (WM_USER+2)
#define HKM_SETRULES (WM_USER+3)
#ifdef _WIN32
#define HOTKEY_CLASSA "msctls_hotkey32"
#define HOTKEY_CLASSW L"msctls_hotkey32"
#ifdef UNICODE
#define HOTKEY_CLASS HOTKEY_CLASSW
#else
#define HOTKEY_CLASS HOTKEY_CLASSA
#endif
#else
#define HOTKEY_CLASS "msctls_hotkey"
#endif
#endif // NOHOTKEY
// begin_r_commctrl
//====== COMMON CONTROL STYLES ================================================
#define CCS_TOP 0x00000001L
#define CCS_NOMOVEY 0x00000002L
#define CCS_BOTTOM 0x00000003L
#define CCS_NORESIZE 0x00000004L
#define CCS_NOPARENTALIGN 0x00000008L
#define CCS_ADJUSTABLE 0x00000020L
#define CCS_NODIVIDER 0x00000040L
#if (_WIN32_IE >= 0x0300)
#define CCS_VERT 0x00000080L
#define CCS_LEFT (CCS_VERT | CCS_TOP)
#define CCS_RIGHT (CCS_VERT | CCS_BOTTOM)
#define CCS_NOMOVEX (CCS_VERT | CCS_NOMOVEY)
#endif
// end_r_commctrl
//====== LISTVIEW CONTROL =====================================================
#ifndef NOLISTVIEW
#ifdef _WIN32
#define WC_LISTVIEWA "SysListView32"
#define WC_LISTVIEWW L"SysListView32"
#ifdef UNICODE
#define WC_LISTVIEW WC_LISTVIEWW
#else
#define WC_LISTVIEW WC_LISTVIEWA
#endif
#else
#define WC_LISTVIEW "SysListView"
#endif
// begin_r_commctrl
#define LVS_ICON 0x0000
#define LVS_REPORT 0x0001
#define LVS_SMALLICON 0x0002
#define LVS_LIST 0x0003
#define LVS_TYPEMASK 0x0003
#define LVS_SINGLESEL 0x0004
#define LVS_SHOWSELALWAYS 0x0008
#define LVS_SORTASCENDING 0x0010
#define LVS_SORTDESCENDING 0x0020
#define LVS_SHAREIMAGELISTS 0x0040
#define LVS_NOLABELWRAP 0x0080
#define LVS_AUTOARRANGE 0x0100
#define LVS_EDITLABELS 0x0200
#if (_WIN32_IE >= 0x0300)
#define LVS_OWNERDATA 0x1000
#endif
#define LVS_NOSCROLL 0x2000
#define LVS_TYPESTYLEMASK 0xfc00
#define LVS_ALIGNTOP 0x0000
#define LVS_ALIGNLEFT 0x0800
#define LVS_ALIGNMASK 0x0c00
#define LVS_OWNERDRAWFIXED 0x0400
#define LVS_NOCOLUMNHEADER 0x4000
#define LVS_NOSORTHEADER 0x8000
// end_r_commctrl
#if (_WIN32_IE >= 0x0400)
#define LVM_SETUNICODEFORMAT CCM_SETUNICODEFORMAT
#define ListView_SetUnicodeFormat(hwnd, fUnicode) \
(BOOL)SNDMSG((hwnd), LVM_SETUNICODEFORMAT, (WPARAM)(fUnicode), 0)
#define LVM_GETUNICODEFORMAT CCM_GETUNICODEFORMAT
#define ListView_GetUnicodeFormat(hwnd) \
(BOOL)SNDMSG((hwnd), LVM_GETUNICODEFORMAT, 0, 0)
#endif
#define LVM_GETBKCOLOR (LVM_FIRST + 0)
#define ListView_GetBkColor(hwnd) \
(COLORREF)SNDMSG((hwnd), LVM_GETBKCOLOR, 0, 0L)
#define LVM_SETBKCOLOR (LVM_FIRST + 1)
#define ListView_SetBkColor(hwnd, clrBk) \
(BOOL)SNDMSG((hwnd), LVM_SETBKCOLOR, 0, (LPARAM)(COLORREF)(clrBk))
#define LVM_GETIMAGELIST (LVM_FIRST + 2)
#define ListView_GetImageList(hwnd, iImageList) \
(HIMAGELIST)SNDMSG((hwnd), LVM_GETIMAGELIST, (WPARAM)(INT)(iImageList), 0L)
#define LVSIL_NORMAL 0
#define LVSIL_SMALL 1
#define LVSIL_STATE 2
#define LVM_SETIMAGELIST (LVM_FIRST + 3)
#define ListView_SetImageList(hwnd, himl, iImageList) \
(HIMAGELIST)(UINT)SNDMSG((hwnd), LVM_SETIMAGELIST, (WPARAM)(iImageList), (LPARAM)(UINT)(HIMAGELIST)(himl))
#define LVM_GETITEMCOUNT (LVM_FIRST + 4)
#define ListView_GetItemCount(hwnd) \
(int)SNDMSG((hwnd), LVM_GETITEMCOUNT, 0, 0L)
#define LVIF_TEXT 0x0001
#define LVIF_IMAGE 0x0002
#define LVIF_PARAM 0x0004
#define LVIF_STATE 0x0008
#if (_WIN32_IE >= 0x0300)
#define LVIF_INDENT 0x0010
#define LVIF_NORECOMPUTE 0x0800
#endif
#define LVIS_FOCUSED 0x0001
#define LVIS_SELECTED 0x0002
#define LVIS_CUT 0x0004
#define LVIS_DROPHILITED 0x0008
#define LVIS_ACTIVATING 0x0020
#define LVIS_OVERLAYMASK 0x0F00
#define LVIS_STATEIMAGEMASK 0xF000
#define INDEXTOSTATEIMAGEMASK(i) ((i) << 12)
#if (_WIN32_IE >= 0x0300)
#define I_INDENTCALLBACK (-1)
#define LV_ITEMA LVITEMA
#define LV_ITEMW LVITEMW
#else
#define tagLVITEMA _LV_ITEMA
#define LVITEMA LV_ITEMA
#define tagLVITEMW _LV_ITEMW
#define LVITEMW LV_ITEMW
#endif
#define LV_ITEM LVITEM
#define LVITEMA_V1_SIZE CCSIZEOF_STRUCT(LVITEMA, lParam)
#define LVITEMW_V1_SIZE CCSIZEOF_STRUCT(LVITEMW, lParam)
typedef struct tagLVITEMA
{
UINT mask;
int iItem;
int iSubItem;
UINT state;
UINT stateMask;
LPSTR pszText;
int cchTextMax;
int iImage;
LPARAM lParam;
#if (_WIN32_IE >= 0x0300)
int iIndent;
#endif
} LVITEMA, FAR* LPLVITEMA;
typedef struct tagLVITEMW
{
UINT mask;
int iItem;
int iSubItem;
UINT state;
UINT stateMask;
LPWSTR pszText;
int cchTextMax;
int iImage;
LPARAM lParam;
#if (_WIN32_IE >= 0x0300)
int iIndent;
#endif
} LVITEMW, FAR* LPLVITEMW;
#ifdef UNICODE
#define LVITEM LVITEMW
#define LPLVITEM LPLVITEMW
#define LVITEM_V1_SIZE LVITEMW_V1_SIZE
#else
#define LVITEM LVITEMA
#define LPLVITEM LPLVITEMA
#define LVITEM_V1_SIZE LVITEMA_V1_SIZE
#endif
#define LPSTR_TEXTCALLBACKW ((LPWSTR)-1L)
#define LPSTR_TEXTCALLBACKA ((LPSTR)-1L)
#ifdef UNICODE
#define LPSTR_TEXTCALLBACK LPSTR_TEXTCALLBACKW
#else
#define LPSTR_TEXTCALLBACK LPSTR_TEXTCALLBACKA
#endif
#define I_IMAGECALLBACK (-1)
#define LVM_GETITEMA (LVM_FIRST + 5)
#define LVM_GETITEMW (LVM_FIRST + 75)
#ifdef UNICODE
#define LVM_GETITEM LVM_GETITEMW
#else
#define LVM_GETITEM LVM_GETITEMA
#endif
#define ListView_GetItem(hwnd, pitem) \
(BOOL)SNDMSG((hwnd), LVM_GETITEM, 0, (LPARAM)(LV_ITEM FAR*)(pitem))
#define LVM_SETITEMA (LVM_FIRST + 6)
#define LVM_SETITEMW (LVM_FIRST + 76)
#ifdef UNICODE
#define LVM_SETITEM LVM_SETITEMW
#else
#define LVM_SETITEM LVM_SETITEMA
#endif
#define ListView_SetItem(hwnd, pitem) \
(BOOL)SNDMSG((hwnd), LVM_SETITEM, 0, (LPARAM)(const LV_ITEM FAR*)(pitem))
#define LVM_INSERTITEMA (LVM_FIRST + 7)
#define LVM_INSERTITEMW (LVM_FIRST + 77)
#ifdef UNICODE
#define LVM_INSERTITEM LVM_INSERTITEMW
#else
#define LVM_INSERTITEM LVM_INSERTITEMA
#endif
#define ListView_InsertItem(hwnd, pitem) \
(int)SNDMSG((hwnd), LVM_INSERTITEM, 0, (LPARAM)(const LV_ITEM FAR*)(pitem))
#define LVM_DELETEITEM (LVM_FIRST + 8)
#define ListView_DeleteItem(hwnd, i) \
(BOOL)SNDMSG((hwnd), LVM_DELETEITEM, (WPARAM)(int)(i), 0L)
#define LVM_DELETEALLITEMS (LVM_FIRST + 9)
#define ListView_DeleteAllItems(hwnd) \
(BOOL)SNDMSG((hwnd), LVM_DELETEALLITEMS, 0, 0L)
#define LVM_GETCALLBACKMASK (LVM_FIRST + 10)
#define ListView_GetCallbackMask(hwnd) \
(BOOL)SNDMSG((hwnd), LVM_GETCALLBACKMASK, 0, 0)
#define LVM_SETCALLBACKMASK (LVM_FIRST + 11)
#define ListView_SetCallbackMask(hwnd, mask) \
(BOOL)SNDMSG((hwnd), LVM_SETCALLBACKMASK, (WPARAM)(UINT)(mask), 0)
#define LVNI_ALL 0x0000
#define LVNI_FOCUSED 0x0001
#define LVNI_SELECTED 0x0002
#define LVNI_CUT 0x0004
#define LVNI_DROPHILITED 0x0008
#define LVNI_ABOVE 0x0100
#define LVNI_BELOW 0x0200
#define LVNI_TOLEFT 0x0400
#define LVNI_TORIGHT 0x0800
#define LVM_GETNEXTITEM (LVM_FIRST + 12)
#define ListView_GetNextItem(hwnd, i, flags) \
(int)SNDMSG((hwnd), LVM_GETNEXTITEM, (WPARAM)(int)(i), MAKELPARAM((flags), 0))
#define LVFI_PARAM 0x0001
#define LVFI_STRING 0x0002
#define LVFI_PARTIAL 0x0008
#define LVFI_WRAP 0x0020
#define LVFI_NEARESTXY 0x0040
#if (_WIN32_IE >= 0x0300)
#define LV_FINDINFOA LVFINDINFOA
#define LV_FINDINFOW LVFINDINFOW
#else
#define tagLVFINDINFOA _LV_FINDINFOA
#define LVFINDINFOA LV_FINDINFOA
#define tagLVFINDINFOW _LV_FINDINFOW
#define LVFINDINFOW LV_FINDINFOW
#endif
#define LV_FINDINFO LVFINDINFO
typedef struct tagLVFINDINFOA
{
UINT flags;
LPCSTR psz;
LPARAM lParam;
POINT pt;
UINT vkDirection;
} LVFINDINFOA, FAR* LPFINDINFOA;
typedef struct tagLVFINDINFOW
{
UINT flags;
LPCWSTR psz;
LPARAM lParam;
POINT pt;
UINT vkDirection;
} LVFINDINFOW, FAR* LPFINDINFOW;
#ifdef UNICODE
#define LVFINDINFO LVFINDINFOW
#else
#define LVFINDINFO LVFINDINFOA
#endif
#define LVM_FINDITEMA (LVM_FIRST + 13)
#define LVM_FINDITEMW (LVM_FIRST + 83)
#ifdef UNICODE
#define LVM_FINDITEM LVM_FINDITEMW
#else
#define LVM_FINDITEM LVM_FINDITEMA
#endif
#define ListView_FindItem(hwnd, iStart, plvfi) \
(int)SNDMSG((hwnd), LVM_FINDITEM, (WPARAM)(int)(iStart), (LPARAM)(const LV_FINDINFO FAR*)(plvfi))
#define LVIR_BOUNDS 0
#define LVIR_ICON 1
#define LVIR_LABEL 2
#define LVIR_SELECTBOUNDS 3
#define LVM_GETITEMRECT (LVM_FIRST + 14)
#define ListView_GetItemRect(hwnd, i, prc, code) \
(BOOL)SNDMSG((hwnd), LVM_GETITEMRECT, (WPARAM)(int)(i), \
((prc) ? (((RECT FAR *)(prc))->left = (code),(LPARAM)(RECT FAR*)(prc)) : (LPARAM)(RECT FAR*)NULL))
#define LVM_SETITEMPOSITION (LVM_FIRST + 15)
#define ListView_SetItemPosition(hwndLV, i, x, y) \
(BOOL)SNDMSG((hwndLV), LVM_SETITEMPOSITION, (WPARAM)(int)(i), MAKELPARAM((x), (y)))
#define LVM_GETITEMPOSITION (LVM_FIRST + 16)
#define ListView_GetItemPosition(hwndLV, i, ppt) \
(BOOL)SNDMSG((hwndLV), LVM_GETITEMPOSITION, (WPARAM)(int)(i), (LPARAM)(POINT FAR*)(ppt))
#define LVM_GETSTRINGWIDTHA (LVM_FIRST + 17)
#define LVM_GETSTRINGWIDTHW (LVM_FIRST + 87)
#ifdef UNICODE
#define LVM_GETSTRINGWIDTH LVM_GETSTRINGWIDTHW
#else
#define LVM_GETSTRINGWIDTH LVM_GETSTRINGWIDTHA
#endif
#define ListView_GetStringWidth(hwndLV, psz) \
(int)SNDMSG((hwndLV), LVM_GETSTRINGWIDTH, 0, (LPARAM)(LPCTSTR)(psz))
#define LVHT_NOWHERE 0x0001
#define LVHT_ONITEMICON 0x0002
#define LVHT_ONITEMLABEL 0x0004
#define LVHT_ONITEMSTATEICON 0x0008
#define LVHT_ONITEM (LVHT_ONITEMICON | LVHT_ONITEMLABEL | LVHT_ONITEMSTATEICON)
#define LVHT_ABOVE 0x0008
#define LVHT_BELOW 0x0010
#define LVHT_TORIGHT 0x0020
#define LVHT_TOLEFT 0x0040
#if (_WIN32_IE >= 0x0300)
#define LV_HITTESTINFO LVHITTESTINFO
#else
#define tagLVHITTESTINFO _LV_HITTESTINFO
#define LVHITTESTINFO LV_HITTESTINFO
#endif
#define LVHITTESTINFO_V1_SIZE CCSIZEOF_STRUCT(LVHITTESTINFO, iItem)
typedef struct tagLVHITTESTINFO
{
POINT pt;
UINT flags;
int iItem;
#if (_WIN32_IE >= 0x0300)
int iSubItem; // this is was NOT in win95. valid only for LVM_SUBITEMHITTEST
#endif
} LVHITTESTINFO, FAR* LPLVHITTESTINFO;
#define LVM_HITTEST (LVM_FIRST + 18)
#define ListView_HitTest(hwndLV, pinfo) \
(int)SNDMSG((hwndLV), LVM_HITTEST, 0, (LPARAM)(LV_HITTESTINFO FAR*)(pinfo))
#define LVM_ENSUREVISIBLE (LVM_FIRST + 19)
#define ListView_EnsureVisible(hwndLV, i, fPartialOK) \
(BOOL)SNDMSG((hwndLV), LVM_ENSUREVISIBLE, (WPARAM)(int)(i), MAKELPARAM((fPartialOK), 0))
#define LVM_SCROLL (LVM_FIRST + 20)
#define ListView_Scroll(hwndLV, dx, dy) \
(BOOL)SNDMSG((hwndLV), LVM_SCROLL, (WPARAM)(int)dx, (LPARAM)(int)dy)
#define LVM_REDRAWITEMS (LVM_FIRST + 21)
#define ListView_RedrawItems(hwndLV, iFirst, iLast) \
(BOOL)SNDMSG((hwndLV), LVM_REDRAWITEMS, (WPARAM)(int)iFirst, (LPARAM)(int)iLast)
#define LVA_DEFAULT 0x0000
#define LVA_ALIGNLEFT 0x0001
#define LVA_ALIGNTOP 0x0002
#define LVA_SNAPTOGRID 0x0005
#define LVM_ARRANGE (LVM_FIRST + 22)
#define ListView_Arrange(hwndLV, code) \
(BOOL)SNDMSG((hwndLV), LVM_ARRANGE, (WPARAM)(UINT)(code), 0L)
#define LVM_EDITLABELA (LVM_FIRST + 23)
#define LVM_EDITLABELW (LVM_FIRST + 118)
#ifdef UNICODE
#define LVM_EDITLABEL LVM_EDITLABELW
#else
#define LVM_EDITLABEL LVM_EDITLABELA
#endif
#define ListView_EditLabel(hwndLV, i) \
(HWND)SNDMSG((hwndLV), LVM_EDITLABEL, (WPARAM)(int)(i), 0L)
#define LVM_GETEDITCONTROL (LVM_FIRST + 24)
#define ListView_GetEditControl(hwndLV) \
(HWND)SNDMSG((hwndLV), LVM_GETEDITCONTROL, 0, 0L)
#if (_WIN32_IE >= 0x0300)
#define LV_COLUMNA LVCOLUMNA
#define LV_COLUMNW LVCOLUMNW
#else
#define tagLVCOLUMNA _LV_COLUMNA
#define LVCOLUMNA LV_COLUMNA
#define tagLVCOLUMNW _LV_COLUMNW
#define LVCOLUMNW LV_COLUMNW
#endif
#define LV_COLUMN LVCOLUMN
#define LVCOLUMNA_V1_SIZE CCSIZEOF_STRUCT(LVCOLUMNA, iSubItem)
#define LVCOLUMNW_V1_SIZE CCSIZEOF_STRUCT(LVCOLUMNW, iSubItem)
typedef struct tagLVCOLUMNA
{
UINT mask;
int fmt;
int cx;
LPSTR pszText;
int cchTextMax;
int iSubItem;
#if (_WIN32_IE >= 0x0300)
int iImage;
int iOrder;
#endif
} LVCOLUMNA, FAR* LPLVCOLUMNA;
typedef struct tagLVCOLUMNW
{
UINT mask;
int fmt;
int cx;
LPWSTR pszText;
int cchTextMax;
int iSubItem;
#if (_WIN32_IE >= 0x0300)
int iImage;
int iOrder;
#endif
} LVCOLUMNW, FAR* LPLVCOLUMNW;
#ifdef UNICODE
#define LVCOLUMN LVCOLUMNW
#define LPLVCOLUMN LPLVCOLUMNW
#define LVCOLUMN_V1_SIZE LVCOLUMNW_V1_SIZE
#else
#define LVCOLUMN LVCOLUMNA
#define LPLVCOLUMN LPLVCOLUMNA
#define LVCOLUMN_V1_SIZE LVCOLUMNA_V1_SIZE
#endif
#define LVCF_FMT 0x0001
#define LVCF_WIDTH 0x0002
#define LVCF_TEXT 0x0004
#define LVCF_SUBITEM 0x0008
#if (_WIN32_IE >= 0x0300)
#define LVCF_IMAGE 0x0010
#define LVCF_ORDER 0x0020
#endif
#define LVCFMT_LEFT 0x0000
#define LVCFMT_RIGHT 0x0001
#define LVCFMT_CENTER 0x0002
#define LVCFMT_JUSTIFYMASK 0x0003
#if (_WIN32_IE >= 0x0300)
#define LVCFMT_IMAGE 0x0800
#define LVCFMT_BITMAP_ON_RIGHT 0x1000
#define LVCFMT_COL_HAS_IMAGES 0x8000
#endif
#define LVM_GETCOLUMNA (LVM_FIRST + 25)
#define LVM_GETCOLUMNW (LVM_FIRST + 95)
#ifdef UNICODE
#define LVM_GETCOLUMN LVM_GETCOLUMNW
#else
#define LVM_GETCOLUMN LVM_GETCOLUMNA
#endif
#define ListView_GetColumn(hwnd, iCol, pcol) \
(BOOL)SNDMSG((hwnd), LVM_GETCOLUMN, (WPARAM)(int)(iCol), (LPARAM)(LV_COLUMN FAR*)(pcol))
#define LVM_SETCOLUMNA (LVM_FIRST + 26)
#define LVM_SETCOLUMNW (LVM_FIRST + 96)
#ifdef UNICODE
#define LVM_SETCOLUMN LVM_SETCOLUMNW
#else
#define LVM_SETCOLUMN LVM_SETCOLUMNA
#endif
#define ListView_SetColumn(hwnd, iCol, pcol) \
(BOOL)SNDMSG((hwnd), LVM_SETCOLUMN, (WPARAM)(int)(iCol), (LPARAM)(const LV_COLUMN FAR*)(pcol))
#define LVM_INSERTCOLUMNA (LVM_FIRST + 27)
#define LVM_INSERTCOLUMNW (LVM_FIRST + 97)
#ifdef UNICODE
# define LVM_INSERTCOLUMN LVM_INSERTCOLUMNW
#else
# define LVM_INSERTCOLUMN LVM_INSERTCOLUMNA
#endif
#define ListView_InsertColumn(hwnd, iCol, pcol) \
(int)SNDMSG((hwnd), LVM_INSERTCOLUMN, (WPARAM)(int)(iCol), (LPARAM)(const LV_COLUMN FAR*)(pcol))
#define LVM_DELETECOLUMN (LVM_FIRST + 28)
#define ListView_DeleteColumn(hwnd, iCol) \
(BOOL)SNDMSG((hwnd), LVM_DELETECOLUMN, (WPARAM)(int)(iCol), 0)
#define LVM_GETCOLUMNWIDTH (LVM_FIRST + 29)
#define ListView_GetColumnWidth(hwnd, iCol) \
(int)SNDMSG((hwnd), LVM_GETCOLUMNWIDTH, (WPARAM)(int)(iCol), 0)
#define LVSCW_AUTOSIZE -1
#define LVSCW_AUTOSIZE_USEHEADER -2
#define LVM_SETCOLUMNWIDTH (LVM_FIRST + 30)
#define ListView_SetColumnWidth(hwnd, iCol, cx) \
(BOOL)SNDMSG((hwnd), LVM_SETCOLUMNWIDTH, (WPARAM)(int)(iCol), MAKELPARAM((cx), 0))
#if (_WIN32_IE >= 0x0300)
#define LVM_GETHEADER (LVM_FIRST + 31)
#define ListView_GetHeader(hwnd)\
(HWND)SNDMSG((hwnd), LVM_GETHEADER, 0, 0L)
#endif
#define LVM_CREATEDRAGIMAGE (LVM_FIRST + 33)
#define ListView_CreateDragImage(hwnd, i, lpptUpLeft) \
(HIMAGELIST)SNDMSG((hwnd), LVM_CREATEDRAGIMAGE, (WPARAM)(int)(i), (LPARAM)(LPPOINT)(lpptUpLeft))
#define LVM_GETVIEWRECT (LVM_FIRST + 34)
#define ListView_GetViewRect(hwnd, prc) \
(BOOL)SNDMSG((hwnd), LVM_GETVIEWRECT, 0, (LPARAM)(RECT FAR*)(prc))
#define LVM_GETTEXTCOLOR (LVM_FIRST + 35)
#define ListView_GetTextColor(hwnd) \
(COLORREF)SNDMSG((hwnd), LVM_GETTEXTCOLOR, 0, 0L)
#define LVM_SETTEXTCOLOR (LVM_FIRST + 36)
#define ListView_SetTextColor(hwnd, clrText) \
(BOOL)SNDMSG((hwnd), LVM_SETTEXTCOLOR, 0, (LPARAM)(COLORREF)(clrText))
#define LVM_GETTEXTBKCOLOR (LVM_FIRST + 37)
#define ListView_GetTextBkColor(hwnd) \
(COLORREF)SNDMSG((hwnd), LVM_GETTEXTBKCOLOR, 0, 0L)
#define LVM_SETTEXTBKCOLOR (LVM_FIRST + 38)
#define ListView_SetTextBkColor(hwnd, clrTextBk) \
(BOOL)SNDMSG((hwnd), LVM_SETTEXTBKCOLOR, 0, (LPARAM)(COLORREF)(clrTextBk))
#define LVM_GETTOPINDEX (LVM_FIRST + 39)
#define ListView_GetTopIndex(hwndLV) \
(int)SNDMSG((hwndLV), LVM_GETTOPINDEX, 0, 0)
#define LVM_GETCOUNTPERPAGE (LVM_FIRST + 40)
#define ListView_GetCountPerPage(hwndLV) \
(int)SNDMSG((hwndLV), LVM_GETCOUNTPERPAGE, 0, 0)
#define LVM_GETORIGIN (LVM_FIRST + 41)
#define ListView_GetOrigin(hwndLV, ppt) \
(BOOL)SNDMSG((hwndLV), LVM_GETORIGIN, (WPARAM)0, (LPARAM)(POINT FAR*)(ppt))
#define LVM_UPDATE (LVM_FIRST + 42)
#define ListView_Update(hwndLV, i) \
(BOOL)SNDMSG((hwndLV), LVM_UPDATE, (WPARAM)i, 0L)
#define LVM_SETITEMSTATE (LVM_FIRST + 43)
#define ListView_SetItemState(hwndLV, i, data, mask) \
{ LV_ITEM _ms_lvi;\
_ms_lvi.stateMask = mask;\
_ms_lvi.state = data;\
SNDMSG((hwndLV), LVM_SETITEMSTATE, (WPARAM)i, (LPARAM)(LV_ITEM FAR *)&_ms_lvi);\
}
#define LVM_GETITEMSTATE (LVM_FIRST + 44)
#define ListView_GetItemState(hwndLV, i, mask) \
(UINT)SNDMSG((hwndLV), LVM_GETITEMSTATE, (WPARAM)i, (LPARAM)mask)
#if (_WIN32_IE >= 0x0300)
#define ListView_GetCheckState(hwndLV, i) \
((((UINT)(SNDMSG((hwndLV), LVM_GETITEMSTATE, (WPARAM)i, LVIS_STATEIMAGEMASK))) >> 12) -1)
#endif
#define LVM_GETITEMTEXTA (LVM_FIRST + 45)
#define LVM_GETITEMTEXTW (LVM_FIRST + 115)
#ifdef UNICODE
#define LVM_GETITEMTEXT LVM_GETITEMTEXTW
#else
#define LVM_GETITEMTEXT LVM_GETITEMTEXTA
#endif
#define ListView_GetItemText(hwndLV, i, iSubItem_, pszText_, cchTextMax_) \
{ LV_ITEM _ms_lvi;\
_ms_lvi.iSubItem = iSubItem_;\
_ms_lvi.cchTextMax = cchTextMax_;\
_ms_lvi.pszText = pszText_;\
SNDMSG((hwndLV), LVM_GETITEMTEXT, (WPARAM)i, (LPARAM)(LV_ITEM FAR *)&_ms_lvi);\
}
#define LVM_SETITEMTEXTA (LVM_FIRST + 46)
#define LVM_SETITEMTEXTW (LVM_FIRST + 116)
#ifdef UNICODE
#define LVM_SETITEMTEXT LVM_SETITEMTEXTW
#else
#define LVM_SETITEMTEXT LVM_SETITEMTEXTA
#endif
#define ListView_SetItemText(hwndLV, i, iSubItem_, pszText_) \
{ LV_ITEM _ms_lvi;\
_ms_lvi.iSubItem = iSubItem_;\
_ms_lvi.pszText = pszText_;\
SNDMSG((hwndLV), LVM_SETITEMTEXT, (WPARAM)i, (LPARAM)(LV_ITEM FAR *)&_ms_lvi);\
}
#if (_WIN32_IE >= 0x0300)
// these flags only apply to LVS_OWNERDATA listviews in report or list mode
#define LVSICF_NOINVALIDATEALL 0x00000001
#define LVSICF_NOSCROLL 0x00000002
#endif
#define LVM_SETITEMCOUNT (LVM_FIRST + 47)
#define ListView_SetItemCount(hwndLV, cItems) \
SNDMSG((hwndLV), LVM_SETITEMCOUNT, (WPARAM)cItems, 0)
#if (_WIN32_IE >= 0x0300)
#define ListView_SetItemCountEx(hwndLV, cItems, dwFlags) \
SNDMSG((hwndLV), LVM_SETITEMCOUNT, (WPARAM)cItems, (LPARAM)dwFlags)
#endif
typedef int (CALLBACK *PFNLVCOMPARE)(LPARAM, LPARAM, LPARAM);
#define LVM_SORTITEMS (LVM_FIRST + 48)
#define ListView_SortItems(hwndLV, _pfnCompare, _lPrm) \
(BOOL)SNDMSG((hwndLV), LVM_SORTITEMS, (WPARAM)(LPARAM)_lPrm, \
(LPARAM)(PFNLVCOMPARE)_pfnCompare)
#define LVM_SETITEMPOSITION32 (LVM_FIRST + 49)
#define ListView_SetItemPosition32(hwndLV, i, x, y) \
{ POINT ptNewPos = {x,y}; \
SNDMSG((hwndLV), LVM_SETITEMPOSITION32, (WPARAM)(int)(i), (LPARAM)&ptNewPos); \
}
#define LVM_GETSELECTEDCOUNT (LVM_FIRST + 50)
#define ListView_GetSelectedCount(hwndLV) \
(UINT)SNDMSG((hwndLV), LVM_GETSELECTEDCOUNT, 0, 0L)
#define LVM_GETITEMSPACING (LVM_FIRST + 51)
#define ListView_GetItemSpacing(hwndLV, fSmall) \
(DWORD)SNDMSG((hwndLV), LVM_GETITEMSPACING, fSmall, 0L)
#define LVM_GETISEARCHSTRINGA (LVM_FIRST + 52)
#define LVM_GETISEARCHSTRINGW (LVM_FIRST + 117)
#ifdef UNICODE
#define LVM_GETISEARCHSTRING LVM_GETISEARCHSTRINGW
#else
#define LVM_GETISEARCHSTRING LVM_GETISEARCHSTRINGA
#endif
#define ListView_GetISearchString(hwndLV, lpsz) \
(BOOL)SNDMSG((hwndLV), LVM_GETISEARCHSTRING, 0, (LPARAM)(LPTSTR)lpsz)
#if (_WIN32_IE >= 0x0300)
#define LVM_SETICONSPACING (LVM_FIRST + 53)
// -1 for cx and cy means we'll use the default (system settings)
// 0 for cx or cy means use the current setting (allows you to change just one param)
#define ListView_SetIconSpacing(hwndLV, cx, cy) \
(DWORD)SNDMSG((hwndLV), LVM_SETICONSPACING, 0, MAKELONG(cx,cy))
#define LVM_SETEXTENDEDLISTVIEWSTYLE (LVM_FIRST + 54) // optional wParam == mask
#define ListView_SetExtendedListViewStyle(hwndLV, dw)\
(DWORD)SNDMSG((hwndLV), LVM_SETEXTENDEDLISTVIEWSTYLE, 0, dw)
#if (_WIN32_IE >= 0x0400)
#define ListView_SetExtendedListViewStyleEx(hwndLV, dwMask, dw)\
(DWORD)SNDMSG((hwndLV), LVM_SETEXTENDEDLISTVIEWSTYLE, dwMask, dw)
#endif
#define LVM_GETEXTENDEDLISTVIEWSTYLE (LVM_FIRST + 55)
#define ListView_GetExtendedListViewStyle(hwndLV)\
(DWORD)SNDMSG((hwndLV), LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0)
#define LVS_EX_GRIDLINES 0x00000001
#define LVS_EX_SUBITEMIMAGES 0x00000002
#define LVS_EX_CHECKBOXES 0x00000004
#define LVS_EX_TRACKSELECT 0x00000008
#define LVS_EX_HEADERDRAGDROP 0x00000010
#define LVS_EX_FULLROWSELECT 0x00000020 // applies to report mode only
#define LVS_EX_ONECLICKACTIVATE 0x00000040
#define LVS_EX_TWOCLICKACTIVATE 0x00000080
#if (_WIN32_IE >= 0x0400)
#define LVS_EX_FLATSB 0x00000100
#define LVS_EX_REGIONAL 0x00000200
#define LVS_EX_INFOTIP 0x00000400 // listview does InfoTips for you
#define LVS_EX_UNDERLINEHOT 0x00000800
#define LVS_EX_UNDERLINECOLD 0x00001000
#define LVS_EX_MULTIWORKAREAS 0x00002000
#endif
#define LVM_GETSUBITEMRECT (LVM_FIRST + 56)
#define ListView_GetSubItemRect(hwnd, iItem, iSubItem, code, prc) \
(BOOL)SNDMSG((hwnd), LVM_GETSUBITEMRECT, (WPARAM)(int)(iItem), \
((prc) ? ((((LPRECT)(prc))->top = iSubItem), (((LPRECT)(prc))->left = code), (LPARAM)(prc)) : (LPARAM)(LPRECT)NULL))
#define LVM_SUBITEMHITTEST (LVM_FIRST + 57)
#define ListView_SubItemHitTest(hwnd, plvhti) \
(int)SNDMSG((hwnd), LVM_SUBITEMHITTEST, 0, (LPARAM)(LPLVHITTESTINFO)(plvhti))
#define LVM_SETCOLUMNORDERARRAY (LVM_FIRST + 58)
#define ListView_SetColumnOrderArray(hwnd, iCount, pi) \
(BOOL)SNDMSG((hwnd), LVM_SETCOLUMNORDERARRAY, (WPARAM)iCount, (LPARAM)(LPINT)pi)
#define LVM_GETCOLUMNORDERARRAY (LVM_FIRST + 59)
#define ListView_GetColumnOrderArray(hwnd, iCount, pi) \
(BOOL)SNDMSG((hwnd), LVM_GETCOLUMNORDERARRAY, (WPARAM)iCount, (LPARAM)(LPINT)pi)
#define LVM_SETHOTITEM (LVM_FIRST + 60)
#define ListView_SetHotItem(hwnd, i) \
(int)SNDMSG((hwnd), LVM_SETHOTITEM, (WPARAM)i, 0)
#define LVM_GETHOTITEM (LVM_FIRST + 61)
#define ListView_GetHotItem(hwnd) \
(int)SNDMSG((hwnd), LVM_GETHOTITEM, 0, 0)
#define LVM_SETHOTCURSOR (LVM_FIRST + 62)
#define ListView_SetHotCursor(hwnd, hcur) \
(HCURSOR)SNDMSG((hwnd), LVM_SETHOTCURSOR, 0, (LPARAM)hcur)
#define LVM_GETHOTCURSOR (LVM_FIRST + 63)
#define ListView_GetHotCursor(hwnd) \
(HCURSOR)SNDMSG((hwnd), LVM_GETHOTCURSOR, 0, 0)
#define LVM_APPROXIMATEVIEWRECT (LVM_FIRST + 64)
#define ListView_ApproximateViewRect(hwnd, iWidth, iHeight, iCount) \
(DWORD)SNDMSG((hwnd), LVM_APPROXIMATEVIEWRECT, iCount, MAKELPARAM(iWidth, iHeight))
#endif // _WIN32_IE >= 0x0300
#if (_WIN32_IE >= 0x0400)
#define LV_MAX_WORKAREAS 16
#define LVM_SETWORKAREAS (LVM_FIRST + 65)
#define ListView_SetWorkAreas(hwnd, nWorkAreas, prc) \
(BOOL)SNDMSG((hwnd), LVM_SETWORKAREAS, (WPARAM)(int)nWorkAreas, (LPARAM)(RECT FAR*)(prc))
#define LVM_GETWORKAREAS (LVM_FIRST + 70)
#define ListView_GetWorkAreas(hwnd, nWorkAreas, prc) \
(BOOL)SNDMSG((hwnd), LVM_GETWORKAREAS, (WPARAM)(int)nWorkAreas, (LPARAM)(RECT FAR*)(prc))
#define LVM_GETNUMBEROFWORKAREAS (LVM_FIRST + 73)
#define ListView_GetNumberOfWorkAreas(hwnd, pnWorkAreas) \
(BOOL)SNDMSG((hwnd), LVM_GETNUMBEROFWORKAREAS, 0, (LPARAM)(UINT *)(pnWorkAreas))
#define LVM_GETSELECTIONMARK (LVM_FIRST + 66)
#define ListView_GetSelectionMark(hwnd) \
(int)SNDMSG((hwnd), LVM_GETSELECTIONMARK, 0, 0)
#define LVM_SETSELECTIONMARK (LVM_FIRST + 67)
#define ListView_SetSelectionMark(hwnd, i) \
(int)SNDMSG((hwnd), LVM_SETSELECTIONMARK, 0, (LPARAM)i)
#define LVM_SETHOVERTIME (LVM_FIRST + 71)
#define ListView_SetHoverTime(hwndLV, dwHoverTimeMs)\
(DWORD)SendMessage((hwndLV), LVM_SETHOVERTIME, 0, dwHoverTimeMs)
#define LVM_GETHOVERTIME (LVM_FIRST + 72)
#define ListView_GetHoverTime(hwndLV)\
(DWORD)SendMessage((hwndLV), LVM_GETHOVERTIME, 0, 0)
#define LVM_SETTOOLTIPS (LVM_FIRST + 74)
#define ListView_SetToolTips(hwndLV, hwndNewHwnd)\
(HWND)SendMessage((hwndLV), LVM_SETTOOLTIPS, hwndNewHwnd, 0)
#define LVM_GETTOOLTIPS (LVM_FIRST + 78)
#define ListView_GetToolTips(hwndLV)\
(HWND)SendMessage((hwndLV), LVM_GETTOOLTIPS, 0, 0)
typedef struct tagLVBKIMAGEA
{
ULONG ulFlags; // LVBKIF_*
HBITMAP hbm;
LPSTR pszImage;
UINT cchImageMax;
int xOffsetPercent;
int yOffsetPercent;
} LVBKIMAGEA, FAR *LPLVBKIMAGEA;
typedef struct tagLVBKIMAGEW
{
ULONG ulFlags; // LVBKIF_*
HBITMAP hbm;
LPWSTR pszImage;
UINT cchImageMax;
int xOffsetPercent;
int yOffsetPercent;
} LVBKIMAGEW, FAR *LPLVBKIMAGEW;
#define LVBKIF_SOURCE_NONE 0x00000000
#define LVBKIF_SOURCE_HBITMAP 0x00000001
#define LVBKIF_SOURCE_URL 0x00000002
#define LVBKIF_SOURCE_MASK 0x00000003
#define LVBKIF_STYLE_NORMAL 0x00000000
#define LVBKIF_STYLE_TILE 0x00000010
#define LVBKIF_STYLE_MASK 0x00000010
#define LVM_SETBKIMAGEA (LVM_FIRST + 68)
#define LVM_SETBKIMAGEW (LVM_FIRST + 138)
#define LVM_GETBKIMAGEA (LVM_FIRST + 69)
#define LVM_GETBKIMAGEW (LVM_FIRST + 139)
#ifdef UNICODE
#define LVBKIMAGE LVBKIMAGEW
#define LPLVBKIMAGE LPLVBKIMAGEW
#define LVM_SETBKIMAGE LVM_SETBKIMAGEW
#define LVM_GETBKIMAGE LVM_GETBKIMAGEW
#else
#define LVBKIMAGE LVBKIMAGEA
#define LPLVBKIMAGE LPLVBKIMAGEA
#define LVM_SETBKIMAGE LVM_SETBKIMAGEA
#define LVM_GETBKIMAGE LVM_GETBKIMAGEA
#endif
#define ListView_SetBkImage(hwnd, plvbki) \
(BOOL)SNDMSG((hwnd), LVM_SETBKIMAGE, 0, (LPARAM)plvbki)
#define ListView_GetBkImage(hwnd, plvbki) \
(BOOL)SNDMSG((hwnd), LVM_GETBKIMAGE, 0, (LPARAM)plvbki)
#endif // _WIN32_IE >= 0x0400
#if (_WIN32_IE >= 0x0300)
#define LPNM_LISTVIEW LPNMLISTVIEW
#define NM_LISTVIEW NMLISTVIEW
#else
#define tagNMLISTVIEW _NM_LISTVIEW
#define NMLISTVIEW NM_LISTVIEW
#define LPNMLISTVIEW LPNM_LISTVIEW
#endif
typedef struct tagNMLISTVIEW
{
NMHDR hdr;
int iItem;
int iSubItem;
UINT uNewState;
UINT uOldState;
UINT uChanged;
POINT ptAction;
LPARAM lParam;
} NMLISTVIEW, FAR *LPNMLISTVIEW;
#if (_WIN32_IE >= 0x400)
// NMITEMACTIVATE is used instead of NMLISTVIEW in IE >= 0x400
// therefore all the fields are the same except for extra uKeyFlags
// they are used to store key flags at the time of the single click with
// delayed activation - because by the time the timer goes off a user may
// not hold the keys (shift, ctrl) any more
typedef struct tagNMITEMACTIVATE
{
NMHDR hdr;
int iItem;
int iSubItem;
UINT uNewState;
UINT uOldState;
UINT uChanged;
POINT ptAction;
LPARAM lParam;
UINT uKeyFlags;
} NMITEMACTIVATE, FAR *LPNMITEMACTIVATE;
// key flags stored in uKeyFlags
#define LVKF_ALT 0x0001
#define LVKF_CONTROL 0x0002
#define LVKF_SHIFT 0x0004
#endif //(_WIN32_IE >= 0x0400)
#if (_WIN32_IE >= 0x0300)
#define NMLVCUSTOMDRAW_V3_SIZE CCSIZEOF_STRUCT(NMLVCUSTOMDRW, clrTextBk)
typedef struct tagNMLVCUSTOMDRAW
{
NMCUSTOMDRAW nmcd;
COLORREF clrText;
COLORREF clrTextBk;
#if (_WIN32_IE >= 0x0400)
int iSubItem;
#endif
} NMLVCUSTOMDRAW, *LPNMLVCUSTOMDRAW;
typedef struct tagNMLVCACHEHINT
{
NMHDR hdr;
int iFrom;
int iTo;
} NMLVCACHEHINT, FAR *LPNMLVCACHEHINT;
#define LPNM_CACHEHINT LPNMLVCACHEHINT
#define PNM_CACHEHINT LPNMLVCACHEHINT
#define NM_CACHEHINT NMLVCACHEHINT
typedef struct tagNMLVFINDITEM
{
NMHDR hdr;
int iStart;
LVFINDINFO lvfi;
} NMLVFINDITEM, FAR *LPNMLVFINDITEM;
#define PNM_FINDITEM LPNMLVFINDITEM
#define LPNM_FINDITEM LPNMLVFINDITEM
#define NM_FINDITEM NMLVFINDITEM
typedef struct tagNMLVODSTATECHANGE
{
NMHDR hdr;
int iFrom;
int iTo;
UINT uNewState;
UINT uOldState;
} NMLVODSTATECHANGE, FAR *LPNMLVODSTATECHANGE;
#define PNM_ODSTATECHANGE LPNMLVODSTATECHANGE
#define LPNM_ODSTATECHANGE LPNMLVODSTATECHANGE
#define NM_ODSTATECHANGE NMLVODSTATECHANGE
#endif // _WIN32_IE >= 0x0300
#define LVN_ITEMCHANGING (LVN_FIRST-0)
#define LVN_ITEMCHANGED (LVN_FIRST-1)
#define LVN_INSERTITEM (LVN_FIRST-2)
#define LVN_DELETEITEM (LVN_FIRST-3)
#define LVN_DELETEALLITEMS (LVN_FIRST-4)
#define LVN_BEGINLABELEDITA (LVN_FIRST-5)
#define LVN_BEGINLABELEDITW (LVN_FIRST-75)
#define LVN_ENDLABELEDITA (LVN_FIRST-6)
#define LVN_ENDLABELEDITW (LVN_FIRST-76)
#define LVN_COLUMNCLICK (LVN_FIRST-8)
#define LVN_BEGINDRAG (LVN_FIRST-9)
#define LVN_BEGINRDRAG (LVN_FIRST-11)
#if (_WIN32_IE >= 0x0300)
#define LVN_ODCACHEHINT (LVN_FIRST-13)
#define LVN_ODFINDITEMA (LVN_FIRST-52)
#define LVN_ODFINDITEMW (LVN_FIRST-79)
#define LVN_ITEMACTIVATE (LVN_FIRST-14)
#define LVN_ODSTATECHANGED (LVN_FIRST-15)
#ifdef UNICODE
#define LVN_ODFINDITEM LVN_ODFINDITEMW
#else
#define LVN_ODFINDITEM LVN_ODFINDITEMA
#endif
#endif // _WIN32_IE >= 0x0300
#if (_WIN32_IE >= 0x0400)
#define LVN_HOTTRACK (LVN_FIRST-21)
#endif
#define LVN_GETDISPINFOA (LVN_FIRST-50)
#define LVN_GETDISPINFOW (LVN_FIRST-77)
#define LVN_SETDISPINFOA (LVN_FIRST-51)
#define LVN_SETDISPINFOW (LVN_FIRST-78)
#ifdef UNICODE
#define LVN_BEGINLABELEDIT LVN_BEGINLABELEDITW
#define LVN_ENDLABELEDIT LVN_ENDLABELEDITW
#define LVN_GETDISPINFO LVN_GETDISPINFOW
#define LVN_SETDISPINFO LVN_SETDISPINFOW
#else
#define LVN_BEGINLABELEDIT LVN_BEGINLABELEDITA
#define LVN_ENDLABELEDIT LVN_ENDLABELEDITA
#define LVN_GETDISPINFO LVN_GETDISPINFOA
#define LVN_SETDISPINFO LVN_SETDISPINFOA
#endif
#define LVIF_DI_SETITEM 0x1000
#if (_WIN32_IE >= 0x0300)
#define LV_DISPINFOA NMLVDISPINFOA
#define LV_DISPINFOW NMLVDISPINFOW
#else
#define tagLVDISPINFO _LV_DISPINFO
#define NMLVDISPINFOA LV_DISPINFOA
#define tagLVDISPINFOW _LV_DISPINFOW
#define NMLVDISPINFOW LV_DISPINFOW
#endif
#define LV_DISPINFO NMLVDISPINFO
typedef struct tagLVDISPINFO {
NMHDR hdr;
LVITEMA item;
} NMLVDISPINFOA, FAR *LPNMLVDISPINFOA;
typedef struct tagLVDISPINFOW {
NMHDR hdr;
LVITEMW item;
} NMLVDISPINFOW, FAR * LPNMLVDISPINFOW;
#ifdef UNICODE
#define NMLVDISPINFO NMLVDISPINFOW
#else
#define NMLVDISPINFO NMLVDISPINFOA
#endif
#define LVN_KEYDOWN (LVN_FIRST-55)
#if (_WIN32_IE >= 0x0300)
#define LV_KEYDOWN NMLVKEYDOWN
#else
#define tagLVKEYDOWN _LV_KEYDOWN
#define NMLVKEYDOWN LV_KEYDOWN
#endif
typedef struct tagLVKEYDOWN
{
NMHDR hdr;
WORD wVKey;
UINT flags;
} NMLVKEYDOWN, FAR *LPNMLVKEYDOWN;
#if (_WIN32_IE >= 0x0300)
#define LVN_MARQUEEBEGIN (LVN_FIRST-56)
#endif
#if (_WIN32_IE >= 0x0400)
typedef struct tagNMLVGETINFOTIPA
{
NMHDR hdr;
DWORD dwFlags;
LPSTR pszText;
int cchTextMax;
int iItem;
int iSubItem;
LPARAM lParam;
} NMLVGETINFOTIPA, *LPNMLVGETINFOTIPA;
typedef struct tagNMLVGETINFOTIPW
{
NMHDR hdr;
DWORD dwFlags;
LPWSTR pszText;
int cchTextMax;
int iItem;
int iSubItem;
LPARAM lParam;
} NMLVGETINFOTIPW, *LPNMLVGETINFOTIPW;
// NMLVGETINFOTIPA.dwFlag values
#define LVGIT_UNFOLDED 0x0001
#define LVN_GETINFOTIPA (LVN_FIRST-57)
#define LVN_GETINFOTIPW (LVN_FIRST-58)
#ifdef UNICODE
#define LVN_GETINFOTIP LVN_GETINFOTIPW
#define NMLVGETINFOTIP NMLVGETINFOTIPW
#define LPNMLVGETINFOTIP LPNMLVGETINFOTIPW
#else
#define LVN_GETINFOTIP LVN_GETINFOTIPA
#define NMLVGETINFOTIP NMLVGETINFOTIPA
#define LPNMLVGETINFOTIP LPNMLVGETINFOTIPA
#endif
#endif // _WIN32_IE >= 0x0400
#endif // NOLISTVIEW
//====== TREEVIEW CONTROL =====================================================
#ifndef NOTREEVIEW
#ifdef _WIN32
#define WC_TREEVIEWA "SysTreeView32"
#define WC_TREEVIEWW L"SysTreeView32"
#ifdef UNICODE
#define WC_TREEVIEW WC_TREEVIEWW
#else
#define WC_TREEVIEW WC_TREEVIEWA
#endif
#else
#define WC_TREEVIEW "SysTreeView"
#endif
// begin_r_commctrl
#define TVS_HASBUTTONS 0x0001
#define TVS_HASLINES 0x0002
#define TVS_LINESATROOT 0x0004
#define TVS_EDITLABELS 0x0008
#define TVS_DISABLEDRAGDROP 0x0010
#define TVS_SHOWSELALWAYS 0x0020
#if (_WIN32_IE >= 0x0300)
#define TVS_RTLREADING 0x0040
#define TVS_NOTOOLTIPS 0x0080
#define TVS_CHECKBOXES 0x0100
#define TVS_TRACKSELECT 0x0200
#if (_WIN32_IE >= 0x0400)
#define TVS_SINGLEEXPAND 0x0400
#define TVS_INFOTIP 0x0800
#define TVS_FULLROWSELECT 0x1000
#define TVS_NOSCROLL 0x2000
#define TVS_NONEVENHEIGHT 0x4000
#endif
#endif
// end_r_commctrl
typedef struct _TREEITEM FAR* HTREEITEM;
#define TVIF_TEXT 0x0001
#define TVIF_IMAGE 0x0002
#define TVIF_PARAM 0x0004
#define TVIF_STATE 0x0008
#define TVIF_HANDLE 0x0010
#define TVIF_SELECTEDIMAGE 0x0020
#define TVIF_CHILDREN 0x0040
#if (_WIN32_IE >= 0x0400)
#define TVIF_INTEGRAL 0x0080
#endif
#define TVIS_SELECTED 0x0002
#define TVIS_CUT 0x0004
#define TVIS_DROPHILITED 0x0008
#define TVIS_BOLD 0x0010
#define TVIS_EXPANDED 0x0020
#define TVIS_EXPANDEDONCE 0x0040
#if (_WIN32_IE >= 0x0300)
#define TVIS_EXPANDPARTIAL 0x0080
#endif
#define TVIS_OVERLAYMASK 0x0F00
#define TVIS_STATEIMAGEMASK 0xF000
#define TVIS_USERMASK 0xF000
#define I_CHILDRENCALLBACK (-1)
#if (_WIN32_IE >= 0x0300)
#define LPTV_ITEMW LPTVITEMW
#define LPTV_ITEMA LPTVITEMA
#define TV_ITEMW TVITEMW
#define TV_ITEMA TVITEMA
#else
#define tagTVITEMA _TV_ITEMA
#define TVITEMA TV_ITEMA
#define LPTVITEMA LPTV_ITEMA
#define tagTVITEMW _TV_ITEMW
#define TVITEMW TV_ITEMW
#define LPTVITEMW LPTV_ITEMW
#endif
#define LPTV_ITEM LPTVITEM
#define TV_ITEM TVITEM
typedef struct tagTVITEMA {
UINT mask;
HTREEITEM hItem;
UINT state;
UINT stateMask;
LPSTR pszText;
int cchTextMax;
int iImage;
int iSelectedImage;
int cChildren;
LPARAM lParam;
} TVITEMA, FAR *LPTVITEMA;
typedef struct tagTVITEMW {
UINT mask;
HTREEITEM hItem;
UINT state;
UINT stateMask;
LPWSTR pszText;
int cchTextMax;
int iImage;
int iSelectedImage;
int cChildren;
LPARAM lParam;
} TVITEMW, FAR *LPTVITEMW;
#if (_WIN32_IE >= 0x0400)
// only used for Get and Set messages. no notifies
typedef struct tagTVITEMEXA {
UINT mask;
HTREEITEM hItem;
UINT state;
UINT stateMask;
LPSTR pszText;
int cchTextMax;
int iImage;
int iSelectedImage;
int cChildren;
LPARAM lParam;
int iIntegral;
} TVITEMEXA, FAR *LPTVITEMEXA;
// only used for Get and Set messages. no notifies
typedef struct tagTVITEMEXW {
UINT mask;
HTREEITEM hItem;
UINT state;
UINT stateMask;
LPWSTR pszText;
int cchTextMax;
int iImage;
int iSelectedImage;
int cChildren;
LPARAM lParam;
int iIntegral;
} TVITEMEXW, FAR *LPTVITEMEXW;
#ifdef UNICODE
typedef TVITEMEXW TVITEMEX;
typedef LPTVITEMEXW LPTVITEMEX;
#else
typedef TVITEMEXA TVITEMEX;
typedef LPTVITEMEXA LPTVITEMEX;
#endif // UNICODE
#endif
#ifdef UNICODE
#define TVITEM TVITEMW
#define LPTVITEM LPTVITEMW
#else
#define TVITEM TVITEMA
#define LPTVITEM LPTVITEMA
#endif
#define TVI_ROOT ((HTREEITEM)0xFFFF0000)
#define TVI_FIRST ((HTREEITEM)0xFFFF0001)
#define TVI_LAST ((HTREEITEM)0xFFFF0002)
#define TVI_SORT ((HTREEITEM)0xFFFF0003)
#if (_WIN32_IE >= 0x0300)
#define LPTV_INSERTSTRUCTA LPTVINSERTSTRUCTA
#define LPTV_INSERTSTRUCTW LPTVINSERTSTRUCTW
#define TV_INSERTSTRUCTA TVINSERTSTRUCTA
#define TV_INSERTSTRUCTW TVINSERTSTRUCTW
#else
#define tagTVINSERTSTRUCTA _TV_INSERTSTRUCTA
#define TVINSERTSTRUCTA TV_INSERTSTRUCTA
#define LPTVINSERTSTRUCTA LPTV_INSERTSTRUCTA
#define tagTVINSERTSTRUCTW _TV_INSERTSTRUCTW
#define TVINSERTSTRUCTW TV_INSERTSTRUCTW
#define LPTVINSERTSTRUCTW LPTV_INSERTSTRUCTW
#endif
#define TV_INSERTSTRUCT TVINSERTSTRUCT
#define LPTV_INSERTSTRUCT LPTVINSERTSTRUCT
#define TVINSERTSTRUCTA_V1_SIZE CCSIZEOF_STRUCT(TVINSERTSTRUCTA, item)
#define TVINSERTSTRUCTW_V1_SIZE CCSIZEOF_STRUCT(TVINSERTSTRUCTW, item)
typedef struct tagTVINSERTSTRUCTA {
HTREEITEM hParent;
HTREEITEM hInsertAfter;
#if (_WIN32_IE >= 0x0400)
union
{
TVITEMEXA itemex;
TV_ITEMA item;
} DUMMYUNIONNAME;
#else
TV_ITEMA item;
#endif
} TVINSERTSTRUCTA, FAR *LPTVINSERTSTRUCTA;
typedef struct tagTVINSERTSTRUCTW {
HTREEITEM hParent;
HTREEITEM hInsertAfter;
#if (_WIN32_IE >= 0x0400)
union
{
TVITEMEXW itemex;
TV_ITEMW item;
} DUMMYUNIONNAME;
#else
TV_ITEMW item;
#endif
} TVINSERTSTRUCTW, FAR *LPTVINSERTSTRUCTW;
#ifdef UNICODE
#define TVINSERTSTRUCT TVINSERTSTRUCTW
#define LPTVINSERTSTRUCT LPTVINSERTSTRUCTW
#define TVINSERTSTRUCT_V1_SIZE TVINSERTSTRUCTW_V1_SIZE
#else
#define TVINSERTSTRUCT TVINSERTSTRUCTA
#define LPTVINSERTSTRUCT LPTVINSERTSTRUCTA
#define TVINSERTSTRUCT_V1_SIZE TVINSERTSTRUCTA_V1_SIZE
#endif
#define TVM_INSERTITEMA (TV_FIRST + 0)
#define TVM_INSERTITEMW (TV_FIRST + 50)
#ifdef UNICODE
#define TVM_INSERTITEM TVM_INSERTITEMW
#else
#define TVM_INSERTITEM TVM_INSERTITEMA
#endif
#define TreeView_InsertItem(hwnd, lpis) \
(HTREEITEM)SNDMSG((hwnd), TVM_INSERTITEM, 0, (LPARAM)(LPTV_INSERTSTRUCT)(lpis))
#define TVM_DELETEITEM (TV_FIRST + 1)
#define TreeView_DeleteItem(hwnd, hitem) \
(BOOL)SNDMSG((hwnd), TVM_DELETEITEM, 0, (LPARAM)(HTREEITEM)(hitem))
#define TreeView_DeleteAllItems(hwnd) \
(BOOL)SNDMSG((hwnd), TVM_DELETEITEM, 0, (LPARAM)TVI_ROOT)
#define TVM_EXPAND (TV_FIRST + 2)
#define TreeView_Expand(hwnd, hitem, code) \
(BOOL)SNDMSG((hwnd), TVM_EXPAND, (WPARAM)code, (LPARAM)(HTREEITEM)(hitem))
#define TVE_COLLAPSE 0x0001
#define TVE_EXPAND 0x0002
#define TVE_TOGGLE 0x0003
#if (_WIN32_IE >= 0x0300)
#define TVE_EXPANDPARTIAL 0x4000
#endif
#define TVE_COLLAPSERESET 0x8000
#define TVM_GETITEMRECT (TV_FIRST + 4)
#define TreeView_GetItemRect(hwnd, hitem, prc, code) \
(*(HTREEITEM FAR *)prc = (hitem), (BOOL)SNDMSG((hwnd), TVM_GETITEMRECT, (WPARAM)(code), (LPARAM)(RECT FAR*)(prc)))
#define TVM_GETCOUNT (TV_FIRST + 5)
#define TreeView_GetCount(hwnd) \
(UINT)SNDMSG((hwnd), TVM_GETCOUNT, 0, 0)
#define TVM_GETINDENT (TV_FIRST + 6)
#define TreeView_GetIndent(hwnd) \
(UINT)SNDMSG((hwnd), TVM_GETINDENT, 0, 0)
#define TVM_SETINDENT (TV_FIRST + 7)
#define TreeView_SetIndent(hwnd, indent) \
(BOOL)SNDMSG((hwnd), TVM_SETINDENT, (WPARAM)indent, 0)
#define TVM_GETIMAGELIST (TV_FIRST + 8)
#define TreeView_GetImageList(hwnd, iImage) \
(HIMAGELIST)SNDMSG((hwnd), TVM_GETIMAGELIST, iImage, 0)
#define TVSIL_NORMAL 0
#define TVSIL_STATE 2
#define TVM_SETIMAGELIST (TV_FIRST + 9)
#define TreeView_SetImageList(hwnd, himl, iImage) \
(HIMAGELIST)SNDMSG((hwnd), TVM_SETIMAGELIST, iImage, (LPARAM)(UINT)(HIMAGELIST)(himl))
#define TVM_GETNEXTITEM (TV_FIRST + 10)
#define TreeView_GetNextItem(hwnd, hitem, code) \
(HTREEITEM)SNDMSG((hwnd), TVM_GETNEXTITEM, (WPARAM)code, (LPARAM)(HTREEITEM)(hitem))
#define TVGN_ROOT 0x0000
#define TVGN_NEXT 0x0001
#define TVGN_PREVIOUS 0x0002
#define TVGN_PARENT 0x0003
#define TVGN_CHILD 0x0004
#define TVGN_FIRSTVISIBLE 0x0005
#define TVGN_NEXTVISIBLE 0x0006
#define TVGN_PREVIOUSVISIBLE 0x0007
#define TVGN_DROPHILITE 0x0008
#define TVGN_CARET 0x0009
#if (_WIN32_IE >= 0x0400)
#define TVGN_LASTVISIBLE 0x000A
#endif // _WIN32_IE >= 0x0400
#define TreeView_GetChild(hwnd, hitem) TreeView_GetNextItem(hwnd, hitem, TVGN_CHILD)
#define TreeView_GetNextSibling(hwnd, hitem) TreeView_GetNextItem(hwnd, hitem, TVGN_NEXT)
#define TreeView_GetPrevSibling(hwnd, hitem) TreeView_GetNextItem(hwnd, hitem, TVGN_PREVIOUS)
#define TreeView_GetParent(hwnd, hitem) TreeView_GetNextItem(hwnd, hitem, TVGN_PARENT)
#define TreeView_GetFirstVisible(hwnd) TreeView_GetNextItem(hwnd, NULL, TVGN_FIRSTVISIBLE)
#define TreeView_GetNextVisible(hwnd, hitem) TreeView_GetNextItem(hwnd, hitem, TVGN_NEXTVISIBLE)
#define TreeView_GetPrevVisible(hwnd, hitem) TreeView_GetNextItem(hwnd, hitem, TVGN_PREVIOUSVISIBLE)
#define TreeView_GetSelection(hwnd) TreeView_GetNextItem(hwnd, NULL, TVGN_CARET)
#define TreeView_GetDropHilight(hwnd) TreeView_GetNextItem(hwnd, NULL, TVGN_DROPHILITE)
#define TreeView_GetRoot(hwnd) TreeView_GetNextItem(hwnd, NULL, TVGN_ROOT)
#if (_WIN32_IE >= 0x0400)
#define TreeView_GetLastVisible(hwnd) TreeView_GetNextItem(hwnd, NULL, TVGN_LASTVISIBLE)
#endif // _WIN32_IE >= 0x0400
#define TVM_SELECTITEM (TV_FIRST + 11)
#define TreeView_Select(hwnd, hitem, code) \
(BOOL)SNDMSG((hwnd), TVM_SELECTITEM, (WPARAM)code, (LPARAM)(HTREEITEM)(hitem))
#define TreeView_SelectItem(hwnd, hitem) TreeView_Select(hwnd, hitem, TVGN_CARET)
#define TreeView_SelectDropTarget(hwnd, hitem) TreeView_Select(hwnd, hitem, TVGN_DROPHILITE)
#define TreeView_SelectSetFirstVisible(hwnd, hitem) TreeView_Select(hwnd, hitem, TVGN_FIRSTVISIBLE)
#define TVM_GETITEMA (TV_FIRST + 12)
#define TVM_GETITEMW (TV_FIRST + 62)
#ifdef UNICODE
#define TVM_GETITEM TVM_GETITEMW
#else
#define TVM_GETITEM TVM_GETITEMA
#endif
#define TreeView_GetItem(hwnd, pitem) \
(BOOL)SNDMSG((hwnd), TVM_GETITEM, 0, (LPARAM)(TV_ITEM FAR*)(pitem))
#define TVM_SETITEMA (TV_FIRST + 13)
#define TVM_SETITEMW (TV_FIRST + 63)
#ifdef UNICODE
#define TVM_SETITEM TVM_SETITEMW
#else
#define TVM_SETITEM TVM_SETITEMA
#endif
#define TreeView_SetItem(hwnd, pitem) \
(BOOL)SNDMSG((hwnd), TVM_SETITEM, 0, (LPARAM)(const TV_ITEM FAR*)(pitem))
#define TVM_EDITLABELA (TV_FIRST + 14)
#define TVM_EDITLABELW (TV_FIRST + 65)
#ifdef UNICODE
#define TVM_EDITLABEL TVM_EDITLABELW
#else
#define TVM_EDITLABEL TVM_EDITLABELA
#endif
#define TreeView_EditLabel(hwnd, hitem) \
(HWND)SNDMSG((hwnd), TVM_EDITLABEL, 0, (LPARAM)(HTREEITEM)(hitem))
#define TVM_GETEDITCONTROL (TV_FIRST + 15)
#define TreeView_GetEditControl(hwnd) \
(HWND)SNDMSG((hwnd), TVM_GETEDITCONTROL, 0, 0)
#define TVM_GETVISIBLECOUNT (TV_FIRST + 16)
#define TreeView_GetVisibleCount(hwnd) \
(UINT)SNDMSG((hwnd), TVM_GETVISIBLECOUNT, 0, 0)
#define TVM_HITTEST (TV_FIRST + 17)
#define TreeView_HitTest(hwnd, lpht) \
(HTREEITEM)SNDMSG((hwnd), TVM_HITTEST, 0, (LPARAM)(LPTV_HITTESTINFO)(lpht))
#if (_WIN32_IE >= 0x0300)
#define LPTV_HITTESTINFO LPTVHITTESTINFO
#define TV_HITTESTINFO TVHITTESTINFO
#else
#define tagTVHITTESTINFO _TV_HITTESTINFO
#define TVHITTESTINFO TV_HITTESTINFO
#define LPTVHITTESTINFO LPTV_HITTESTINFO
#endif
typedef struct tagTVHITTESTINFO {
POINT pt;
UINT flags;
HTREEITEM hItem;
} TVHITTESTINFO, FAR *LPTVHITTESTINFO;
#define TVHT_NOWHERE 0x0001
#define TVHT_ONITEMICON 0x0002
#define TVHT_ONITEMLABEL 0x0004
#define TVHT_ONITEM (TVHT_ONITEMICON | TVHT_ONITEMLABEL | TVHT_ONITEMSTATEICON)
#define TVHT_ONITEMINDENT 0x0008
#define TVHT_ONITEMBUTTON 0x0010
#define TVHT_ONITEMRIGHT 0x0020
#define TVHT_ONITEMSTATEICON 0x0040
#define TVHT_ABOVE 0x0100
#define TVHT_BELOW 0x0200
#define TVHT_TORIGHT 0x0400
#define TVHT_TOLEFT 0x0800
#define TVM_CREATEDRAGIMAGE (TV_FIRST + 18)
#define TreeView_CreateDragImage(hwnd, hitem) \
(HIMAGELIST)SNDMSG((hwnd), TVM_CREATEDRAGIMAGE, 0, (LPARAM)(HTREEITEM)(hitem))
#define TVM_SORTCHILDREN (TV_FIRST + 19)
#define TreeView_SortChildren(hwnd, hitem, recurse) \
(BOOL)SNDMSG((hwnd), TVM_SORTCHILDREN, (WPARAM)recurse, (LPARAM)(HTREEITEM)(hitem))
#define TVM_ENSUREVISIBLE (TV_FIRST + 20)
#define TreeView_EnsureVisible(hwnd, hitem) \
(BOOL)SNDMSG((hwnd), TVM_ENSUREVISIBLE, 0, (LPARAM)(HTREEITEM)(hitem))
#define TVM_SORTCHILDRENCB (TV_FIRST + 21)
#define TreeView_SortChildrenCB(hwnd, psort, recurse) \
(BOOL)SNDMSG((hwnd), TVM_SORTCHILDRENCB, (WPARAM)recurse, \
(LPARAM)(LPTV_SORTCB)(psort))
#define TVM_ENDEDITLABELNOW (TV_FIRST + 22)
#define TreeView_EndEditLabelNow(hwnd, fCancel) \
(BOOL)SNDMSG((hwnd), TVM_ENDEDITLABELNOW, (WPARAM)fCancel, 0)
#define TVM_GETISEARCHSTRINGA (TV_FIRST + 23)
#define TVM_GETISEARCHSTRINGW (TV_FIRST + 64)
#ifdef UNICODE
#define TVM_GETISEARCHSTRING TVM_GETISEARCHSTRINGW
#else
#define TVM_GETISEARCHSTRING TVM_GETISEARCHSTRINGA
#endif
#if (_WIN32_IE >= 0x0300)
#define TVM_SETTOOLTIPS (TV_FIRST + 24)
#define TreeView_SetToolTips(hwnd, hwndTT) \
(HWND)SNDMSG((hwnd), TVM_SETTOOLTIPS, (WPARAM)hwndTT, 0)
#define TVM_GETTOOLTIPS (TV_FIRST + 25)
#define TreeView_GetToolTips(hwnd) \
(HWND)SNDMSG((hwnd), TVM_GETTOOLTIPS, 0, 0)
#endif
#define TreeView_GetISearchString(hwndTV, lpsz) \
(BOOL)SNDMSG((hwndTV), TVM_GETISEARCHSTRING, 0, (LPARAM)(LPTSTR)lpsz)
#if (_WIN32_IE >= 0x0400)
#define TVM_SETINSERTMARK (TV_FIRST + 26)
#define TreeView_SetInsertMark(hwnd, hItem, fAfter) \
(BOOL)SNDMSG((hwnd), TVM_SETINSERTMARK, (WPARAM) (fAfter), (LPARAM) (hItem))
#define TVM_SETUNICODEFORMAT CCM_SETUNICODEFORMAT
#define TreeView_SetUnicodeFormat(hwnd, fUnicode) \
(BOOL)SNDMSG((hwnd), TVM_SETUNICODEFORMAT, (WPARAM)(fUnicode), 0)
#define TVM_GETUNICODEFORMAT CCM_GETUNICODEFORMAT
#define TreeView_GetUnicodeFormat(hwnd) \
(BOOL)SNDMSG((hwnd), TVM_GETUNICODEFORMAT, 0, 0)
#endif
#if (_WIN32_IE >= 0x0400)
#define TVM_SETITEMHEIGHT (TV_FIRST + 27)
#define TreeView_SetItemHeight(hwnd, iHeight) \
(int)SNDMSG((hwnd), TVM_SETITEMHEIGHT, (WPARAM)iHeight, 0)
#define TVM_GETITEMHEIGHT (TV_FIRST + 28)
#define TreeView_GetItemHeight(hwnd) \
(int)SNDMSG((hwnd), TVM_GETITEMHEIGHT, 0, 0)
#define TVM_SETBKCOLOR (TV_FIRST + 29)
#define TreeView_SetBkColor(hwnd, clr) \
(COLORREF)SNDMSG((hwnd), TVM_SETBKCOLOR, 0, (LPARAM)clr)
#define TVM_SETTEXTCOLOR (TV_FIRST + 30)
#define TreeView_SetTextColor(hwnd, clr) \
(COLORREF)SNDMSG((hwnd), TVM_SETTEXTCOLOR, 0, (LPARAM)clr)
#define TVM_GETBKCOLOR (TV_FIRST + 31)
#define TreeView_GetBkColor(hwnd) \
(COLORREF)SNDMSG((hwnd), TVM_GETBKCOLOR, 0, 0)
#define TVM_GETTEXTCOLOR (TV_FIRST + 32)
#define TreeView_GetTextColor(hwnd) \
(COLORREF)SNDMSG((hwnd), TVM_GETTEXTCOLOR, 0, 0)
#define TVM_SETSCROLLTIME (TV_FIRST + 33)
#define TreeView_SetScrollTime(hwnd, uTime) \
(UINT)SNDMSG((hwnd), TVM_SETSCROLLTIME, uTime, 0)
#define TVM_GETSCROLLTIME (TV_FIRST + 34)
#define TreeView_GetScrollTime(hwnd) \
(UINT)SNDMSG((hwnd), TVM_GETSCROLLTIME, 0, 0)
#if (_WIN32_IE >= 0x0400)
#define TVM_SETINSERTMARKCOLOR (TV_FIRST + 37)
#define TreeView_SetInsertMarkColor(hwnd, clr) \
(COLORREF)SNDMSG((hwnd), TVM_SETINSERTMARKCOLOR, 0, (LPARAM)clr)
#define TVM_GETINSERTMARKCOLOR (TV_FIRST + 38)
#define TreeView_GetInsertMarkColor(hwnd) \
(COLORREF)SNDMSG((hwnd), TVM_GETINSERTMARKCOLOR, 0, 0)
#endif /* (_WIN32_IE >= 0x0400) */
#endif
typedef int (CALLBACK *PFNTVCOMPARE)(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);
#if (_WIN32_IE >= 0x0300)
#define LPTV_SORTCB LPTVSORTCB
#define TV_SORTCB TVSORTCB
#else
#define tagTVSORTCB _TV_SORTCB
#define TVSORTCB TV_SORTCB
#define LPTVSORTCB LPTV_SORTCB
#endif
typedef struct tagTVSORTCB
{
HTREEITEM hParent;
PFNTVCOMPARE lpfnCompare;
LPARAM lParam;
} TVSORTCB, FAR *LPTVSORTCB;
#if (_WIN32_IE >= 0x0300)
#define LPNM_TREEVIEWA LPNMTREEVIEWA
#define LPNM_TREEVIEWW LPNMTREEVIEWW
#define NM_TREEVIEWW NMTREEVIEWW
#define NM_TREEVIEWA NMTREEVIEWA
#else
#define tagNMTREEVIEWA _NM_TREEVIEWA
#define tagNMTREEVIEWW _NM_TREEVIEWW
#define NMTREEVIEWA NM_TREEVIEWA
#define NMTREEVIEWW NM_TREEVIEWW
#define LPNMTREEVIEWA LPNM_TREEVIEWA
#define LPNMTREEVIEWW LPNM_TREEVIEWW
#endif
#define LPNM_TREEVIEW LPNMTREEVIEW
#define NM_TREEVIEW NMTREEVIEW
typedef struct tagNMTREEVIEWA {
NMHDR hdr;
UINT action;
TVITEMA itemOld;
TVITEMA itemNew;
POINT ptDrag;
} NMTREEVIEWA, FAR *LPNMTREEVIEWA;
typedef struct tagNMTREEVIEWW {
NMHDR hdr;
UINT action;
TVITEMW itemOld;
TVITEMW itemNew;
POINT ptDrag;
} NMTREEVIEWW, FAR *LPNMTREEVIEWW;
#ifdef UNICODE
#define NMTREEVIEW NMTREEVIEWW
#define LPNMTREEVIEW LPNMTREEVIEWW
#else
#define NMTREEVIEW NMTREEVIEWA
#define LPNMTREEVIEW LPNMTREEVIEWA
#endif
#define TVN_SELCHANGINGA (TVN_FIRST-1)
#define TVN_SELCHANGINGW (TVN_FIRST-50)
#define TVN_SELCHANGEDA (TVN_FIRST-2)
#define TVN_SELCHANGEDW (TVN_FIRST-51)
#define TVC_UNKNOWN 0x0000
#define TVC_BYMOUSE 0x0001
#define TVC_BYKEYBOARD 0x0002
#define TVN_GETDISPINFOA (TVN_FIRST-3)
#define TVN_GETDISPINFOW (TVN_FIRST-52)
#define TVN_SETDISPINFOA (TVN_FIRST-4)
#define TVN_SETDISPINFOW (TVN_FIRST-53)
#define TVIF_DI_SETITEM 0x1000
#if (_WIN32_IE >= 0x0300)
#define TV_DISPINFOA NMTVDISPINFOA
#define TV_DISPINFOW NMTVDISPINFOW
#else
#define tagTVDISPINFOA _TV_DISPINFOA
#define NMTVDISPINFOA TV_DISPINFOA
#define tagTVDISPINFOW _TV_DISPINFOW
#define NMTVDISPINFOW TV_DISPINFOW
#endif
#define TV_DISPINFO NMTVDISPINFO
typedef struct tagTVDISPINFOA {
NMHDR hdr;
TVITEMA item;
} NMTVDISPINFOA, FAR *LPNMTVDISPINFOA;
typedef struct tagTVDISPINFOW {
NMHDR hdr;
TVITEMW item;
} NMTVDISPINFOW, FAR *LPNMTVDISPINFOW;
#ifdef UNICODE
#define NMTVDISPINFO NMTVDISPINFOW
#define LPNMTVDISPINFO LPNMTVDISPINFOW
#else
#define NMTVDISPINFO NMTVDISPINFOA
#define LPNMTVDISPINFO LPNMTVDISPINFOA
#endif
#define TVN_ITEMEXPANDINGA (TVN_FIRST-5)
#define TVN_ITEMEXPANDINGW (TVN_FIRST-54)
#define TVN_ITEMEXPANDEDA (TVN_FIRST-6)
#define TVN_ITEMEXPANDEDW (TVN_FIRST-55)
#define TVN_BEGINDRAGA (TVN_FIRST-7)
#define TVN_BEGINDRAGW (TVN_FIRST-56)
#define TVN_BEGINRDRAGA (TVN_FIRST-8)
#define TVN_BEGINRDRAGW (TVN_FIRST-57)
#define TVN_DELETEITEMA (TVN_FIRST-9)
#define TVN_DELETEITEMW (TVN_FIRST-58)
#define TVN_BEGINLABELEDITA (TVN_FIRST-10)
#define TVN_BEGINLABELEDITW (TVN_FIRST-59)
#define TVN_ENDLABELEDITA (TVN_FIRST-11)
#define TVN_ENDLABELEDITW (TVN_FIRST-60)
#define TVN_KEYDOWN (TVN_FIRST-12)
#if (_WIN32_IE >= 0x0400)
#define TVN_GETINFOTIPA (TVN_FIRST-13)
#define TVN_GETINFOTIPW (TVN_FIRST-14)
#define TVN_SINGLEEXPAND (TVN_FIRST-15)
#endif // 0x400
#if (_WIN32_IE >= 0x0300)
#define TV_KEYDOWN NMTVKEYDOWN
#else
#define tagTVKEYDOWN _TV_KEYDOWN
#define NMTVKEYDOWN TV_KEYDOWN
#endif
typedef struct tagTVKEYDOWN {
NMHDR hdr;
WORD wVKey;
UINT flags;
} NMTVKEYDOWN, FAR *LPNMTVKEYDOWN;
#ifdef UNICODE
#define TVN_SELCHANGING TVN_SELCHANGINGW
#define TVN_SELCHANGED TVN_SELCHANGEDW
#define TVN_GETDISPINFO TVN_GETDISPINFOW
#define TVN_SETDISPINFO TVN_SETDISPINFOW
#define TVN_ITEMEXPANDING TVN_ITEMEXPANDINGW
#define TVN_ITEMEXPANDED TVN_ITEMEXPANDEDW
#define TVN_BEGINDRAG TVN_BEGINDRAGW
#define TVN_BEGINRDRAG TVN_BEGINRDRAGW
#define TVN_DELETEITEM TVN_DELETEITEMW
#define TVN_BEGINLABELEDIT TVN_BEGINLABELEDITW
#define TVN_ENDLABELEDIT TVN_ENDLABELEDITW
#else
#define TVN_SELCHANGING TVN_SELCHANGINGA
#define TVN_SELCHANGED TVN_SELCHANGEDA
#define TVN_GETDISPINFO TVN_GETDISPINFOA
#define TVN_SETDISPINFO TVN_SETDISPINFOA
#define TVN_ITEMEXPANDING TVN_ITEMEXPANDINGA
#define TVN_ITEMEXPANDED TVN_ITEMEXPANDEDA
#define TVN_BEGINDRAG TVN_BEGINDRAGA
#define TVN_BEGINRDRAG TVN_BEGINRDRAGA
#define TVN_DELETEITEM TVN_DELETEITEMA
#define TVN_BEGINLABELEDIT TVN_BEGINLABELEDITA
#define TVN_ENDLABELEDIT TVN_ENDLABELEDITA
#endif
#if (_WIN32_IE >= 0x0300)
#define NMTVCUSTOMDRAW_V3_SIZE CCSIZEOF_STRUCT(NMTVCUSTOMDRAW, clrTextBk)
typedef struct tagNMTVCUSTOMDRAW
{
NMCUSTOMDRAW nmcd;
COLORREF clrText;
COLORREF clrTextBk;
#if (_WIN32_IE >= 0x0400)
int iLevel;
#endif
} NMTVCUSTOMDRAW, *LPNMTVCUSTOMDRAW;
#endif
#if (_WIN32_IE >= 0x0400)
// for tooltips
typedef struct tagNMTVGETINFOTIPA
{
NMHDR hdr;
LPSTR pszText;
int cchTextMax;
HTREEITEM hItem;
LPARAM lParam;
} NMTVGETINFOTIPA, *LPNMTVGETINFOTIPA;
typedef struct tagNMTVGETINFOTIPW
{
NMHDR hdr;
LPWSTR pszText;
int cchTextMax;
HTREEITEM hItem;
LPARAM lParam;
} NMTVGETINFOTIPW, *LPNMTVGETINFOTIPW;
#ifdef UNICODE
#define TVN_GETINFOTIP TVN_GETINFOTIPW
#define NMTVGETINFOTIP NMTVGETINFOTIPW
#define LPNMTVGETINFOTIP LPNMTVGETINFOTIPW
#else
#define TVN_GETINFOTIP TVN_GETINFOTIPA
#define NMTVGETINFOTIP NMTVGETINFOTIPA
#define LPNMTVGETINFOTIP LPNMTVGETINFOTIPA
#endif
// treeview's customdraw return meaning don't draw images. valid on CDRF_NOTIFYITEMPREPAINT
#define TVCDRF_NOIMAGES 0x00010000
#endif // _WIN32_IE >= 0x0400
#endif // NOTREEVIEW
#if (_WIN32_IE >= 0x0300)
#ifndef NOUSEREXCONTROLS
//////////////////// ComboBoxEx ////////////////////////////////
#define WC_COMBOBOXEXW L"ComboBoxEx32"
#define WC_COMBOBOXEXA "ComboBoxEx32"
#ifdef UNICODE
#define WC_COMBOBOXEX WC_COMBOBOXEXW
#else
#define WC_COMBOBOXEX WC_COMBOBOXEXA
#endif
#define CBEIF_TEXT 0x00000001
#define CBEIF_IMAGE 0x00000002
#define CBEIF_SELECTEDIMAGE 0x00000004
#define CBEIF_OVERLAY 0x00000008
#define CBEIF_INDENT 0x00000010
#define CBEIF_LPARAM 0x00000020
#define CBEIF_DI_SETITEM 0x10000000
typedef struct tagCOMBOBOXEXITEMA
{
UINT mask;
int iItem;
LPSTR pszText;
int cchTextMax;
int iImage;
int iSelectedImage;
int iOverlay;
int iIndent;
LPARAM lParam;
} COMBOBOXEXITEMA, *PCOMBOBOXEXITEMA;
typedef COMBOBOXEXITEMA CONST *PCCOMBOEXITEMA;
typedef struct tagCOMBOBOXEXITEMW
{
UINT mask;
int iItem;
LPWSTR pszText;
int cchTextMax;
int iImage;
int iSelectedImage;
int iOverlay;
int iIndent;
LPARAM lParam;
} COMBOBOXEXITEMW, *PCOMBOBOXEXITEMW;
typedef COMBOBOXEXITEMW CONST *PCCOMBOEXITEMW;
#ifdef UNICODE
#define COMBOBOXEXITEM COMBOBOXEXITEMW
#define PCOMBOBOXEXITEM PCOMBOBOXEXITEMW
#define PCCOMBOBOXEXITEM PCCOMBOBOXEXITEMW
#else
#define COMBOBOXEXITEM COMBOBOXEXITEMA
#define PCOMBOBOXEXITEM PCOMBOBOXEXITEMA
#define PCCOMBOBOXEXITEM PCCOMBOBOXEXITEMA
#endif
#define CBEM_INSERTITEMA (WM_USER + 1)
#define CBEM_SETIMAGELIST (WM_USER + 2)
#define CBEM_GETIMAGELIST (WM_USER + 3)
#define CBEM_GETITEMA (WM_USER + 4)
#define CBEM_SETITEMA (WM_USER + 5)
#define CBEM_DELETEITEM CB_DELETESTRING
#define CBEM_GETCOMBOCONTROL (WM_USER + 6)
#define CBEM_GETEDITCONTROL (WM_USER + 7)
#if (_WIN32_IE >= 0x0400)
#define CBEM_SETEXSTYLE (WM_USER + 8) // use SETEXTENDEDSTYLE instead
#define CBEM_SETEXTENDEDSTYLE (WM_USER + 14) // lparam == new style, wParam (optional) == mask
#define CBEM_GETEXSTYLE (WM_USER + 9) // use GETEXTENDEDSTYLE instead
#define CBEM_GETEXTENDEDSTYLE (WM_USER + 9)
#define CBEM_SETUNICODEFORMAT CCM_SETUNICODEFORMAT
#define CBEM_GETUNICODEFORMAT CCM_GETUNICODEFORMAT
#else
#define CBEM_SETEXSTYLE (WM_USER + 8)
#define CBEM_GETEXSTYLE (WM_USER + 9)
#endif
#define CBEM_HASEDITCHANGED (WM_USER + 10)
#define CBEM_INSERTITEMW (WM_USER + 11)
#define CBEM_SETITEMW (WM_USER + 12)
#define CBEM_GETITEMW (WM_USER + 13)
#ifdef UNICODE
#define CBEM_INSERTITEM CBEM_INSERTITEMW
#define CBEM_SETITEM CBEM_SETITEMW
#define CBEM_GETITEM CBEM_GETITEMW
#else
#define CBEM_INSERTITEM CBEM_INSERTITEMA
#define CBEM_SETITEM CBEM_SETITEMA
#define CBEM_GETITEM CBEM_GETITEMA
#endif
#define CBES_EX_NOEDITIMAGE 0x00000001
#define CBES_EX_NOEDITIMAGEINDENT 0x00000002
#define CBES_EX_PATHWORDBREAKPROC 0x00000004
#if (_WIN32_IE >= 0x0400)
#define CBES_EX_NOSIZELIMIT 0x00000008
#define CBES_EX_CASESENSITIVE 0x00000010
typedef struct {
NMHDR hdr;
COMBOBOXEXITEMA ceItem;
} NMCOMBOBOXEXA, *PNMCOMBOBOXEXA;
typedef struct {
NMHDR hdr;
COMBOBOXEXITEMW ceItem;
} NMCOMBOBOXEXW, *PNMCOMBOBOXEXW;
#ifdef UNICODE
#define NMCOMBOBOXEX NMCOMBOBOXEXW
#define PNMCOMBOBOXEX PNMCOMBOBOXEXW
#define CBEN_GETDISPINFO CBEN_GETDISPINFOW
#else
#define NMCOMBOBOXEX NMCOMBOBOXEXA
#define PNMCOMBOBOXEX PNMCOMBOBOXEXA
#define CBEN_GETDISPINFO CBEN_GETDISPINFOA
#endif
#else
typedef struct {
NMHDR hdr;
COMBOBOXEXITEM ceItem;
} NMCOMBOBOXEX, *PNMCOMBOBOXEX;
#define CBEN_GETDISPINFO (CBEN_FIRST - 0)
#endif // _WIN32_IE >= 0x0400
#if (_WIN32_IE >= 0x0400)
#define CBEN_GETDISPINFOA (CBEN_FIRST - 0)
#endif
#define CBEN_INSERTITEM (CBEN_FIRST - 1)
#define CBEN_DELETEITEM (CBEN_FIRST - 2)
#define CBEN_BEGINEDIT (CBEN_FIRST - 4)
#define CBEN_ENDEDITA (CBEN_FIRST - 5)
#define CBEN_ENDEDITW (CBEN_FIRST - 6)
#if (_WIN32_IE >= 0x0400)
#define CBEN_GETDISPINFOW (CBEN_FIRST - 7)
#endif
#if (_WIN32_IE >= 0x0400)
#define CBEN_DRAGBEGINA (CBEN_FIRST - 8)
#define CBEN_DRAGBEGINW (CBEN_FIRST - 9)
#ifdef UNICODE
#define CBEN_DRAGBEGIN CBEN_DRAGBEGINW
#else
#define CBEN_DRAGBEGIN CBEN_DRAGBEGINA
#endif
#endif //(_WIN32_IE >= 0x0400)
// lParam specifies why the endedit is happening
#ifdef UNICODE
#define CBEN_ENDEDIT CBEN_ENDEDITW
#else
#define CBEN_ENDEDIT CBEN_ENDEDITA
#endif
#define CBENF_KILLFOCUS 1
#define CBENF_RETURN 2
#define CBENF_ESCAPE 3
#define CBENF_DROPDOWN 4
#define CBEMAXSTRLEN 260
#if (_WIN32_IE >= 0x0400)
// CBEN_DRAGBEGIN sends this information ...
typedef struct {
NMHDR hdr;
int iItemid;
WCHAR szText[CBEMAXSTRLEN];
}NMCBEDRAGBEGINW, *LPNMCBEDRAGBEGINW, *PNMCBEDRAGBEGINW;
typedef struct {
NMHDR hdr;
int iItemid;
char szText[CBEMAXSTRLEN];
}NMCBEDRAGBEGINA, *LPNMCBEDRAGBEGINA, *PNMCBEDRAGBEGINA;
#ifdef UNICODE
#define NMCBEDRAGBEGIN NMCBEDRAGBEGINW
#define LPNMCBEDRAGBEGIN LPNMCBEDRAGBEGINW
#define PNMCBEDRAGBEGIN PNMCBEDRAGBEGINW
#else
#define NMCBEDRAGBEGIN NMCBEDRAGBEGINA
#define LPNMCBEDRAGBEGIN LPNMCBEDRAGBEGINA
#define PNMCBEDRAGBEGIN PNMCBEDRAGBEGINA
#endif
#endif // _WIN32_IE >= 0x0400
// CBEN_ENDEDIT sends this information...
// fChanged if the user actually did anything
// iNewSelection gives what would be the new selection unless the notify is failed
// iNewSelection may be CB_ERR if there's no match
typedef struct {
NMHDR hdr;
BOOL fChanged;
int iNewSelection;
WCHAR szText[CBEMAXSTRLEN];
int iWhy;
} NMCBEENDEDITW, *LPNMCBEENDEDITW, *PNMCBEENDEDITW;
typedef struct {
NMHDR hdr;
BOOL fChanged;
int iNewSelection;
char szText[CBEMAXSTRLEN];
int iWhy;
} NMCBEENDEDITA, *LPNMCBEENDEDITA,*PNMCBEENDEDITA;
#ifdef UNICODE
#define NMCBEENDEDIT NMCBEENDEDITW
#define LPNMCBEENDEDIT LPNMCBEENDEDITW
#define PNMCBEENDEDIT PNMCBEENDEDITW
#else
#define NMCBEENDEDIT NMCBEENDEDITA
#define LPNMCBEENDEDIT LPNMCBEENDEDITA
#define PNMCBEENDEDIT PNMCBEENDEDITA
#endif
#endif
#endif // _WIN32_IE >= 0x0300
//====== TAB CONTROL ==========================================================
#ifndef NOTABCONTROL
#ifdef _WIN32
#define WC_TABCONTROLA "SysTabControl32"
#define WC_TABCONTROLW L"SysTabControl32"
#ifdef UNICODE
#define WC_TABCONTROL WC_TABCONTROLW
#else
#define WC_TABCONTROL WC_TABCONTROLA
#endif
#else
#define WC_TABCONTROL "SysTabControl"
#endif
// begin_r_commctrl
#if (_WIN32_IE >= 0x0300)
#define TCS_SCROLLOPPOSITE 0x0001 // assumes multiline tab
#define TCS_BOTTOM 0x0002
#define TCS_RIGHT 0x0002
#define TCS_MULTISELECT 0x0004 // allow multi-select in button mode
#endif
#if (_WIN32_IE >= 0x0400)
#define TCS_FLATBUTTONS 0x0008
#endif
#define TCS_FORCEICONLEFT 0x0010
#define TCS_FORCELABELLEFT 0x0020
#if (_WIN32_IE >= 0x0300)
#define TCS_HOTTRACK 0x0040
#define TCS_VERTICAL 0x0080
#endif
#define TCS_TABS 0x0000
#define TCS_BUTTONS 0x0100
#define TCS_SINGLELINE 0x0000
#define TCS_MULTILINE 0x0200
#define TCS_RIGHTJUSTIFY 0x0000
#define TCS_FIXEDWIDTH 0x0400
#define TCS_RAGGEDRIGHT 0x0800
#define TCS_FOCUSONBUTTONDOWN 0x1000
#define TCS_OWNERDRAWFIXED 0x2000
#define TCS_TOOLTIPS 0x4000
#define TCS_FOCUSNEVER 0x8000
#if (_WIN32_IE >= 0x0400)
// EX styles for use with TCM_SETEXTENDEDSTYLE
#define TCS_EX_FLATSEPARATORS 0x00000001
#define TCS_EX_REGISTERDROP 0x00000002
#endif
// end_r_commctrl
#define TCM_GETIMAGELIST (TCM_FIRST + 2)
#define TabCtrl_GetImageList(hwnd) \
(HIMAGELIST)SNDMSG((hwnd), TCM_GETIMAGELIST, 0, 0L)
#define TCM_SETIMAGELIST (TCM_FIRST + 3)
#define TabCtrl_SetImageList(hwnd, himl) \
(HIMAGELIST)SNDMSG((hwnd), TCM_SETIMAGELIST, 0, (LPARAM)(UINT)(HIMAGELIST)(himl))
#define TCM_GETITEMCOUNT (TCM_FIRST + 4)
#define TabCtrl_GetItemCount(hwnd) \
(int)SNDMSG((hwnd), TCM_GETITEMCOUNT, 0, 0L)
#define TCIF_TEXT 0x0001
#define TCIF_IMAGE 0x0002
#define TCIF_RTLREADING 0x0004
#define TCIF_PARAM 0x0008
#if (_WIN32_IE >= 0x0300)
#define TCIF_STATE 0x0010
#define TCIS_BUTTONPRESSED 0x0001
#endif
#if (_WIN32_IE >= 0x0400)
#define TCIS_HIGHLIGHTED 0x0002
#endif
#if (_WIN32_IE >= 0x0300)
#define TC_ITEMHEADERA TCITEMHEADERA
#define TC_ITEMHEADERW TCITEMHEADERW
#else
#define tagTCITEMHEADERA _TC_ITEMHEADERA
#define TCITEMHEADERA TC_ITEMHEADERA
#define tagTCITEMHEADERW _TC_ITEMHEADERW
#define TCITEMHEADERW TC_ITEMHEADERW
#endif
#define TC_ITEMHEADER TCITEMHEADER
typedef struct tagTCITEMHEADERA
{
UINT mask;
UINT lpReserved1;
UINT lpReserved2;
LPSTR pszText;
int cchTextMax;
int iImage;
} TCITEMHEADERA, FAR *LPTCITEMHEADERA;
typedef struct tagTCITEMHEADERW
{
UINT mask;
UINT lpReserved1;
UINT lpReserved2;
LPWSTR pszText;
int cchTextMax;
int iImage;
} TCITEMHEADERW, FAR *LPTCITEMHEADERW;
#ifdef UNICODE
#define TCITEMHEADER TCITEMHEADERW
#define LPTCITEMHEADER LPTCITEMHEADERW
#else
#define TCITEMHEADER TCITEMHEADERA
#define LPTCITEMHEADER LPTCITEMHEADERA
#endif
#if (_WIN32_IE >= 0x0300)
#define TC_ITEMA TCITEMA
#define TC_ITEMW TCITEMW
#else
#define tagTCITEMA _TC_ITEMA
#define TCITEMA TC_ITEMA
#define tagTCITEMW _TC_ITEMW
#define TCITEMW TC_ITEMW
#endif
#define TC_ITEM TCITEM
typedef struct tagTCITEMA
{
UINT mask;
#if (_WIN32_IE >= 0x0300)
DWORD dwState;
DWORD dwStateMask;
#else
UINT lpReserved1;
UINT lpReserved2;
#endif
LPSTR pszText;
int cchTextMax;
int iImage;
LPARAM lParam;
} TCITEMA, FAR *LPTCITEMA;
typedef struct tagTCITEMW
{
UINT mask;
#if (_WIN32_IE >= 0x0300)
DWORD dwState;
DWORD dwStateMask;
#else
UINT lpReserved1;
UINT lpReserved2;
#endif
LPWSTR pszText;
int cchTextMax;
int iImage;
LPARAM lParam;
} TCITEMW, FAR *LPTCITEMW;
#ifdef UNICODE
#define TCITEM TCITEMW
#define LPTCITEM LPTCITEMW
#else
#define TCITEM TCITEMA
#define LPTCITEM LPTCITEMA
#endif
#define TCM_GETITEMA (TCM_FIRST + 5)
#define TCM_GETITEMW (TCM_FIRST + 60)
#ifdef UNICODE
#define TCM_GETITEM TCM_GETITEMW
#else
#define TCM_GETITEM TCM_GETITEMA
#endif
#define TabCtrl_GetItem(hwnd, iItem, pitem) \
(BOOL)SNDMSG((hwnd), TCM_GETITEM, (WPARAM)(int)iItem, (LPARAM)(TC_ITEM FAR*)(pitem))
#define TCM_SETITEMA (TCM_FIRST + 6)
#define TCM_SETITEMW (TCM_FIRST + 61)
#ifdef UNICODE
#define TCM_SETITEM TCM_SETITEMW
#else
#define TCM_SETITEM TCM_SETITEMA
#endif
#define TabCtrl_SetItem(hwnd, iItem, pitem) \
(BOOL)SNDMSG((hwnd), TCM_SETITEM, (WPARAM)(int)iItem, (LPARAM)(TC_ITEM FAR*)(pitem))
#define TCM_INSERTITEMA (TCM_FIRST + 7)
#define TCM_INSERTITEMW (TCM_FIRST + 62)
#ifdef UNICODE
#define TCM_INSERTITEM TCM_INSERTITEMW
#else
#define TCM_INSERTITEM TCM_INSERTITEMA
#endif
#define TabCtrl_InsertItem(hwnd, iItem, pitem) \
(int)SNDMSG((hwnd), TCM_INSERTITEM, (WPARAM)(int)iItem, (LPARAM)(const TC_ITEM FAR*)(pitem))
#define TCM_DELETEITEM (TCM_FIRST + 8)
#define TabCtrl_DeleteItem(hwnd, i) \
(BOOL)SNDMSG((hwnd), TCM_DELETEITEM, (WPARAM)(int)(i), 0L)
#define TCM_DELETEALLITEMS (TCM_FIRST + 9)
#define TabCtrl_DeleteAllItems(hwnd) \
(BOOL)SNDMSG((hwnd), TCM_DELETEALLITEMS, 0, 0L)
#define TCM_GETITEMRECT (TCM_FIRST + 10)
#define TabCtrl_GetItemRect(hwnd, i, prc) \
(BOOL)SNDMSG((hwnd), TCM_GETITEMRECT, (WPARAM)(int)(i), (LPARAM)(RECT FAR*)(prc))
#define TCM_GETCURSEL (TCM_FIRST + 11)
#define TabCtrl_GetCurSel(hwnd) \
(int)SNDMSG((hwnd), TCM_GETCURSEL, 0, 0)
#define TCM_SETCURSEL (TCM_FIRST + 12)
#define TabCtrl_SetCurSel(hwnd, i) \
(int)SNDMSG((hwnd), TCM_SETCURSEL, (WPARAM)i, 0)
#define TCHT_NOWHERE 0x0001
#define TCHT_ONITEMICON 0x0002
#define TCHT_ONITEMLABEL 0x0004
#define TCHT_ONITEM (TCHT_ONITEMICON | TCHT_ONITEMLABEL)
#if (_WIN32_IE >= 0x0300)
#define LPTC_HITTESTINFO LPTCHITTESTINFO
#define TC_HITTESTINFO TCHITTESTINFO
#else
#define tagTCHITTESTINFO _TC_HITTESTINFO
#define TCHITTESTINFO TC_HITTESTINFO
#define LPTCHITTESTINFO LPTC_HITTESTINFO
#endif
typedef struct tagTCHITTESTINFO
{
POINT pt;
UINT flags;
} TCHITTESTINFO, FAR * LPTCHITTESTINFO;
#define TCM_HITTEST (TCM_FIRST + 13)
#define TabCtrl_HitTest(hwndTC, pinfo) \
(int)SNDMSG((hwndTC), TCM_HITTEST, 0, (LPARAM)(TC_HITTESTINFO FAR*)(pinfo))
#define TCM_SETITEMEXTRA (TCM_FIRST + 14)
#define TabCtrl_SetItemExtra(hwndTC, cb) \
(BOOL)SNDMSG((hwndTC), TCM_SETITEMEXTRA, (WPARAM)(cb), 0L)
#define TCM_ADJUSTRECT (TCM_FIRST + 40)
#define TabCtrl_AdjustRect(hwnd, bLarger, prc) \
(int)SNDMSG(hwnd, TCM_ADJUSTRECT, (WPARAM)(BOOL)bLarger, (LPARAM)(RECT FAR *)prc)
#define TCM_SETITEMSIZE (TCM_FIRST + 41)
#define TabCtrl_SetItemSize(hwnd, x, y) \
(DWORD)SNDMSG((hwnd), TCM_SETITEMSIZE, 0, MAKELPARAM(x,y))
#define TCM_REMOVEIMAGE (TCM_FIRST + 42)
#define TabCtrl_RemoveImage(hwnd, i) \
(void)SNDMSG((hwnd), TCM_REMOVEIMAGE, i, 0L)
#define TCM_SETPADDING (TCM_FIRST + 43)
#define TabCtrl_SetPadding(hwnd, cx, cy) \
(void)SNDMSG((hwnd), TCM_SETPADDING, 0, MAKELPARAM(cx, cy))
#define TCM_GETROWCOUNT (TCM_FIRST + 44)
#define TabCtrl_GetRowCount(hwnd) \
(int)SNDMSG((hwnd), TCM_GETROWCOUNT, 0, 0L)
#define TCM_GETTOOLTIPS (TCM_FIRST + 45)
#define TabCtrl_GetToolTips(hwnd) \
(HWND)SNDMSG((hwnd), TCM_GETTOOLTIPS, 0, 0L)
#define TCM_SETTOOLTIPS (TCM_FIRST + 46)
#define TabCtrl_SetToolTips(hwnd, hwndTT) \
(void)SNDMSG((hwnd), TCM_SETTOOLTIPS, (WPARAM)hwndTT, 0L)
#define TCM_GETCURFOCUS (TCM_FIRST + 47)
#define TabCtrl_GetCurFocus(hwnd) \
(int)SNDMSG((hwnd), TCM_GETCURFOCUS, 0, 0)
#define TCM_SETCURFOCUS (TCM_FIRST + 48)
#define TabCtrl_SetCurFocus(hwnd, i) \
SNDMSG((hwnd),TCM_SETCURFOCUS, i, 0)
#if (_WIN32_IE >= 0x0300)
#define TCM_SETMINTABWIDTH (TCM_FIRST + 49)
#define TabCtrl_SetMinTabWidth(hwnd, x) \
(int)SNDMSG((hwnd), TCM_SETMINTABWIDTH, 0, x)
#define TCM_DESELECTALL (TCM_FIRST + 50)
#define TabCtrl_DeselectAll(hwnd, fExcludeFocus)\
(void)SNDMSG((hwnd), TCM_DESELECTALL, fExcludeFocus, 0)
#endif
#if (_WIN32_IE >= 0x0400)
#define TCM_HIGHLIGHTITEM (TCM_FIRST + 51)
#define TabCtrl_HighlightItem(hwnd, i, fHighlight) \
(BOOL)SNDMSG((hwnd), TCM_HIGHLIGHTITEM, (WPARAM)i, (LPARAM)MAKELONG (fHighlight, 0))
#define TCM_SETEXTENDEDSTYLE (TCM_FIRST + 52) // optional wParam == mask
#define TabCtrl_SetExtendedStyle(hwnd, dw)\
(DWORD)SNDMSG((hwnd), TCM_SETEXTENDEDSTYLE, 0, dw)
#define TCM_GETEXTENDEDSTYLE (TCM_FIRST + 53)
#define TabCtrl_GetExtendedStyle(hwnd)\
(DWORD)SNDMSG((hwnd), TCM_GETEXTENDEDSTYLE, 0, 0)
#define TCM_SETUNICODEFORMAT CCM_SETUNICODEFORMAT
#define TabCtrl_SetUnicodeFormat(hwnd, fUnicode) \
(BOOL)SNDMSG((hwnd), TCM_SETUNICODEFORMAT, (WPARAM)(fUnicode), 0)
#define TCM_GETUNICODEFORMAT CCM_GETUNICODEFORMAT
#define TabCtrl_GetUnicodeFormat(hwnd) \
(BOOL)SNDMSG((hwnd), TCM_GETUNICODEFORMAT, 0, 0)
#endif // _WIN32_IE >= 0x0400
#define TCN_KEYDOWN (TCN_FIRST - 0)
#if (_WIN32_IE >= 0x0300)
#define TC_KEYDOWN NMTCKEYDOWN
#else
#define tagTCKEYDOWN _TC_KEYDOWN
#define NMTCKEYDOWN TC_KEYDOWN
#endif
typedef struct tagTCKEYDOWN
{
NMHDR hdr;
WORD wVKey;
UINT flags;
} NMTCKEYDOWN;
#define TCN_SELCHANGE (TCN_FIRST - 1)
#define TCN_SELCHANGING (TCN_FIRST - 2)
#if (_WIN32_IE >= 0x0400)
#define TCN_GETOBJECT (TCN_FIRST - 3)
#endif // _WIN32_IE >= 0x0400
#endif // NOTABCONTROL
//====== ANIMATE CONTROL ======================================================
#ifndef NOANIMATE
#ifdef _WIN32
#define ANIMATE_CLASSW L"SysAnimate32"
#define ANIMATE_CLASSA "SysAnimate32"
#ifdef UNICODE
#define ANIMATE_CLASS ANIMATE_CLASSW
#else
#define ANIMATE_CLASS ANIMATE_CLASSA
#endif
// begin_r_commctrl
#define ACS_CENTER 0x0001
#define ACS_TRANSPARENT 0x0002
#define ACS_AUTOPLAY 0x0004
#if (_WIN32_IE >= 0x0300)
#define ACS_TIMER 0x0008 // don't use threads... use timers
#endif
// end_r_commctrl
#define ACM_OPENA (WM_USER+100)
#define ACM_OPENW (WM_USER+103)
#ifdef UNICODE
#define ACM_OPEN ACM_OPENW
#else
#define ACM_OPEN ACM_OPENA
#endif
#define ACM_PLAY (WM_USER+101)
#define ACM_STOP (WM_USER+102)
#define ACN_START 1
#define ACN_STOP 2
#define Animate_Create(hwndP, id, dwStyle, hInstance) \
CreateWindow(ANIMATE_CLASS, NULL, \
dwStyle, 0, 0, 0, 0, hwndP, (HMENU)(id), hInstance, NULL)
#define Animate_Open(hwnd, szName) (BOOL)SNDMSG(hwnd, ACM_OPEN, 0, (LPARAM)(LPTSTR)(szName))
#define Animate_OpenEx(hwnd, hInst, szName) (BOOL)SNDMSG(hwnd, ACM_OPEN, (WPARAM)hInst, (LPARAM)(LPTSTR)(szName))
#define Animate_Play(hwnd, from, to, rep) (BOOL)SNDMSG(hwnd, ACM_PLAY, (WPARAM)(UINT)(rep), (LPARAM)MAKELONG(from, to))
#define Animate_Stop(hwnd) (BOOL)SNDMSG(hwnd, ACM_STOP, 0, 0)
#define Animate_Close(hwnd) Animate_Open(hwnd, NULL)
#define Animate_Seek(hwnd, frame) Animate_Play(hwnd, frame, frame, 1)
#endif
#endif // NOANIMATE
#if (_WIN32_IE >= 0x0300)
//====== MONTHCAL CONTROL ======================================================
#ifndef NOMONTHCAL
#ifdef _WIN32
#define MONTHCAL_CLASSW L"SysMonthCal32"
#define MONTHCAL_CLASSA "SysMonthCal32"
#ifdef UNICODE
#define MONTHCAL_CLASS MONTHCAL_CLASSW
#else
#define MONTHCAL_CLASS MONTHCAL_CLASSA
#endif
// bit-packed array of "bold" info for a month
// if a bit is on, that day is drawn bold
typedef DWORD MONTHDAYSTATE, FAR * LPMONTHDAYSTATE;
#define MCM_FIRST 0x1000
// BOOL MonthCal_GetCurSel(HWND hmc, LPSYSTEMTIME pst)
// returns FALSE if MCS_MULTISELECT
// returns TRUE and sets *pst to the currently selected date otherwise
#define MCM_GETCURSEL (MCM_FIRST + 1)
#define MonthCal_GetCurSel(hmc, pst) (BOOL)SNDMSG(hmc, MCM_GETCURSEL, 0, (LPARAM)(pst))
// BOOL MonthCal_SetCurSel(HWND hmc, LPSYSTEMTIME pst)
// returns FALSE if MCS_MULTISELECT
// returns TURE and sets the currently selected date to *pst otherwise
#define MCM_SETCURSEL (MCM_FIRST + 2)
#define MonthCal_SetCurSel(hmc, pst) (BOOL)SNDMSG(hmc, MCM_SETCURSEL, 0, (LPARAM)(pst))
// DWORD MonthCal_GetMaxSelCount(HWND hmc)
// returns the maximum number of selectable days allowed
#define MCM_GETMAXSELCOUNT (MCM_FIRST + 3)
#define MonthCal_GetMaxSelCount(hmc) (DWORD)SNDMSG(hmc, MCM_GETMAXSELCOUNT, 0, 0L)
// BOOL MonthCal_SetMaxSelCount(HWND hmc, UINT n)
// sets the max number days that can be selected iff MCS_MULTISELECT
#define MCM_SETMAXSELCOUNT (MCM_FIRST + 4)
#define MonthCal_SetMaxSelCount(hmc, n) (BOOL)SNDMSG(hmc, MCM_SETMAXSELCOUNT, (WPARAM)(n), 0L)
// BOOL MonthCal_GetSelRange(HWND hmc, LPSYSTEMTIME rgst)
// sets rgst[0] to the first day of the selection range
// sets rgst[1] to the last day of the selection range
#define MCM_GETSELRANGE (MCM_FIRST + 5)
#define MonthCal_GetSelRange(hmc, rgst) SNDMSG(hmc, MCM_GETSELRANGE, 0, (LPARAM)(rgst))
// BOOL MonthCal_SetSelRange(HWND hmc, LPSYSTEMTIME rgst)
// selects the range of days from rgst[0] to rgst[1]
#define MCM_SETSELRANGE (MCM_FIRST + 6)
#define MonthCal_SetSelRange(hmc, rgst) SNDMSG(hmc, MCM_SETSELRANGE, 0, (LPARAM)(rgst))
// DWORD MonthCal_GetMonthRange(HWND hmc, DWORD gmr, LPSYSTEMTIME rgst)
// if rgst specified, sets rgst[0] to the starting date and
// and rgst[1] to the ending date of the the selectable (non-grayed)
// days if GMR_VISIBLE or all the displayed days (including grayed)
// if GMR_DAYSTATE.
// returns the number of months spanned by the above range.
#define MCM_GETMONTHRANGE (MCM_FIRST + 7)
#define MonthCal_GetMonthRange(hmc, gmr, rgst) (DWORD)SNDMSG(hmc, MCM_GETMONTHRANGE, (WPARAM)(gmr), (LPARAM)(rgst))
// BOOL MonthCal_SetDayState(HWND hmc, int cbds, DAYSTATE *rgds)
// cbds is the count of DAYSTATE items in rgds and it must be equal
// to the value returned from MonthCal_GetMonthRange(hmc, GMR_DAYSTATE, NULL)
// This sets the DAYSTATE bits for each month (grayed and non-grayed
// days) displayed in the calendar. The first bit in a month's DAYSTATE
// corresponts to bolding day 1, the second bit affects day 2, etc.
#define MCM_SETDAYSTATE (MCM_FIRST + 8)
#define MonthCal_SetDayState(hmc, cbds, rgds) SNDMSG(hmc, MCM_SETDAYSTATE, (WPARAM)(cbds), (LPARAM)(rgds))
// BOOL MonthCal_GetMinReqRect(HWND hmc, LPRECT prc)
// sets *prc the minimal size needed to display one month
// To display two months, undo the AdjustWindowRect calculation already done to
// this rect, double the width, and redo the AdjustWindowRect calculation --
// the monthcal control will display two calendars in this window (if you also
// double the vertical size, you will get 4 calendars)
// NOTE: if you want to gurantee that the "Today" string is not clipped,
// get the MCM_GETMAXTODAYWIDTH and use the max of that width and this width
#define MCM_GETMINREQRECT (MCM_FIRST + 9)
#define MonthCal_GetMinReqRect(hmc, prc) SNDMSG(hmc, MCM_GETMINREQRECT, 0, (LPARAM)(prc))
// set colors to draw control with -- see MCSC_ bits below
#define MCM_SETCOLOR (MCM_FIRST + 10)
#define MonthCal_SetColor(hmc, iColor, clr) SNDMSG(hmc, MCM_SETCOLOR, iColor, clr)
#define MCM_GETCOLOR (MCM_FIRST + 11)
#define MonthCal_GetColor(hmc, iColor) SNDMSG(hmc, MCM_SETCOLOR, iColor, 0)
#define MCSC_BACKGROUND 0 // the background color (between months)
#define MCSC_TEXT 1 // the dates
#define MCSC_TITLEBK 2 // background of the title
#define MCSC_TITLETEXT 3
#define MCSC_MONTHBK 4 // background within the month cal
#define MCSC_TRAILINGTEXT 5 // the text color of header & trailing days
// set what day is "today" send NULL to revert back to real date
#define MCM_SETTODAY (MCM_FIRST + 12)
#define MonthCal_SetToday(hmc, pst) SNDMSG(hmc, MCM_SETTODAY, 0, (LPARAM)pst)
// get what day is "today"
// returns BOOL for success/failure
#define MCM_GETTODAY (MCM_FIRST + 13)
#define MonthCal_GetToday(hmc, pst) (BOOL)SNDMSG(hmc, MCM_GETTODAY, 0, (LPARAM)pst)
// determine what pinfo->pt is over
#define MCM_HITTEST (MCM_FIRST + 14)
#define MonthCal_HitTest(hmc, pinfo) \
SNDMSG(hmc, MCM_HITTEST, 0, (LPARAM)(PMCHITTESTINFO)pinfo)
typedef struct {
UINT cbSize;
POINT pt;
UINT uHit; // out param
SYSTEMTIME st;
} MCHITTESTINFO, *PMCHITTESTINFO;
#define MCHT_TITLE 0x00010000
#define MCHT_CALENDAR 0x00020000
#define MCHT_TODAYLINK 0x00030000
#define MCHT_NEXT 0x01000000 // these indicate that hitting
#define MCHT_PREV 0x02000000 // here will go to the next/prev month
#define MCHT_NOWHERE 0x00000000
#define MCHT_TITLEBK (MCHT_TITLE)
#define MCHT_TITLEMONTH (MCHT_TITLE | 0x0001)
#define MCHT_TITLEYEAR (MCHT_TITLE | 0x0002)
#define MCHT_TITLEBTNNEXT (MCHT_TITLE | MCHT_NEXT | 0x0003)
#define MCHT_TITLEBTNPREV (MCHT_TITLE | MCHT_PREV | 0x0003)
#define MCHT_CALENDARBK (MCHT_CALENDAR)
#define MCHT_CALENDARDATE (MCHT_CALENDAR | 0x0001)
#define MCHT_CALENDARDATENEXT (MCHT_CALENDARDATE | MCHT_NEXT)
#define MCHT_CALENDARDATEPREV (MCHT_CALENDARDATE | MCHT_PREV)
#define MCHT_CALENDARDAY (MCHT_CALENDAR | 0x0002)
#define MCHT_CALENDARWEEKNUM (MCHT_CALENDAR | 0x0003)
// set first day of week to iDay:
// 0 for Monday, 1 for Tuesday, ..., 6 for Sunday
// -1 for means use locale info
#define MCM_SETFIRSTDAYOFWEEK (MCM_FIRST + 15)
#define MonthCal_SetFirstDayOfWeek(hmc, iDay) \
SNDMSG(hmc, MCM_SETFIRSTDAYOFWEEK, 0, iDay)
// DWORD result... low word has the day. high word is bool if this is app set
// or not (FALSE == using locale info)
#define MCM_GETFIRSTDAYOFWEEK (MCM_FIRST + 16)
#define MonthCal_GetFirstDayOfWeek(hmc) \
(DWORD)SNDMSG(hmc, MCM_GETFIRSTDAYOFWEEK, 0, 0)
// DWORD MonthCal_GetRange(HWND hmc, LPSYSTEMTIME rgst)
// modifies rgst[0] to be the minimum ALLOWABLE systemtime (or 0 if no minimum)
// modifies rgst[1] to be the maximum ALLOWABLE systemtime (or 0 if no maximum)
// returns GDTR_MIN|GDTR_MAX if there is a minimum|maximum limit
#define MCM_GETRANGE (MCM_FIRST + 17)
#define MonthCal_GetRange(hmc, rgst) \
(DWORD)SNDMSG(hmc, MCM_GETRANGE, 0, (LPARAM)(rgst))
// BOOL MonthCal_SetRange(HWND hmc, DWORD gdtr, LPSYSTEMTIME rgst)
// if GDTR_MIN, sets the minimum ALLOWABLE systemtime to rgst[0], otherwise removes minimum
// if GDTR_MAX, sets the maximum ALLOWABLE systemtime to rgst[1], otherwise removes maximum
// returns TRUE on success, FALSE on error (such as invalid parameters)
#define MCM_SETRANGE (MCM_FIRST + 18)
#define MonthCal_SetRange(hmc, gd, rgst) \
(BOOL)SNDMSG(hmc, MCM_SETRANGE, (WPARAM)(gd), (LPARAM)(rgst))
// int MonthCal_GetMonthDelta(HWND hmc)
// returns the number of months one click on a next/prev button moves by
#define MCM_GETMONTHDELTA (MCM_FIRST + 19)
#define MonthCal_GetMonthDelta(hmc) \
(int)SNDMSG(hmc, MCM_GETMONTHDELTA, 0, 0)
// int MonthCal_SetMonthDelta(HWND hmc, int n)
// sets the month delta to n. n==0 reverts to moving by a page of months
// returns the previous value of n.
#define MCM_SETMONTHDELTA (MCM_FIRST + 20)
#define MonthCal_SetMonthDelta(hmc, n) \
(int)SNDMSG(hmc, MCM_SETMONTHDELTA, n, 0)
// DWORD MonthCal_GetMaxTodayWidth(HWND hmc, LPSIZE psz)
// sets *psz to the maximum width/height of the "Today" string displayed
// at the bottom of the calendar (as long as MCS_NOTODAY is not specified)
#define MCM_GETMAXTODAYWIDTH (MCM_FIRST + 21)
#define MonthCal_GetMaxTodayWidth(hmc) \
(DWORD)SNDMSG(hmc, MCM_GETMAXTODAYWIDTH, 0, 0)
#if (_WIN32_IE >= 0x0400)
#define MCM_SETUNICODEFORMAT CCM_SETUNICODEFORMAT
#define MonthCal_SetUnicodeFormat(hwnd, fUnicode) \
(BOOL)SNDMSG((hwnd), MCM_SETUNICODEFORMAT, (WPARAM)(fUnicode), 0)
#define MCM_GETUNICODEFORMAT CCM_GETUNICODEFORMAT
#define MonthCal_GetUnicodeFormat(hwnd) \
(BOOL)SNDMSG((hwnd), MCM_GETUNICODEFORMAT, 0, 0)
#endif
// MCN_SELCHANGE is sent whenever the currently displayed date changes
// via month change, year change, keyboard navigation, prev/next button
//
typedef struct tagNMSELCHANGE
{
NMHDR nmhdr; // this must be first, so we don't break WM_NOTIFY
SYSTEMTIME stSelStart;
SYSTEMTIME stSelEnd;
} NMSELCHANGE, FAR * LPNMSELCHANGE;
#define MCN_SELCHANGE (MCN_FIRST + 1)
// MCN_GETDAYSTATE is sent for MCS_DAYSTATE controls whenever new daystate
// information is needed (month or year scroll) to draw bolding information.
// The app must fill in cDayState months worth of information starting from
// stStart date. The app may fill in the array at prgDayState or change
// prgDayState to point to a different array out of which the information
// will be copied. (similar to tooltips)
//
typedef struct tagNMDAYSTATE
{
NMHDR nmhdr; // this must be first, so we don't break WM_NOTIFY
SYSTEMTIME stStart;
int cDayState;
LPMONTHDAYSTATE prgDayState; // points to cDayState MONTHDAYSTATEs
} NMDAYSTATE, FAR * LPNMDAYSTATE;
#define MCN_GETDAYSTATE (MCN_FIRST + 3)
// MCN_SELECT is sent whenever a selection has occured (via mouse or keyboard)
//
typedef NMSELCHANGE NMSELECT, FAR * LPNMSELECT;
#define MCN_SELECT (MCN_FIRST + 4)
#define MCS_DAYSTATE 0x0001
#define MCS_MULTISELECT 0x0002
#define MCS_WEEKNUMBERS 0x0004
#if (_WIN32_IE >= 0x0400)
#define MCS_NOTODAYCIRCLE 0x0008
#define MCS_NOTODAY 0x0010
#else
#define MCS_NOTODAY 0x0008
#endif
#define GMR_VISIBLE 0 // visible portion of display
#define GMR_DAYSTATE 1 // above plus the grayed out parts of
// partially displayed months
#endif // _WIN32
#endif // NOMONTHCAL
//====== DATETIMEPICK CONTROL ==================================================
#ifndef NODATETIMEPICK
#ifdef _WIN32
#define DATETIMEPICK_CLASSW L"SysDateTimePick32"
#define DATETIMEPICK_CLASSA "SysDateTimePick32"
#ifdef UNICODE
#define DATETIMEPICK_CLASS DATETIMEPICK_CLASSW
#else
#define DATETIMEPICK_CLASS DATETIMEPICK_CLASSA
#endif
#define DTM_FIRST 0x1000
// DWORD DateTimePick_GetSystemtime(HWND hdp, LPSYSTEMTIME pst)
// returns GDT_NONE if "none" is selected (DTS_SHOWNONE only)
// returns GDT_VALID and modifies *pst to be the currently selected value
#define DTM_GETSYSTEMTIME (DTM_FIRST + 1)
#define DateTime_GetSystemtime(hdp, pst) (DWORD)SNDMSG(hdp, DTM_GETSYSTEMTIME, 0, (LPARAM)(pst))
// BOOL DateTime_SetSystemtime(HWND hdp, DWORD gd, LPSYSTEMTIME pst)
// if gd==GDT_NONE, sets datetimepick to None (DTS_SHOWNONE only)
// if gd==GDT_VALID, sets datetimepick to *pst
// returns TRUE on success, FALSE on error (such as bad params)
#define DTM_SETSYSTEMTIME (DTM_FIRST + 2)
#define DateTime_SetSystemtime(hdp, gd, pst) (BOOL)SNDMSG(hdp, DTM_SETSYSTEMTIME, (LPARAM)(gd), (LPARAM)(pst))
// DWORD DateTime_GetRange(HWND hdp, LPSYSTEMTIME rgst)
// modifies rgst[0] to be the minimum ALLOWABLE systemtime (or 0 if no minimum)
// modifies rgst[1] to be the maximum ALLOWABLE systemtime (or 0 if no maximum)
// returns GDTR_MIN|GDTR_MAX if there is a minimum|maximum limit
#define DTM_GETRANGE (DTM_FIRST + 3)
#define DateTime_GetRange(hdp, rgst) (DWORD)SNDMSG(hdp, DTM_GETRANGE, 0, (LPARAM)(rgst))
// BOOL DateTime_SetRange(HWND hdp, DWORD gdtr, LPSYSTEMTIME rgst)
// if GDTR_MIN, sets the minimum ALLOWABLE systemtime to rgst[0], otherwise removes minimum
// if GDTR_MAX, sets the maximum ALLOWABLE systemtime to rgst[1], otherwise removes maximum
// returns TRUE on success, FALSE on error (such as invalid parameters)
#define DTM_SETRANGE (DTM_FIRST + 4)
#define DateTime_SetRange(hdp, gd, rgst) (BOOL)SNDMSG(hdp, DTM_SETRANGE, (WPARAM)(gd), (LPARAM)(rgst))
// BOOL DateTime_SetFormat(HWND hdp, LPCTSTR sz)
// sets the display formatting string to sz (see GetDateFormat and GetTimeFormat for valid formatting chars)
// NOTE: 'X' is a valid formatting character which indicates that the application
// will determine how to display information. Such apps must support DTN_WMKEYDOWN,
// DTN_FORMAT, and DTN_FORMATQUERY.
#define DTM_SETFORMATA (DTM_FIRST + 5)
#define DTM_SETFORMATW (DTM_FIRST + 50)
#ifdef UNICODE
#define DTM_SETFORMAT DTM_SETFORMATW
#else
#define DTM_SETFORMAT DTM_SETFORMATA
#endif
#define DateTime_SetFormat(hdp, sz) (BOOL)SNDMSG(hdp, DTM_SETFORMAT, 0, (LPARAM)(sz))
#define DTM_SETMCCOLOR (DTM_FIRST + 6)
#define DateTime_SetMonthCalColor(hdp, iColor, clr) SNDMSG(hdp, DTM_SETMCCOLOR, iColor, clr)
#define DTM_GETMCCOLOR (DTM_FIRST + 7)
#define DateTime_GetMonthCalColor(hdp, iColor) SNDMSG(hdp, DTM_GETMCCOLOR, iColor, 0)
// HWND DateTime_GetMonthCal(HWND hdp)
// returns the HWND of the MonthCal popup window. Only valid
// between DTN_DROPDOWN and DTN_CLOSEUP notifications.
#define DTM_GETMONTHCAL (DTM_FIRST + 8)
#define DateTime_GetMonthCal(hdp) (HWND)SNDMSG(hdp, DTM_GETMONTHCAL, 0, 0)
#if (_WIN32_IE >= 0x0400)
#define DTM_SETMCFONT (DTM_FIRST + 9)
#define DateTime_SetMonthCalFont(hdp, hfont, fRedraw) SNDMSG(hdp, DTM_SETMCFONT, (WPARAM)hfont, (LPARAM)fRedraw)
#define DTM_GETMCFONT (DTM_FIRST + 10)
#define DateTime_GetMonthCalFont(hdp) SNDMSG(hdp, DTM_GETMCFONT, 0, 0)
#endif // _WIN32_IE >= 0x0400
#define DTS_UPDOWN 0x0001 // use UPDOWN instead of MONTHCAL
#define DTS_SHOWNONE 0x0002 // allow a NONE selection
#define DTS_SHORTDATEFORMAT 0x0000 // use the short date format (app must forward WM_WININICHANGE messages)
#define DTS_LONGDATEFORMAT 0x0004 // use the long date format (app must forward WM_WININICHANGE messages)
#define DTS_TIMEFORMAT 0x0009 // use the time format (app must forward WM_WININICHANGE messages)
#define DTS_APPCANPARSE 0x0010 // allow user entered strings (app MUST respond to DTN_USERSTRING)
#define DTS_RIGHTALIGN 0x0020 // right-align popup instead of left-align it
#define DTN_DATETIMECHANGE (DTN_FIRST + 1) // the systemtime has changed
typedef struct tagNMDATETIMECHANGE
{
NMHDR nmhdr;
DWORD dwFlags; // GDT_VALID or GDT_NONE
SYSTEMTIME st; // valid iff dwFlags==GDT_VALID
} NMDATETIMECHANGE, FAR * LPNMDATETIMECHANGE;
#define DTN_USERSTRINGA (DTN_FIRST + 2) // the user has entered a string
#define DTN_USERSTRINGW (DTN_FIRST + 15)
typedef struct tagNMDATETIMESTRINGA
{
NMHDR nmhdr;
LPCSTR pszUserString; // string user entered
SYSTEMTIME st; // app fills this in
DWORD dwFlags; // GDT_VALID or GDT_NONE
} NMDATETIMESTRINGA, FAR * LPNMDATETIMESTRINGA;
typedef struct tagNMDATETIMESTRINGW
{
NMHDR nmhdr;
LPCWSTR pszUserString; // string user entered
SYSTEMTIME st; // app fills this in
DWORD dwFlags; // GDT_VALID or GDT_NONE
} NMDATETIMESTRINGW, FAR * LPNMDATETIMESTRINGW;
#ifdef UNICODE
#define DTN_USERSTRING DTN_USERSTRINGW
#define NMDATETIMESTRING NMDATETIMESTRINGW
#define LPNMDATETIMESTRING LPNMDATETIMESTRINGW
#else
#define DTN_USERSTRING DTN_USERSTRINGA
#define NMDATETIMESTRING NMDATETIMESTRINGA
#define LPNMDATETIMESTRING LPNMDATETIMESTRINGA
#endif
#define DTN_WMKEYDOWNA (DTN_FIRST + 3) // modify keydown on app format field (X)
#define DTN_WMKEYDOWNW (DTN_FIRST + 16)
typedef struct tagNMDATETIMEWMKEYDOWNA
{
NMHDR nmhdr;
int nVirtKey; // virtual key code of WM_KEYDOWN which MODIFIES an X field
LPCSTR pszFormat; // format substring
SYSTEMTIME st; // current systemtime, app should modify based on key
} NMDATETIMEWMKEYDOWNA, FAR * LPNMDATETIMEWMKEYDOWNA;
typedef struct tagNMDATETIMEWMKEYDOWNW
{
NMHDR nmhdr;
int nVirtKey; // virtual key code of WM_KEYDOWN which MODIFIES an X field
LPCWSTR pszFormat; // format substring
SYSTEMTIME st; // current systemtime, app should modify based on key
} NMDATETIMEWMKEYDOWNW, FAR * LPNMDATETIMEWMKEYDOWNW;
#ifdef UNICODE
#define DTN_WMKEYDOWN DTN_WMKEYDOWNW
#define NMDATETIMEWMKEYDOWN NMDATETIMEWMKEYDOWNW
#define LPNMDATETIMEWMKEYDOWN LPNMDATETIMEWMKEYDOWNW
#else
#define DTN_WMKEYDOWN DTN_WMKEYDOWNA
#define NMDATETIMEWMKEYDOWN NMDATETIMEWMKEYDOWNA
#define LPNMDATETIMEWMKEYDOWN LPNMDATETIMEWMKEYDOWNA
#endif
#define DTN_FORMATA (DTN_FIRST + 4) // query display for app format field (X)
#define DTN_FORMATW (DTN_FIRST + 17)
typedef struct tagNMDATETIMEFORMATA
{
NMHDR nmhdr;
LPCSTR pszFormat; // format substring
SYSTEMTIME st; // current systemtime
LPCSTR pszDisplay; // string to display
CHAR szDisplay[64]; // buffer pszDisplay originally points at
} NMDATETIMEFORMATA, FAR * LPNMDATETIMEFORMATA;
typedef struct tagNMDATETIMEFORMATW
{
NMHDR nmhdr;
LPCWSTR pszFormat; // format substring
SYSTEMTIME st; // current systemtime
LPCWSTR pszDisplay; // string to display
WCHAR szDisplay[64]; // buffer pszDisplay originally points at
} NMDATETIMEFORMATW, FAR * LPNMDATETIMEFORMATW;
#ifdef UNICODE
#define DTN_FORMAT DTN_FORMATW
#define NMDATETIMEFORMAT NMDATETIMEFORMATW
#define LPNMDATETIMEFORMAT LPNMDATETIMEFORMATW
#else
#define DTN_FORMAT DTN_FORMATA
#define NMDATETIMEFORMAT NMDATETIMEFORMATA
#define LPNMDATETIMEFORMAT LPNMDATETIMEFORMATA
#endif
#define DTN_FORMATQUERYA (DTN_FIRST + 5) // query formatting info for app format field (X)
#define DTN_FORMATQUERYW (DTN_FIRST + 18)
typedef struct tagNMDATETIMEFORMATQUERYA
{
NMHDR nmhdr;
LPCSTR pszFormat; // format substring
SIZE szMax; // max bounding rectangle app will use for this format string
} NMDATETIMEFORMATQUERYA, FAR * LPNMDATETIMEFORMATQUERYA;
typedef struct tagNMDATETIMEFORMATQUERYW
{
NMHDR nmhdr;
LPCWSTR pszFormat; // format substring
SIZE szMax; // max bounding rectangle app will use for this format string
} NMDATETIMEFORMATQUERYW, FAR * LPNMDATETIMEFORMATQUERYW;
#ifdef UNICODE
#define DTN_FORMATQUERY DTN_FORMATQUERYW
#define NMDATETIMEFORMATQUERY NMDATETIMEFORMATQUERYW
#define LPNMDATETIMEFORMATQUERY LPNMDATETIMEFORMATQUERYW
#else
#define DTN_FORMATQUERY DTN_FORMATQUERYA
#define NMDATETIMEFORMATQUERY NMDATETIMEFORMATQUERYA
#define LPNMDATETIMEFORMATQUERY LPNMDATETIMEFORMATQUERYA
#endif
#define DTN_DROPDOWN (DTN_FIRST + 6) // MonthCal has dropped down
#define DTN_CLOSEUP (DTN_FIRST + 7) // MonthCal is popping up
#define GDTR_MIN 0x0001
#define GDTR_MAX 0x0002
#define GDT_ERROR -1
#define GDT_VALID 0
#define GDT_NONE 1
#endif // _WIN32
#endif // NODATETIMEPICK
#if (_WIN32_IE >= 0x0400)
#ifndef NOIPADDRESS
///////////////////////////////////////////////
/// IP Address edit control
// Messages sent to IPAddress controls
#define IPM_CLEARADDRESS (WM_USER+100) // no parameters
#define IPM_SETADDRESS (WM_USER+101) // lparam = TCP/IP address
#define IPM_GETADDRESS (WM_USER+102) // lresult = # of non black fields. lparam = LPDWORD for TCP/IP address
#define IPM_SETRANGE (WM_USER+103) // wparam = field, lparam = range
#define IPM_SETFOCUS (WM_USER+104) // wparam = field
#define IPM_ISBLANK (WM_USER+105) // no parameters
#define WC_IPADDRESSW L"SysIPAddress32"
#define WC_IPADDRESSA "SysIPAddress32"
#ifdef UNICODE
#define WC_IPADDRESS WC_IPADDRESSW
#else
#define WC_IPADDRESS WC_IPADDRESSA
#endif
#define IPN_FIELDCHANGED (IPN_FIRST - 0)
typedef struct tagNMIPADDRESS
{
NMHDR hdr;
int iField;
int iValue;
} NMIPADDRESS, *LPNMIPADDRESS;
// The following is a useful macro for passing the range values in the
// IPM_SETRANGE message.
#define MAKEIPRANGE(low, high) ((LPARAM)(WORD)(((BYTE)(high) << 8) + (BYTE)(low)))
// And this is a useful macro for making the IP Address to be passed
// as a LPARAM.
#define MAKEIPADDRESS(b1,b2,b3,b4) ((LPARAM)(((DWORD)(b1)<<24)+((DWORD)(b2)<<16)+((DWORD)(b3)<<8)+((DWORD)(b4))))
// Get individual number
#define FIRST_IPADDRESS(x) ((x>>24) & 0xff)
#define SECOND_IPADDRESS(x) ((x>>16) & 0xff)
#define THIRD_IPADDRESS(x) ((x>>8) & 0xff)
#define FOURTH_IPADDRESS(x) (x & 0xff)
#endif // NOIPADDRESS
//---------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------
/// ====================== Pager Control =============================
//---------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------
#ifndef NOPAGESCROLLER
//Pager Class Name
#define WC_PAGESCROLLERW L"SysPager"
#define WC_PAGESCROLLERA "SysPager"
#ifdef UNICODE
#define WC_PAGESCROLLER WC_PAGESCROLLERW
#else
#define WC_PAGESCROLLER WC_PAGESCROLLERA
#endif
//---------------------------------------------------------------------------------------
// Pager Control Styles
//---------------------------------------------------------------------------------------
#define PGS_VERT 0x00000000
#define PGS_HORZ 0x00000001
#define PGS_AUTOSCROLL 0x00000002
#define PGS_DRAGNDROP 0x00000004
//---------------------------------------------------------------------------------------
// Pager Button State
//---------------------------------------------------------------------------------------
//The scroll can be in one of the following control State
#define PGF_INVISIBLE 0 // Scroll button is not visible
#define PGF_NORMAL 1 // Scroll button is in normal state
#define PGF_GRAYED 2 // Scroll button is in grayed state
#define PGF_DEPRESSED 4 // Scroll button is in depressed state
#define PGF_HOT 8 // Scroll button is in hot state
// The following identifiers specifies the button control
#define PGB_TOPORLEFT 0
#define PGB_BOTTOMORRIGHT 1
//---------------------------------------------------------------------------------------
// Pager Control Messages
//---------------------------------------------------------------------------------------
#define PGM_SETCHILD (PGM_FIRST + 1) // lParam == hwnd
#define Pager_SetChild(hwnd, hwndChild) \
(void)SNDMSG((hwnd), PGM_SETCHILD, 0, (LPARAM)(hwndChild))
#define PGM_RECALCSIZE (PGM_FIRST + 2)
#define Pager_RecalcSize(hwnd) \
(void)SNDMSG((hwnd), PGM_RECALCSIZE, 0, 0)
#define PGM_FORWARDMOUSE (PGM_FIRST + 3)
#define Pager_ForwardMouse(hwnd, bForward) \
(void)SNDMSG((hwnd), PGM_FORWARDMOUSE, (WPARAM)(bForward), 0)
#define PGM_SETBKCOLOR (PGM_FIRST + 4)
#define Pager_SetBkColor(hwnd, clr) \
(COLORREF)SNDMSG((hwnd), PGM_SETBKCOLOR, 0, (LPARAM)clr)
#define PGM_GETBKCOLOR (PGM_FIRST + 5)
#define Pager_GetBkColor(hwnd) \
(COLORREF)SNDMSG((hwnd), PGM_GETBKCOLOR, 0, 0)
#define PGM_SETBORDER (PGM_FIRST + 6)
#define Pager_SetBorder(hwnd, iBorder) \
(int)SNDMSG((hwnd), PGM_SETBORDER, 0, (LPARAM)iBorder)
#define PGM_GETBORDER (PGM_FIRST + 7)
#define Pager_GetBorder(hwnd) \
(int)SNDMSG((hwnd), PGM_GETBORDER, 0, 0)
#define PGM_SETPOS (PGM_FIRST + 8)
#define Pager_SetPos(hwnd, iPos) \
(int)SNDMSG((hwnd), PGM_SETPOS, 0, (LPARAM)iPos)
#define PGM_GETPOS (PGM_FIRST + 9)
#define Pager_GetPos(hwnd) \
(int)SNDMSG((hwnd), PGM_GETPOS, 0, 0)
#define PGM_SETBUTTONSIZE (PGM_FIRST + 10)
#define Pager_SetButtonSize(hwnd, iSize) \
(int)SNDMSG((hwnd), PGM_SETBUTTONSIZE, 0, (LPARAM)iSize)
#define PGM_GETBUTTONSIZE (PGM_FIRST + 11)
#define Pager_GetButtonSize(hwnd) \
(int)SNDMSG((hwnd), PGM_GETBUTTONSIZE, 0,0)
#define PGM_GETBUTTONSTATE (PGM_FIRST + 12)
#define Pager_GetButtonState(hwnd, iButton) \
(DWORD)SNDMSG((hwnd), PGM_GETBUTTONSTATE, 0, (LPARAM)iButton)
#define PGM_GETDROPTARGET CCM_GETDROPTARGET
#define Pager_GetDropTarget(hwnd, ppdt) \
(void)SNDMSG((hwnd), PGM_GETDROPTARGET, 0, (LPARAM)ppdt)
//---------------------------------------------------------------------------------------
//Pager Control Notification Messages
//---------------------------------------------------------------------------------------
// PGN_SCROLL Notification Message
#define PGN_SCROLL (PGN_FIRST-1)
#define PGF_SCROLLUP 1
#define PGF_SCROLLDOWN 2
#define PGF_SCROLLLEFT 4
#define PGF_SCROLLRIGHT 8
//Keys down
#define PGK_SHIFT 1
#define PGK_CONTROL 2
#define PGK_MENU 4
// This structure is sent along with PGN_SCROLL notifications
typedef struct {
NMHDR hdr;
WORD fwKeys; // Specifies which keys are down when this notification is send
RECT rcParent; // Contains Parent Window Rect
int iDir; // Scrolling Direction
int iXpos; // Horizontal scroll position
int iYpos; // Vertical scroll position
int iScroll; // [in/out] Amount to scroll
}NMPGSCROLL, *LPNMPGSCROLL;
// PGN_CALCSIZE Notification Message
#define PGN_CALCSIZE (PGN_FIRST-2)
#define PGF_CALCWIDTH 1
#define PGF_CALCHEIGHT 2
typedef struct {
NMHDR hdr;
DWORD dwFlag;
int iWidth;
int iHeight;
}NMPGCALCSIZE, *LPNMPGCALCSIZE;
#endif // NOPAGESCROLLER
////====================== End Pager Control ==========================================
//
// === Native Font Control ===
//
#ifndef NONATIVEFONTCTL
//NativeFont Class Name
#define WC_NATIVEFONTCTLW L"NativeFontCtl"
#define WC_NATIVEFONTCTLA "NativeFontCtl"
#ifdef UNICODE
#define WC_NATIVEFONTCTL WC_NATIVEFONTCTLW
#else
#define WC_NATIVEFONTCTL WC_NATIVEFONTCTLA
#endif
// style definition
#define NFS_EDIT 0x0001
#define NFS_STATIC 0x0002
#define NFS_LISTCOMBO 0x0004
#define NFS_BUTTON 0x0008
#define NFS_ALL 0x0010
#endif // NONATIVEFONTCTL
// === End Native Font Control ===
#endif // _WIN32_IE >= 0x0400
#ifdef _WIN32
//====== TrackMouseEvent =====================================================
#ifndef NOTRACKMOUSEEVENT
//
// If the messages for TrackMouseEvent have not been defined then define them
// now.
//
#ifndef WM_MOUSEHOVER
#define WM_MOUSEHOVER 0x02A1
#define WM_MOUSELEAVE 0x02A3
#endif
//
// If the TRACKMOUSEEVENT structure and associated flags havent been declared
// then declare them now.
//
#ifndef TME_HOVER
#define TME_HOVER 0x00000001
#define TME_LEAVE 0x00000002
#define TME_QUERY 0x40000000
#define TME_CANCEL 0x80000000
#define HOVER_DEFAULT 0xFFFFFFFF
typedef struct tagTRACKMOUSEEVENT {
DWORD cbSize;
DWORD dwFlags;
HWND hwndTrack;
DWORD dwHoverTime;
} TRACKMOUSEEVENT, *LPTRACKMOUSEEVENT;
#endif // !TME_HOVER
//
// Declare _TrackMouseEvent. This API tries to use the window manager's
// implementation of TrackMouseEvent if it is present, otherwise it emulates.
//
WINCOMMCTRLAPI
BOOL
WINAPI
_TrackMouseEvent(
LPTRACKMOUSEEVENT lpEventTrack);
#endif // !NOTRACKMOUSEEVENT
#if (_WIN32_IE >= 0x0400)
//====== Flat Scrollbar APIs=========================================
#ifndef NOFLATSBAPIS
#define WSB_PROP_CYVSCROLL 0x00000001L
#define WSB_PROP_CXHSCROLL 0x00000002L
#define WSB_PROP_CYHSCROLL 0x00000004L
#define WSB_PROP_CXVSCROLL 0x00000008L
#define WSB_PROP_CXHTHUMB 0x00000010L
#define WSB_PROP_CYVTHUMB 0x00000020L
#define WSB_PROP_VBKGCOLOR 0x00000040L
#define WSB_PROP_HBKGCOLOR 0x00000080L
#define WSB_PROP_VSTYLE 0x00000100L
#define WSB_PROP_HSTYLE 0x00000200L
#define WSB_PROP_WINSTYLE 0x00000400L
#define WSB_PROP_PALETTE 0x00000800L
#define WSB_PROP_MASK 0x00000FFFL
#define FSB_FLAT_MODE 2
#define FSB_ENCARTA_MODE 1
#define FSB_REGULAR_MODE 0
WINCOMMCTRLAPI BOOL WINAPI FlatSB_EnableScrollBar(HWND, int, UINT);
WINCOMMCTRLAPI BOOL WINAPI FlatSB_ShowScrollBar(HWND, int code, BOOL);
WINCOMMCTRLAPI BOOL WINAPI FlatSB_GetScrollRange(HWND, int code, LPINT, LPINT);
WINCOMMCTRLAPI BOOL WINAPI FlatSB_GetScrollInfo(HWND, int code, LPSCROLLINFO);
WINCOMMCTRLAPI int WINAPI FlatSB_GetScrollPos(HWND, int code);
WINCOMMCTRLAPI BOOL WINAPI FlatSB_GetScrollProp(HWND, int propIndex, LPINT);
WINCOMMCTRLAPI int WINAPI FlatSB_SetScrollPos(HWND, int code, int pos, BOOL fRedraw);
WINCOMMCTRLAPI int WINAPI FlatSB_SetScrollInfo(HWND, int code, LPSCROLLINFO, BOOL fRedraw);
WINCOMMCTRLAPI int WINAPI FlatSB_SetScrollRange(HWND, int code, int min, int max, BOOL fRedraw);
WINCOMMCTRLAPI BOOL WINAPI FlatSB_SetScrollProp(HWND, UINT index, int newValue, BOOL);
WINCOMMCTRLAPI BOOL WINAPI InitializeFlatSB(HWND);
WINCOMMCTRLAPI HRESULT WINAPI UninitializeFlatSB(HWND);
#endif // NOFLATSBAPIS
#endif // _WIN32_IE >= 0x0400
#endif /* _WIN32 */
#endif // _WIN32_IE >= 0x0300
#ifdef __cplusplus
}
#endif
#ifdef _WIN32
#include <poppack.h>
#endif
#endif
#endif // _INC_COMMCTRL
/*++
Copyright 1990 - 1998 Microsoft Corporation
Module Name:
poppack.h
Abstract:
This file turns packing of structures off. (That is, it enables
automatic alignment of structure fields.) An include file is needed
because various compilers do this in different ways.
poppack.h is the complement to pshpack?.h. An inclusion of poppack.h
MUST ALWAYS be preceded by an inclusion of one of pshpack?.h, in one-to-one
correspondence.
For Microsoft compatible compilers, this file uses the pop option
to the pack pragma so that it can restore the previous saved by the
pshpack?.h include file.
--*/
#if ! (defined(lint) || defined(_lint) || defined(RC_INVOKED))
#if ( _MSC_VER >= 800 ) || defined(_PUSHPOP_SUPPORTED)
#pragma warning(disable:4103)
#if !(defined( MIDL_PASS )) || defined( __midl )
#pragma pack(pop)
#else
#pragma pack()
#endif
#else
#pragma pack()
#endif
#endif // ! (defined(lint) || defined(_lint) || defined(RC_INVOKED))
/*****************************************************************************\
* *
* prsht.h - - Interface for the Windows Property Sheet Pages *
* *
* Version 1.0 *
* *
* Copyright 1991-1998, Microsoft Corp. All rights reserved. *
* *
\*****************************************************************************/
#ifndef _PRSHT_H_
#define _PRSHT_H_
#ifndef _WIN32_IE
#define _WIN32_IE 0x0400
#else
#if (_WIN32_IE < 0x0400) && defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0500)
#error _WIN32_IE setting conflicts with _WIN32_WINNT setting
#endif
#endif
//
// Define API decoration for direct importing of DLL references.
//
#ifndef WINCOMMCTRLAPI
#if !defined(_COMCTL32_) && defined(_WIN32)
#define WINCOMMCTRLAPI DECLSPEC_IMPORT
#else
#define WINCOMMCTRLAPI
#endif
#endif // WINCOMMCTRLAPI
#ifndef CCSIZEOF_STRUCT
#define CCSIZEOF_STRUCT(structname, member) (((int)((LPBYTE)(&((structname*)0)->member) - ((LPBYTE)((structname*)0)))) + sizeof(((structname*)0)->member))
#endif
//
// For compilers that don't support nameless unions
//
#ifndef DUMMYUNIONNAME
#ifdef NONAMELESSUNION
#define DUMMYUNIONNAME u
#define DUMMYUNIONNAME2 u2
#define DUMMYUNIONNAME3 u3
#define DUMMYUNIONNAME4 u4
#define DUMMYUNIONNAME5 u5
#else
#define DUMMYUNIONNAME
#define DUMMYUNIONNAME2
#define DUMMYUNIONNAME3
#define DUMMYUNIONNAME4
#define DUMMYUNIONNAME5
#endif
#endif // DUMMYUNIONNAME
#ifdef __cplusplus
extern "C" {
#endif
#ifndef SNDMSG
#ifdef __cplusplus
#ifndef _MAC
#define SNDMSG ::SendMessage
#else
#define SNDMSG ::AfxSendMessage
#endif
#else
#ifndef _MAC
#define SNDMSG SendMessage
#else
#define SNDMSG AfxSendMessage
#endif
#endif
#endif // ifndef SNDMSG
#define MAXPROPPAGES 100
struct _PSP;
typedef struct _PSP FAR* HPROPSHEETPAGE;
#ifndef MIDL_PASS
struct _PROPSHEETPAGEA;
struct _PROPSHEETPAGEW;
#endif
typedef UINT (CALLBACK FAR * LPFNPSPCALLBACKA)(HWND hwnd, UINT uMsg, struct _PROPSHEETPAGEA FAR *ppsp);
typedef UINT (CALLBACK FAR * LPFNPSPCALLBACKW)(HWND hwnd, UINT uMsg, struct _PROPSHEETPAGEW FAR *ppsp);
#ifdef UNICODE
#define LPFNPSPCALLBACK LPFNPSPCALLBACKW
#else
#define LPFNPSPCALLBACK LPFNPSPCALLBACKA
#endif
#define PSP_DEFAULT 0x00000000
#define PSP_DLGINDIRECT 0x00000001
#define PSP_USEHICON 0x00000002
#define PSP_USEICONID 0x00000004
#define PSP_USETITLE 0x00000008
#define PSP_RTLREADING 0x00000010
#define PSP_HASHELP 0x00000020
#define PSP_USEREFPARENT 0x00000040
#define PSP_USECALLBACK 0x00000080
#define PSP_PREMATURE 0x00000400
#if (_WIN32_IE >= 0x0400)
//----- New flags for wizard97 --------------
#define PSP_HIDEHEADER 0x00000800
#define PSP_USEHEADERTITLE 0x00001000
#define PSP_USEHEADERSUBTITLE 0x00002000
//-------------------------------------------
#endif
#define PSPCB_RELEASE 1
#define PSPCB_CREATE 2
#define PROPSHEETPAGEA_V1_SIZE CCSIZEOF_STRUCT(PROPSHEETPAGEA, pcRefParent)
#define PROPSHEETPAGEW_V1_SIZE CCSIZEOF_STRUCT(PROPSHEETPAGEW, pcRefParent)
typedef struct _PROPSHEETPAGEA {
DWORD dwSize;
DWORD dwFlags;
HINSTANCE hInstance;
union {
LPCSTR pszTemplate;
#ifdef _WIN32
LPCDLGTEMPLATE pResource;
#else
const VOID FAR *pResource;
#endif
} DUMMYUNIONNAME;
union {
HICON hIcon;
LPCSTR pszIcon;
} DUMMYUNIONNAME2;
LPCSTR pszTitle;
DLGPROC pfnDlgProc;
LPARAM lParam;
LPFNPSPCALLBACKA pfnCallback;
UINT FAR * pcRefParent;
#if (_WIN32_IE >= 0x0400)
LPCSTR pszHeaderTitle; // this is displayed in the header
LPCSTR pszHeaderSubTitle; //
#endif
} PROPSHEETPAGEA, FAR *LPPROPSHEETPAGEA;
typedef const PROPSHEETPAGEA FAR *LPCPROPSHEETPAGEA;
typedef struct _PROPSHEETPAGEW {
DWORD dwSize;
DWORD dwFlags;
HINSTANCE hInstance;
union {
LPCWSTR pszTemplate;
#ifdef _WIN32
LPCDLGTEMPLATE pResource;
#else
const VOID FAR *pResource;
#endif
}DUMMYUNIONNAME;
union {
HICON hIcon;
LPCWSTR pszIcon;
}DUMMYUNIONNAME2;
LPCWSTR pszTitle;
DLGPROC pfnDlgProc;
LPARAM lParam;
LPFNPSPCALLBACKW pfnCallback;
UINT FAR * pcRefParent;
#if (_WIN32_IE >= 0x0400)
LPCWSTR pszHeaderTitle; // this is displayed in the header
LPCWSTR pszHeaderSubTitle; ///
#endif
} PROPSHEETPAGEW, FAR *LPPROPSHEETPAGEW;
typedef const PROPSHEETPAGEW FAR *LPCPROPSHEETPAGEW;
#ifdef UNICODE
#define PROPSHEETPAGE PROPSHEETPAGEW
#define LPPROPSHEETPAGE LPPROPSHEETPAGEW
#define LPCPROPSHEETPAGE LPCPROPSHEETPAGEW
#define PROPSHEETPAGE_V1_SIZE PROPSHEETPAGEW_V1_SIZE
#else
#define PROPSHEETPAGE PROPSHEETPAGEA
#define LPPROPSHEETPAGE LPPROPSHEETPAGEA
#define LPCPROPSHEETPAGE LPCPROPSHEETPAGEA
#define PROPSHEETPAGE_V1_SIZE PROPSHEETPAGEA_V1_SIZE
#endif
#define PSH_DEFAULT 0x00000000
#define PSH_PROPTITLE 0x00000001
#define PSH_USEHICON 0x00000002
#define PSH_USEICONID 0x00000004
#define PSH_PROPSHEETPAGE 0x00000008
#define PSH_WIZARDHASFINISH 0x00000010
#define PSH_WIZARD 0x00000020
#define PSH_USEPSTARTPAGE 0x00000040
#define PSH_NOAPPLYNOW 0x00000080
#define PSH_USECALLBACK 0x00000100
#define PSH_HASHELP 0x00000200
#define PSH_MODELESS 0x00000400
#define PSH_RTLREADING 0x00000800
#define PSH_WIZARDCONTEXTHELP 0x00001000
#if (_WIN32_IE >= 0x0400)
//----- New flags for wizard97 -----------
#define PSH_WIZARD97 0x00002000
// 0x00004000 was not used by any previous release
#define PSH_WATERMARK 0x00008000
#define PSH_USEHBMWATERMARK 0x00010000 // user pass in a hbmWatermark instead of pszbmWatermark
#define PSH_USEHPLWATERMARK 0x00020000 //
#define PSH_STRETCHWATERMARK 0x00040000 // stretchwatermark also applies for the header
#define PSH_HEADER 0x00080000
#define PSH_USEHBMHEADER 0x00100000
#define PSH_USEPAGELANG 0x00200000 // use frame dialog template matched to page
//----------------------------------------
#endif
typedef int (CALLBACK *PFNPROPSHEETCALLBACK)(HWND, UINT, LPARAM);
#define PROPSHEETHEADERA_V1_SIZE CCSIZEOF_STRUCT(PROPSHEETHEADERA, pfnCallback)
#define PROPSHEETHEADERW_V1_SIZE CCSIZEOF_STRUCT(PROPSHEETHEADERW, pfnCallback)
typedef struct _PROPSHEETHEADERA {
DWORD dwSize;
DWORD dwFlags;
HWND hwndParent;
HINSTANCE hInstance;
union {
HICON hIcon;
LPCSTR pszIcon;
}DUMMYUNIONNAME;
LPCSTR pszCaption;
UINT nPages;
union {
UINT nStartPage;
LPCSTR pStartPage;
}DUMMYUNIONNAME2;
union {
LPCPROPSHEETPAGEA ppsp;
HPROPSHEETPAGE FAR *phpage;
}DUMMYUNIONNAME3;
PFNPROPSHEETCALLBACK pfnCallback;
#if (_WIN32_IE >= 0x0400)
union {
HBITMAP hbmWatermark;
LPCSTR pszbmWatermark;
} DUMMYUNIONNAME4;
HPALETTE hplWatermark;
union {
HBITMAP hbmHeader; // Header bitmap shares the palette with watermark
LPCSTR pszbmHeader;
} DUMMYUNIONNAME5;
#endif
} PROPSHEETHEADERA, FAR *LPPROPSHEETHEADERA;
typedef const PROPSHEETHEADERA FAR *LPCPROPSHEETHEADERA;
typedef struct _PROPSHEETHEADERW {
DWORD dwSize;
DWORD dwFlags;
HWND hwndParent;
HINSTANCE hInstance;
union {
HICON hIcon;
LPCWSTR pszIcon;
}DUMMYUNIONNAME;
LPCWSTR pszCaption;
UINT nPages;
union {
UINT nStartPage;
LPCWSTR pStartPage;
}DUMMYUNIONNAME2;
union {
LPCPROPSHEETPAGEW ppsp;
HPROPSHEETPAGE FAR *phpage;
}DUMMYUNIONNAME3;
PFNPROPSHEETCALLBACK pfnCallback;
#if (_WIN32_IE >= 0x0400)
union {
HBITMAP hbmWatermark;
LPCWSTR pszbmWatermark;
} DUMMYUNIONNAME4;
HPALETTE hplWatermark;
union {
HBITMAP hbmHeader;
LPCWSTR pszbmHeader;
} DUMMYUNIONNAME5;
#endif
} PROPSHEETHEADERW, FAR *LPPROPSHEETHEADERW;
typedef const PROPSHEETHEADERW FAR *LPCPROPSHEETHEADERW;
#ifdef UNICODE
#define PROPSHEETHEADER PROPSHEETHEADERW
#define LPPROPSHEETHEADER LPPROPSHEETHEADERW
#define LPCPROPSHEETHEADER LPCPROPSHEETHEADERW
#define PROPSHEETHEADER_V1_SIZE PROPSHEETHEADERW_V1_SIZE
#else
#define PROPSHEETHEADER PROPSHEETHEADERA
#define LPPROPSHEETHEADER LPPROPSHEETHEADERA
#define LPCPROPSHEETHEADER LPCPROPSHEETHEADERA
#define PROPSHEETHEADER_V1_SIZE PROPSHEETHEADERA_V1_SIZE
#endif
#define PSCB_INITIALIZED 1
#define PSCB_PRECREATE 2
WINCOMMCTRLAPI HPROPSHEETPAGE WINAPI CreatePropertySheetPageA(LPCPROPSHEETPAGEA);
WINCOMMCTRLAPI HPROPSHEETPAGE WINAPI CreatePropertySheetPageW(LPCPROPSHEETPAGEW);
WINCOMMCTRLAPI BOOL WINAPI DestroyPropertySheetPage(HPROPSHEETPAGE);
WINCOMMCTRLAPI int WINAPI PropertySheetA(LPCPROPSHEETHEADERA);
WINCOMMCTRLAPI int WINAPI PropertySheetW(LPCPROPSHEETHEADERW);
#ifdef UNICODE
#define CreatePropertySheetPage CreatePropertySheetPageW
#define PropertySheet PropertySheetW
#else
#define CreatePropertySheetPage CreatePropertySheetPageA
#define PropertySheet PropertySheetA
#endif
typedef BOOL (CALLBACK FAR * LPFNADDPROPSHEETPAGE)(HPROPSHEETPAGE, LPARAM);
typedef BOOL (CALLBACK FAR * LPFNADDPROPSHEETPAGES)(LPVOID, LPFNADDPROPSHEETPAGE, LPARAM);
typedef struct _PSHNOTIFY
{
NMHDR hdr;
LPARAM lParam;
} PSHNOTIFY, FAR *LPPSHNOTIFY;
#define PSN_FIRST (0U-200U)
#define PSN_LAST (0U-299U)
#define PSN_SETACTIVE (PSN_FIRST-0)
#define PSN_KILLACTIVE (PSN_FIRST-1)
// #define PSN_VALIDATE (PSN_FIRST-1)
#define PSN_APPLY (PSN_FIRST-2)
#define PSN_RESET (PSN_FIRST-3)
// #define PSN_CANCEL (PSN_FIRST-3)
#define PSN_HELP (PSN_FIRST-5)
#define PSN_WIZBACK (PSN_FIRST-6)
#define PSN_WIZNEXT (PSN_FIRST-7)
#define PSN_WIZFINISH (PSN_FIRST-8)
#define PSN_QUERYCANCEL (PSN_FIRST-9)
#if (_WIN32_IE >= 0x0400)
#define PSN_GETOBJECT (PSN_FIRST-10)
#endif // 0x0400
#define PSNRET_NOERROR 0
#define PSNRET_INVALID 1
#define PSNRET_INVALID_NOCHANGEPAGE 2
#define PSM_SETCURSEL (WM_USER + 101)
#define PropSheet_SetCurSel(hDlg, hpage, index) \
SNDMSG(hDlg, PSM_SETCURSEL, (WPARAM)index, (LPARAM)hpage)
#define PSM_REMOVEPAGE (WM_USER + 102)
#define PropSheet_RemovePage(hDlg, index, hpage) \
SNDMSG(hDlg, PSM_REMOVEPAGE, index, (LPARAM)hpage)
#define PSM_ADDPAGE (WM_USER + 103)
#define PropSheet_AddPage(hDlg, hpage) \
SNDMSG(hDlg, PSM_ADDPAGE, 0, (LPARAM)hpage)
#define PSM_CHANGED (WM_USER + 104)
#define PropSheet_Changed(hDlg, hwnd) \
SNDMSG(hDlg, PSM_CHANGED, (WPARAM)hwnd, 0L)
#define PSM_RESTARTWINDOWS (WM_USER + 105)
#define PropSheet_RestartWindows(hDlg) \
SNDMSG(hDlg, PSM_RESTARTWINDOWS, 0, 0L)
#define PSM_REBOOTSYSTEM (WM_USER + 106)
#define PropSheet_RebootSystem(hDlg) \
SNDMSG(hDlg, PSM_REBOOTSYSTEM, 0, 0L)
#define PSM_CANCELTOCLOSE (WM_USER + 107)
#define PropSheet_CancelToClose(hDlg) \
PostMessage(hDlg, PSM_CANCELTOCLOSE, 0, 0L)
#define PSM_QUERYSIBLINGS (WM_USER + 108)
#define PropSheet_QuerySiblings(hDlg, wParam, lParam) \
SNDMSG(hDlg, PSM_QUERYSIBLINGS, wParam, lParam)
#define PSM_UNCHANGED (WM_USER + 109)
#define PropSheet_UnChanged(hDlg, hwnd) \
SNDMSG(hDlg, PSM_UNCHANGED, (WPARAM)hwnd, 0L)
#define PSM_APPLY (WM_USER + 110)
#define PropSheet_Apply(hDlg) \
SNDMSG(hDlg, PSM_APPLY, 0, 0L)
#define PSM_SETTITLEA (WM_USER + 111)
#define PSM_SETTITLEW (WM_USER + 120)
#ifdef UNICODE
#define PSM_SETTITLE PSM_SETTITLEW
#else
#define PSM_SETTITLE PSM_SETTITLEA
#endif
#define PropSheet_SetTitle(hDlg, wStyle, lpszText)\
SNDMSG(hDlg, PSM_SETTITLE, wStyle, (LPARAM)(LPCTSTR)lpszText)
#define PSM_SETWIZBUTTONS (WM_USER + 112)
#define PropSheet_SetWizButtons(hDlg, dwFlags) \
PostMessage(hDlg, PSM_SETWIZBUTTONS, 0, (LPARAM)dwFlags)
#define PSWIZB_BACK 0x00000001
#define PSWIZB_NEXT 0x00000002
#define PSWIZB_FINISH 0x00000004
#define PSWIZB_DISABLEDFINISH 0x00000008
#define PSM_PRESSBUTTON (WM_USER + 113)
#define PropSheet_PressButton(hDlg, iButton) \
PostMessage(hDlg, PSM_PRESSBUTTON, (WPARAM)iButton, 0)
#define PSBTN_BACK 0
#define PSBTN_NEXT 1
#define PSBTN_FINISH 2
#define PSBTN_OK 3
#define PSBTN_APPLYNOW 4
#define PSBTN_CANCEL 5
#define PSBTN_HELP 6
#define PSBTN_MAX 6
#define PSM_SETCURSELID (WM_USER + 114)
#define PropSheet_SetCurSelByID(hDlg, id) \
SNDMSG(hDlg, PSM_SETCURSELID, 0, (LPARAM)id)
#define PSM_SETFINISHTEXTA (WM_USER + 115)
#define PSM_SETFINISHTEXTW (WM_USER + 121)
#ifdef UNICODE
#define PSM_SETFINISHTEXT PSM_SETFINISHTEXTW
#else
#define PSM_SETFINISHTEXT PSM_SETFINISHTEXTA
#endif
#define PropSheet_SetFinishText(hDlg, lpszText) \
SNDMSG(hDlg, PSM_SETFINISHTEXT, 0, (LPARAM)lpszText)
#define PSM_GETTABCONTROL (WM_USER + 116)
#define PropSheet_GetTabControl(hDlg) \
(HWND)SNDMSG(hDlg, PSM_GETTABCONTROL, 0, 0)
#define PSM_ISDIALOGMESSAGE (WM_USER + 117)
#define PropSheet_IsDialogMessage(hDlg, pMsg) \
(BOOL)SNDMSG(hDlg, PSM_ISDIALOGMESSAGE, 0, (LPARAM)pMsg)
#define PSM_GETCURRENTPAGEHWND (WM_USER + 118)
#define PropSheet_GetCurrentPageHwnd(hDlg) \
(HWND)SNDMSG(hDlg, PSM_GETCURRENTPAGEHWND, 0, 0L)
#define ID_PSRESTARTWINDOWS 0x2
#define ID_PSREBOOTSYSTEM (ID_PSRESTARTWINDOWS | 0x1)
#define WIZ_CXDLG 276
#define WIZ_CYDLG 140
#define WIZ_CXBMP 80
#define WIZ_BODYX 92
#define WIZ_BODYCX 184
#define PROP_SM_CXDLG 212
#define PROP_SM_CYDLG 188
#define PROP_MED_CXDLG 227
#define PROP_MED_CYDLG 215
#define PROP_LG_CXDLG 252
#define PROP_LG_CYDLG 218
#ifdef __cplusplus
}
#endif
#endif // _PRSHT_H_
/*++
Copyright 1995 - 1998 Microsoft Corporation
Module Name:
pshpack1.h
Abstract:
This file turns 1 byte packing of structures on. (That is, it disables
automatic alignment of structure fields.) An include file is needed
because various compilers do this in different ways. For Microsoft
compatible compilers, this files uses the push option to the pack pragma
so that the poppack.h include file can restore the previous packing
reliably.
The file poppack.h is the complement to this file.
--*/
#if ! (defined(lint) || defined(_lint) || defined(RC_INVOKED))
#if ( _MSC_VER >= 800 ) || defined(_PUSHPOP_SUPPORTED)
#pragma warning(disable:4103)
#if !(defined( MIDL_PASS )) || defined( __midl )
#pragma pack(push)
#endif
#pragma pack(1)
#else
#pragma pack(1)
#endif
#endif // ! (defined(lint) || defined(_lint) || defined(RC_INVOKED))
/*++
Copyright 1995 - 1998 Microsoft Corporation
Module Name:
pshpack4.h
Abstract:
This file turns 4 byte packing of structures on. (That is, it disables
automatic alignment of structure fields.) An include file is needed
because various compilers do this in different ways. For Microsoft
compatible compilers, this files uses the push option to the pack pragma
so that the poppack.h include file can restore the previous packing
reliably.
The file poppack.h is the complement to this file.
--*/
#if ! (defined(lint) || defined(_lint) || defined(RC_INVOKED))
#if ( _MSC_VER >= 800 ) || defined(_PUSHPOP_SUPPORTED)
#pragma warning(disable:4103)
#if !(defined( MIDL_PASS )) || defined( __midl )
#pragma pack(push)
#endif
#pragma pack(4)
#else
#pragma pack(4)
#endif
#endif // ! (defined(lint) || defined(_lint) || defined(RC_INVOKED))
/*
* RICHEDIT.H
*
* Purpose:
* RICHEDIT v2.0 public definitions. Note that there is additional
* functionality available for v2.0 that is not in the original
* Windows 95 release.
*
* Copyright (c) 1985-1996, Microsoft Corporation
*/
#ifndef _RICHEDIT_
#define _RICHEDIT_
#ifdef _WIN32
#include <pshpack4.h>
#elif !defined(RC_INVOKED)
#pragma pack(4)
#endif
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/* To mimic older RichEdit behavior, simply set _RICHEDIT_VER to the appropriate value */
/* Version 1.0 0x0100 */
/* Version 2.0 0x0200 */
#ifndef _RICHEDIT_VER
#define _RICHEDIT_VER 0x0210
#endif
/*
* To make some structures which can be passed between 16 and 32 bit windows
* almost compatible, padding is introduced to the 16 bit versions of the
* structure.
*/
#ifdef _WIN32
# define _WPAD /##/
#else
# define _WPAD WORD
#endif
#define cchTextLimitDefault 32767
/* Richedit2.0 Window Class. */
#define RICHEDIT_CLASSA "RichEdit20A"
#define RICHEDIT_CLASS10A "RICHEDIT" // Richedit 1.0
#ifndef MACPORT
#define RICHEDIT_CLASSW L"RichEdit20W"
#else /*----------------------MACPORT */
#define RICHEDIT_CLASSW TEXT("RichEdit20W") /* MACPORT change */
#endif /* MACPORT */
#if (_RICHEDIT_VER >= 0x0200 )
#ifdef UNICODE
#define RICHEDIT_CLASS RICHEDIT_CLASSW
#else
#define RICHEDIT_CLASS RICHEDIT_CLASSA
#endif /* UNICODE */
#else
#define RICHEDIT_CLASS RICHEDIT_CLASS10A
#endif /* _RICHEDIT_VER >= 0x0200 */
/* RichEdit messages */
#ifndef WM_CONTEXTMENU
#define WM_CONTEXTMENU 0x007B
#endif
#ifndef WM_PRINTCLIENT
#define WM_PRINTCLIENT 0x0318
#endif
#ifndef EM_GETLIMITTEXT
#define EM_GETLIMITTEXT (WM_USER + 37)
#endif
#ifndef EM_POSFROMCHAR
#define EM_POSFROMCHAR (WM_USER + 38)
#define EM_CHARFROMPOS (WM_USER + 39)
#endif
#ifndef EM_SCROLLCARET
#define EM_SCROLLCARET (WM_USER + 49)
#endif
#define EM_CANPASTE (WM_USER + 50)
#define EM_DISPLAYBAND (WM_USER + 51)
#define EM_EXGETSEL (WM_USER + 52)
#define EM_EXLIMITTEXT (WM_USER + 53)
#define EM_EXLINEFROMCHAR (WM_USER + 54)
#define EM_EXSETSEL (WM_USER + 55)
#define EM_FINDTEXT (WM_USER + 56)
#define EM_FORMATRANGE (WM_USER + 57)
#define EM_GETCHARFORMAT (WM_USER + 58)
#define EM_GETEVENTMASK (WM_USER + 59)
#define EM_GETOLEINTERFACE (WM_USER + 60)
#define EM_GETPARAFORMAT (WM_USER + 61)
#define EM_GETSELTEXT (WM_USER + 62)
#define EM_HIDESELECTION (WM_USER + 63)
#define EM_PASTESPECIAL (WM_USER + 64)
#define EM_REQUESTRESIZE (WM_USER + 65)
#define EM_SELECTIONTYPE (WM_USER + 66)
#define EM_SETBKGNDCOLOR (WM_USER + 67)
#define EM_SETCHARFORMAT (WM_USER + 68)
#define EM_SETEVENTMASK (WM_USER + 69)
#define EM_SETOLECALLBACK (WM_USER + 70)
#define EM_SETPARAFORMAT (WM_USER + 71)
#define EM_SETTARGETDEVICE (WM_USER + 72)
#define EM_STREAMIN (WM_USER + 73)
#define EM_STREAMOUT (WM_USER + 74)
#define EM_GETTEXTRANGE (WM_USER + 75)
#define EM_FINDWORDBREAK (WM_USER + 76)
#define EM_SETOPTIONS (WM_USER + 77)
#define EM_GETOPTIONS (WM_USER + 78)
#define EM_FINDTEXTEX (WM_USER + 79)
#ifdef _WIN32
#define EM_GETWORDBREAKPROCEX (WM_USER + 80)
#define EM_SETWORDBREAKPROCEX (WM_USER + 81)
#endif
/* Richedit v2.0 messages */
#define EM_SETUNDOLIMIT (WM_USER + 82)
#define EM_REDO (WM_USER + 84)
#define EM_CANREDO (WM_USER + 85)
#define EM_GETUNDONAME (WM_USER + 86)
#define EM_GETREDONAME (WM_USER + 87)
#define EM_STOPGROUPTYPING (WM_USER + 88)
#define EM_SETTEXTMODE (WM_USER + 89)
#define EM_GETTEXTMODE (WM_USER + 90)
/* enum for use with EM_GET/SETTEXTMODE */
typedef enum tagTextMode
{
TM_PLAINTEXT = 1,
TM_RICHTEXT = 2, /* default behavior */
TM_SINGLELEVELUNDO = 4,
TM_MULTILEVELUNDO = 8, /* default behavior */
TM_SINGLECODEPAGE = 16,
TM_MULTICODEPAGE = 32 /* default behavior */
} TEXTMODE;
#define EM_AUTOURLDETECT (WM_USER + 91)
#define EM_GETAUTOURLDETECT (WM_USER + 92)
#define EM_SETPALETTE (WM_USER + 93)
#define EM_GETTEXTEX (WM_USER + 94)
#define EM_GETTEXTLENGTHEX (WM_USER + 95)
/* Far East specific messages */
#define EM_SETPUNCTUATION (WM_USER + 100)
#define EM_GETPUNCTUATION (WM_USER + 101)
#define EM_SETWORDWRAPMODE (WM_USER + 102)
#define EM_GETWORDWRAPMODE (WM_USER + 103)
#define EM_SETIMECOLOR (WM_USER + 104)
#define EM_GETIMECOLOR (WM_USER + 105)
#define EM_SETIMEOPTIONS (WM_USER + 106)
#define EM_GETIMEOPTIONS (WM_USER + 107)
#define EM_CONVPOSITION (WM_USER + 108)
#define EM_SETLANGOPTIONS (WM_USER + 120)
#define EM_GETLANGOPTIONS (WM_USER + 121)
#define EM_GETIMECOMPMODE (WM_USER + 122)
#define EM_FINDTEXTW (WM_USER + 123)
#define EM_FINDTEXTEXW (WM_USER + 124)
/* BiDi specific messages */
#define EM_SETBIDIOPTIONS (WM_USER + 200)
#define EM_GETBIDIOPTIONS (WM_USER + 201)
/* Options for EM_SETLANGOPTIONS and EM_GETLANGOPTIONS */
#define IMF_AUTOKEYBOARD 0x0001
#define IMF_AUTOFONT 0x0002
#define IMF_IMECANCELCOMPLETE 0x0004 // high completes the comp string when aborting, low cancels.
#define IMF_IMEALWAYSSENDNOTIFY 0x0008
/* Values for EM_GETIMECOMPMODE */
#define ICM_NOTOPEN 0x0000
#define ICM_LEVEL3 0x0001
#define ICM_LEVEL2 0x0002
#define ICM_LEVEL2_5 0x0003
#define ICM_LEVEL2_SUI 0x0004
/* New notifications */
#define EN_MSGFILTER 0x0700
#define EN_REQUESTRESIZE 0x0701
#define EN_SELCHANGE 0x0702
#define EN_DROPFILES 0x0703
#define EN_PROTECTED 0x0704
#define EN_CORRECTTEXT 0x0705 /* PenWin specific */
#define EN_STOPNOUNDO 0x0706
#define EN_IMECHANGE 0x0707 /* Far East specific */
#define EN_SAVECLIPBOARD 0x0708
#define EN_OLEOPFAILED 0x0709
#define EN_OBJECTPOSITIONS 0x070a
#define EN_LINK 0x070b
#define EN_DRAGDROPDONE 0x070c
/* BiDi specific notifications */
#define EN_ALIGN_LTR 0x0710
#define EN_ALIGN_RTL 0x0711
/* Event notification masks */
#define ENM_NONE 0x00000000
#define ENM_CHANGE 0x00000001
#define ENM_UPDATE 0x00000002
#define ENM_SCROLL 0x00000004
#define ENM_KEYEVENTS 0x00010000
#define ENM_MOUSEEVENTS 0x00020000
#define ENM_REQUESTRESIZE 0x00040000
#define ENM_SELCHANGE 0x00080000
#define ENM_DROPFILES 0x00100000
#define ENM_PROTECTED 0x00200000
#define ENM_CORRECTTEXT 0x00400000 /* PenWin specific */
#define ENM_SCROLLEVENTS 0x00000008
#define ENM_DRAGDROPDONE 0x00000010
/* Far East specific notification mask */
#define ENM_IMECHANGE 0x00800000 /* unused by RE2.0 */
#define ENM_LANGCHANGE 0x01000000
#define ENM_OBJECTPOSITIONS 0x02000000
#define ENM_LINK 0x04000000
/* New edit control styles */
#define ES_SAVESEL 0x00008000
#define ES_SUNKEN 0x00004000
#define ES_DISABLENOSCROLL 0x00002000
/* same as WS_MAXIMIZE, but that doesn't make sense so we re-use the value */
#define ES_SELECTIONBAR 0x01000000
/* same as ES_UPPERCASE, but re-used to completely disable OLE drag'n'drop */
#define ES_NOOLEDRAGDROP 0x00000008
/* New edit control extended style */
#ifdef _WIN32
#define ES_EX_NOCALLOLEINIT 0x01000000
#endif
/* These flags are used in FE Windows */
#define ES_VERTICAL 0x00400000
#define ES_NOIME 0x00080000
#define ES_SELFIME 0x00040000
/* Edit control options */
#define ECO_AUTOWORDSELECTION 0x00000001
#define ECO_AUTOVSCROLL 0x00000040
#define ECO_AUTOHSCROLL 0x00000080
#define ECO_NOHIDESEL 0x00000100
#define ECO_READONLY 0x00000800
#define ECO_WANTRETURN 0x00001000
#define ECO_SAVESEL 0x00008000
#define ECO_SELECTIONBAR 0x01000000
#define ECO_VERTICAL 0x00400000 /* FE specific */
/* ECO operations */
#define ECOOP_SET 0x0001
#define ECOOP_OR 0x0002
#define ECOOP_AND 0x0003
#define ECOOP_XOR 0x0004
/* new word break function actions */
#define WB_CLASSIFY 3
#define WB_MOVEWORDLEFT 4
#define WB_MOVEWORDRIGHT 5
#define WB_LEFTBREAK 6
#define WB_RIGHTBREAK 7
/* Far East specific flags */
#define WB_MOVEWORDPREV 4
#define WB_MOVEWORDNEXT 5
#define WB_PREVBREAK 6
#define WB_NEXTBREAK 7
#define PC_FOLLOWING 1
#define PC_LEADING 2
#define PC_OVERFLOW 3
#define PC_DELIMITER 4
#define WBF_WORDWRAP 0x010
#define WBF_WORDBREAK 0x020
#define WBF_OVERFLOW 0x040
#define WBF_LEVEL1 0x080
#define WBF_LEVEL2 0x100
#define WBF_CUSTOM 0x200
/* Far East specific flags */
#define IMF_FORCENONE 0x0001
#define IMF_FORCEENABLE 0x0002
#define IMF_FORCEDISABLE 0x0004
#define IMF_CLOSESTATUSWINDOW 0x0008
#define IMF_VERTICAL 0x0020
#define IMF_FORCEACTIVE 0x0040
#define IMF_FORCEINACTIVE 0x0080
#define IMF_FORCEREMEMBER 0x0100
#define IMF_MULTIPLEEDIT 0x0400
/* Word break flags (used with WB_CLASSIFY) */
#define WBF_CLASS ((BYTE) 0x0F)
#define WBF_ISWHITE ((BYTE) 0x10)
#define WBF_BREAKLINE ((BYTE) 0x20)
#define WBF_BREAKAFTER ((BYTE) 0x40)
/* new data types */
#ifdef _WIN32
/* extended edit word break proc (character set aware) */
typedef LONG (*EDITWORDBREAKPROCEX)(char *pchText, LONG cchText, BYTE bCharSet, INT action);
#endif
/* all character format measurements are in twips */
typedef struct _charformat
{
UINT cbSize;
_WPAD _wPad1;
DWORD dwMask;
DWORD dwEffects;
LONG yHeight;
LONG yOffset;
COLORREF crTextColor;
BYTE bCharSet;
BYTE bPitchAndFamily;
char szFaceName[LF_FACESIZE];
_WPAD _wPad2;
} CHARFORMATA;
typedef struct _charformatw
{
UINT cbSize;
_WPAD _wPad1;
DWORD dwMask;
DWORD dwEffects;
LONG yHeight;
LONG yOffset;
COLORREF crTextColor;
BYTE bCharSet;
BYTE bPitchAndFamily;
WCHAR szFaceName[LF_FACESIZE];
_WPAD _wPad2;
} CHARFORMATW;
#if (_RICHEDIT_VER >= 0x0200)
#ifdef UNICODE
#define CHARFORMAT CHARFORMATW
#else
#define CHARFORMAT CHARFORMATA
#endif /* UNICODE */
#else
#define CHARFORMAT CHARFORMATA
#endif /* _RICHEDIT_VER >= 0x0200 */
/* CHARFORMAT masks */
#define CFM_BOLD 0x00000001
#define CFM_ITALIC 0x00000002
#define CFM_UNDERLINE 0x00000004
#define CFM_STRIKEOUT 0x00000008
#define CFM_PROTECTED 0x00000010
#define CFM_LINK 0x00000020 /* Exchange hyperlink extension */
#define CFM_SIZE 0x80000000
#define CFM_COLOR 0x40000000
#define CFM_FACE 0x20000000
#define CFM_OFFSET 0x10000000
#define CFM_CHARSET 0x08000000
/* CHARFORMAT effects */
#define CFE_BOLD 0x0001
#define CFE_ITALIC 0x0002
#define CFE_UNDERLINE 0x0004
#define CFE_STRIKEOUT 0x0008
#define CFE_PROTECTED 0x0010
#define CFE_LINK 0x0020
#define CFE_AUTOCOLOR 0x40000000 /* NOTE: this corresponds to */
/* CFM_COLOR, which controls it */
#define yHeightCharPtsMost 1638
/* EM_SETCHARFORMAT wParam masks */
#define SCF_SELECTION 0x0001
#define SCF_WORD 0x0002
#define SCF_DEFAULT 0x0000 // set the default charformat or paraformat
#define SCF_ALL 0x0004 // not valid with SCF_SELECTION or SCF_WORD
#define SCF_USEUIRULES 0x0008 // modifier for SCF_SELECTION; says that
// the format came from a toolbar, etc. and
// therefore UI formatting rules should be
// used instead of strictly formatting the
// selection.
typedef struct _charrange
{
LONG cpMin;
LONG cpMax;
} CHARRANGE;
typedef struct _textrange
{
CHARRANGE chrg;
LPSTR lpstrText; /* allocated by caller, zero terminated by RichEdit */
} TEXTRANGEA;
typedef struct _textrangew
{
CHARRANGE chrg;
LPWSTR lpstrText; /* allocated by caller, zero terminated by RichEdit */
} TEXTRANGEW;
#if (_RICHEDIT_VER >= 0x0200)
#ifdef UNICODE
#define TEXTRANGE TEXTRANGEW
#else
#define TEXTRANGE TEXTRANGEA
#endif /* UNICODE */
#else
#define TEXTRANGE TEXTRANGEA
#endif /* _RICHEDIT_VER >= 0x0200 */
typedef DWORD (CALLBACK *EDITSTREAMCALLBACK)(DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb);
typedef struct _editstream
{
DWORD dwCookie; /* user value passed to callback as first parameter */
DWORD dwError; /* last error */
EDITSTREAMCALLBACK pfnCallback;
} EDITSTREAM;
/* stream formats */
#define SF_TEXT 0x0001
#define SF_RTF 0x0002
#define SF_RTFNOOBJS 0x0003 /* outbound only */
#define SF_TEXTIZED 0x0004 /* outbound only */
#define SF_UNICODE 0x0010 /* Unicode file of some kind */
/* Flag telling stream operations to operate on the selection only */
/* EM_STREAMIN will replace the current selection */
/* EM_STREAMOUT will stream out the current selection */
#define SFF_SELECTION 0x8000
/* Flag telling stream operations to operate on the common RTF keyword only */
/* EM_STREAMIN will accept the only common RTF keyword */
/* EM_STREAMOUT will stream out the only common RTF keyword */
#define SFF_PLAINRTF 0x4000
typedef struct _findtext
{
CHARRANGE chrg;
LPSTR lpstrText;
} FINDTEXTA;
typedef struct _findtextw
{
CHARRANGE chrg;
LPWSTR lpstrText;
} FINDTEXTW;
#if (_RICHEDIT_VER >= 0x0200)
#ifdef UNICODE
#define FINDTEXT FINDTEXTW
#else
#define FINDTEXT FINDTEXTA
#endif /* UNICODE */
#else
#define FINDTEXT FINDTEXTA
#endif /* _RICHEDIT_VER >= 0x0200 */
typedef struct _findtextexa
{
CHARRANGE chrg;
LPSTR lpstrText;
CHARRANGE chrgText;
} FINDTEXTEXA;
typedef struct _findtextexw
{
CHARRANGE chrg;
LPWSTR lpstrText;
CHARRANGE chrgText;
} FINDTEXTEXW;
#if (_RICHEDIT_VER >= 0x0200)
#ifdef UNICODE
#define FINDTEXTEX FINDTEXTEXW
#else
#define FINDTEXTEX FINDTEXTEXA
#endif /* UNICODE */
#else
#define FINDTEXTEX FINDTEXTEXA
#endif /* _RICHEDIT_VER >= 0x0200 */
typedef struct _formatrange
{
HDC hdc;
HDC hdcTarget;
RECT rc;
RECT rcPage;
CHARRANGE chrg;
} FORMATRANGE;
/* all paragraph measurements are in twips */
#define MAX_TAB_STOPS 32
#define lDefaultTab 720
typedef struct _paraformat
{
UINT cbSize;
_WPAD _wPad1;
DWORD dwMask;
WORD wNumbering;
#if (_RICHEDIT_VER >= 0x0210)
WORD wEffects;
#else
WORD wReserved;
#endif /* _RICHEDIT_VER >= 0x0210 */
LONG dxStartIndent;
LONG dxRightIndent;
LONG dxOffset;
WORD wAlignment;
SHORT cTabCount;
LONG rgxTabs[MAX_TAB_STOPS];
} PARAFORMAT;
/* PARAFORMAT mask values */
#define PFM_STARTINDENT 0x00000001
#define PFM_RIGHTINDENT 0x00000002
#define PFM_OFFSET 0x00000004
#define PFM_ALIGNMENT 0x00000008
#define PFM_TABSTOPS 0x00000010
#define PFM_NUMBERING 0x00000020
#define PFM_OFFSETINDENT 0x80000000
/* PARAFORMAT numbering options */
#define PFN_BULLET 0x0001
/* PARAFORMAT alignment options */
#define PFA_LEFT 0x0001
#define PFA_RIGHT 0x0002
#define PFA_CENTER 0x0003
/* CHARFORMAT2 and PARAFORMAT2 structures */
#ifdef __cplusplus
struct CHARFORMAT2W : _charformatw
{
WORD wWeight; /* Font weight (LOGFONT value) */
SHORT sSpacing; /* Amount to space between letters */
COLORREF crBackColor; /* Background color */
LCID lcid; /* Locale ID */
DWORD dwReserved; /* Reserved. Must be 0 */
SHORT sStyle; /* Style handle */
WORD wKerning; /* Twip size above which to kern char pair*/
BYTE bUnderlineType; /* Underline type */
BYTE bAnimation; /* Animated text like marching ants */
BYTE bRevAuthor; /* Revision author index */
};
struct CHARFORMAT2A : _charformat
{
WORD wWeight; /* Font weight (LOGFONT value) */
SHORT sSpacing; /* Amount to space between letters */
COLORREF crBackColor; /* Background color */
LCID lcid; /* Locale ID */
DWORD dwReserved; /* Reserved. Must be 0 */
SHORT sStyle; /* Style handle */
WORD wKerning; /* Twip size above which to kern char pair*/
BYTE bUnderlineType; /* Underline type */
BYTE bAnimation; /* Animated text like marching ants */
BYTE bRevAuthor; /* Revision author index */
};
#else /* regular C-style */
typedef struct _charformat2w
{
UINT cbSize;
_WPAD _wPad1;
DWORD dwMask;
DWORD dwEffects;
LONG yHeight;
LONG yOffset; /* > 0 for superscript, < 0 for subscript */
COLORREF crTextColor;
BYTE bCharSet;
BYTE bPitchAndFamily;
WCHAR szFaceName[LF_FACESIZE];
_WPAD _wPad2;
WORD wWeight; /* Font weight (LOGFONT value) */
SHORT sSpacing; /* Amount to space between letters */
COLORREF crBackColor; /* Background color */
LCID lcid; /* Locale ID */
DWORD dwReserved; /* Reserved. Must be 0 */
SHORT sStyle; /* Style handle */
WORD wKerning; /* Twip size above which to kern char pair*/
BYTE bUnderlineType; /* Underline type */
BYTE bAnimation; /* Animated text like marching ants */
BYTE bRevAuthor; /* Revision author index */
BYTE bReserved1;
} CHARFORMAT2W;
typedef struct _charformat2a
{
UINT cbSize;
_WPAD _wPad1;
DWORD dwMask;
DWORD dwEffects;
LONG yHeight;
LONG yOffset; /* > 0 for superscript, < 0 for subscript */
COLORREF crTextColor;
BYTE bCharSet;
BYTE bPitchAndFamily;
char szFaceName[LF_FACESIZE];
_WPAD _wPad2;
WORD wWeight; /* Font weight (LOGFONT value) */
SHORT sSpacing; /* Amount to space between letters */
COLORREF crBackColor; /* Background color */
LCID lcid; /* Locale ID */
DWORD dwReserved; /* Reserved. Must be 0 */
SHORT sStyle; /* Style handle */
WORD wKerning; /* Twip size above which to kern char pair*/
BYTE bUnderlineType; /* Underline type */
BYTE bAnimation; /* Animated text like marching ants */
BYTE bRevAuthor; /* Revision author index */
} CHARFORMAT2A;
#endif /* C++ */
#ifdef UNICODE
#define CHARFORMAT2 CHARFORMAT2W
#else
#define CHARFORMAT2 CHARFORMAT2A
#endif
#define CHARFORMATDELTA (sizeof(CHARFORMAT2) - sizeof(CHARFORMAT))
/* CHARFORMAT and PARAFORMAT "ALL" masks
CFM_COLOR mirrors CFE_AUTOCOLOR, a little hack to easily deal with autocolor*/
#define CFM_EFFECTS (CFM_BOLD | CFM_ITALIC | CFM_UNDERLINE | CFM_COLOR | \
CFM_STRIKEOUT | CFE_PROTECTED | CFM_LINK)
#define CFM_ALL (CFM_EFFECTS | CFM_SIZE | CFM_FACE | CFM_OFFSET | CFM_CHARSET)
#define PFM_ALL (PFM_STARTINDENT | PFM_RIGHTINDENT | PFM_OFFSET | \
PFM_ALIGNMENT | PFM_TABSTOPS | PFM_NUMBERING | \
PFM_OFFSETINDENT| PFM_DIR)
/* New masks and effects -- a parenthesized asterisk indicates that
the data is stored by RichEdit2.0, but not displayed */
#define CFM_SMALLCAPS 0x0040 /* (*) */
#define CFM_ALLCAPS 0x0080 /* (*) */
#define CFM_HIDDEN 0x0100 /* (*) */
#define CFM_OUTLINE 0x0200 /* (*) */
#define CFM_SHADOW 0x0400 /* (*) */
#define CFM_EMBOSS 0x0800 /* (*) */
#define CFM_IMPRINT 0x1000 /* (*) */
#define CFM_DISABLED 0x2000
#define CFM_REVISED 0x4000
#define CFM_BACKCOLOR 0x04000000
#define CFM_LCID 0x02000000
#define CFM_UNDERLINETYPE 0x00800000 /* (*) */
#define CFM_WEIGHT 0x00400000
#define CFM_SPACING 0x00200000 /* (*) */
#define CFM_KERNING 0x00100000 /* (*) */
#define CFM_STYLE 0x00080000 /* (*) */
#define CFM_ANIMATION 0x00040000 /* (*) */
#define CFM_REVAUTHOR 0x00008000
#define CFE_SUBSCRIPT 0x00010000 /* Superscript and subscript are */
#define CFE_SUPERSCRIPT 0x00020000 /* mutually exclusive */
#define CFM_SUBSCRIPT CFE_SUBSCRIPT | CFE_SUPERSCRIPT
#define CFM_SUPERSCRIPT CFM_SUBSCRIPT
#define CFM_EFFECTS2 (CFM_EFFECTS | CFM_DISABLED | CFM_SMALLCAPS | CFM_ALLCAPS \
| CFM_HIDDEN | CFM_OUTLINE | CFM_SHADOW | CFM_EMBOSS \
| CFM_IMPRINT | CFM_DISABLED | CFM_REVISED \
| CFM_SUBSCRIPT | CFM_SUPERSCRIPT | CFM_BACKCOLOR)
#define CFM_ALL2 (CFM_ALL | CFM_EFFECTS2 | CFM_BACKCOLOR | CFM_LCID \
| CFM_UNDERLINETYPE | CFM_WEIGHT | CFM_REVAUTHOR \
| CFM_SPACING | CFM_KERNING | CFM_STYLE | CFM_ANIMATION)
#define CFE_SMALLCAPS CFM_SMALLCAPS
#define CFE_ALLCAPS CFM_ALLCAPS
#define CFE_HIDDEN CFM_HIDDEN
#define CFE_OUTLINE CFM_OUTLINE
#define CFE_SHADOW CFM_SHADOW
#define CFE_EMBOSS CFM_EMBOSS
#define CFE_IMPRINT CFM_IMPRINT
#define CFE_DISABLED CFM_DISABLED
#define CFE_REVISED CFM_REVISED
/* NOTE: CFE_AUTOCOLOR and CFE_AUTOBACKCOLOR correspond to CFM_COLOR and
CFM_BACKCOLOR, respectively, which control them */
#define CFE_AUTOBACKCOLOR CFM_BACKCOLOR
/* Underline types */
#define CFU_CF1UNDERLINE 0xFF /* map charformat's bit underline to CF2.*/
#define CFU_INVERT 0xFE /* For IME composition fake a selection.*/
#define CFU_UNDERLINEDOTTED 0x4 /* (*) displayed as ordinary underline */
#define CFU_UNDERLINEDOUBLE 0x3 /* (*) displayed as ordinary underline */
#define CFU_UNDERLINEWORD 0x2 /* (*) displayed as ordinary underline */
#define CFU_UNDERLINE 0x1
#define CFU_UNDERLINENONE 0
#ifdef __cplusplus
struct PARAFORMAT2 : _paraformat
{
LONG dySpaceBefore; /* Vertical spacing before para */
LONG dySpaceAfter; /* Vertical spacing after para */
LONG dyLineSpacing; /* Line spacing depending on Rule */
SHORT sStyle; /* Style handle */
BYTE bLineSpacingRule; /* Rule for line spacing (see tom.doc) */
BYTE bCRC; /* Reserved for CRC for rapid searching */
WORD wShadingWeight; /* Shading in hundredths of a per cent */
WORD wShadingStyle; /* Nibble 0: style, 1: cfpat, 2: cbpat */
WORD wNumberingStart; /* Starting value for numbering */
WORD wNumberingStyle; /* Alignment, roman/arabic, (), ), ., etc.*/
WORD wNumberingTab; /* Space bet FirstIndent and 1st-line text*/
WORD wBorderSpace; /* Space between border and text (twips)*/
WORD wBorderWidth; /* Border pen width (twips) */
WORD wBorders; /* Byte 0: bits specify which borders */
/* Nibble 2: border style, 3: color index*/
};
#else /* regular C-style */
typedef struct _paraformat2
{
UINT cbSize;
_WPAD _wPad1;
DWORD dwMask;
WORD wNumbering;
#if (_RICHEDIT_VER >= 0x0210)
WORD wEffects;
#else
WORD wReserved;
#endif /* _RICHEDIT_VER >= 0x0210 */
LONG dxStartIndent;
LONG dxRightIndent;
LONG dxOffset;
WORD wAlignment;
SHORT cTabCount;
LONG rgxTabs[MAX_TAB_STOPS];
LONG dySpaceBefore; /* Vertical spacing before para */
LONG dySpaceAfter; /* Vertical spacing after para */
LONG dyLineSpacing; /* Line spacing depending on Rule */
SHORT sStyle; /* Style handle */
BYTE bLineSpacingRule; /* Rule for line spacing (see tom.doc) */
BYTE bCRC; /* Reserved for CRC for rapid searching */
WORD wShadingWeight; /* Shading in hundredths of a per cent */
WORD wShadingStyle; /* Nibble 0: style, 1: cfpat, 2: cbpat */
WORD wNumberingStart; /* Starting value for numbering */
WORD wNumberingStyle; /* Alignment, roman/arabic, (), ), ., etc.*/
WORD wNumberingTab; /* Space bet 1st indent and 1st-line text*/
WORD wBorderSpace; /* Space between border and text (twips)*/
WORD wBorderWidth; /* Border pen width (twips) */
WORD wBorders; /* Byte 0: bits specify which borders */
/* Nibble 2: border style, 3: color index*/
} PARAFORMAT2;
#endif /* C++ */
/* PARAFORMAT 2.0 masks and effects */
#define PFM_SPACEBEFORE 0x00000040
#define PFM_SPACEAFTER 0x00000080
#define PFM_LINESPACING 0x00000100
#define PFM_STYLE 0x00000400
#define PFM_BORDER 0x00000800 /* (*) */
#define PFM_SHADING 0x00001000 /* (*) */
#define PFM_NUMBERINGSTYLE 0x00002000 /* (*) */
#define PFM_NUMBERINGTAB 0x00004000 /* (*) */
#define PFM_NUMBERINGSTART 0x00008000 /* (*) */
#define PFM_DIR 0x00010000
#define PFM_RTLPARA 0x00010000 /* (Version 1.0 flag) */
#define PFM_KEEP 0x00020000 /* (*) */
#define PFM_KEEPNEXT 0x00040000 /* (*) */
#define PFM_PAGEBREAKBEFORE 0x00080000 /* (*) */
#define PFM_NOLINENUMBER 0x00100000 /* (*) */
#define PFM_NOWIDOWCONTROL 0x00200000 /* (*) */
#define PFM_DONOTHYPHEN 0x00400000 /* (*) */
#define PFM_SIDEBYSIDE 0x00800000 /* (*) */
#define PFM_TABLE 0xc0000000 /* (*) */
/* Note: PARAFORMAT has no effects */
#define PFM_EFFECTS (PFM_DIR | PFM_KEEP | PFM_KEEPNEXT | PFM_TABLE \
| PFM_PAGEBREAKBEFORE | PFM_NOLINENUMBER \
| PFM_NOWIDOWCONTROL | PFM_DONOTHYPHEN | PFM_SIDEBYSIDE \
| PFM_TABLE)
#define PFM_ALL2 (PFM_ALL | PFM_EFFECTS | PFM_SPACEBEFORE | PFM_SPACEAFTER \
| PFM_LINESPACING | PFM_STYLE | PFM_SHADING | PFM_BORDER \
| PFM_NUMBERINGTAB | PFM_NUMBERINGSTART | PFM_NUMBERINGSTYLE)
#define PFE_RTLPARA (PFM_DIR >> 16)
#define PFE_RTLPAR (PFM_RTLPARA >> 16) /* (Version 1.0 flag) */
#define PFE_KEEP (PFM_KEEP >> 16) /* (*) */
#define PFE_KEEPNEXT (PFM_KEEPNEXT >> 16) /* (*) */
#define PFE_PAGEBREAKBEFORE (PFM_PAGEBREAKBEFORE >> 16) /* (*) */
#define PFE_NOLINENUMBER (PFM_NOLINENUMBER >> 16) /* (*) */
#define PFE_NOWIDOWCONTROL (PFM_NOWIDOWCONTROL >> 16) /* (*) */
#define PFE_DONOTHYPHEN (PFM_DONOTHYPHEN >> 16) /* (*) */
#define PFE_SIDEBYSIDE (PFM_SIDEBYSIDE >> 16) /* (*) */
#define PFE_TABLEROW 0xc000 /* These 3 options are mutually */
#define PFE_TABLECELLEND 0x8000 /* exclusive and each imply */
#define PFE_TABLECELL 0x4000 /* that para is part of a table*/
/*
* PARAFORMAT numbering options (values for wNumbering):
*
* Numbering Type Value Meaning
* tomNoNumbering 0 Turn off paragraph numbering
* tomNumberAsLCLetter 1 a, b, c, ...
* tomNumberAsUCLetter 2 A, B, C, ...
* tomNumberAsLCRoman 3 i, ii, iii, ...
* tomNumberAsUCRoman 4 I, II, III, ...
* tomNumberAsSymbols 5 default is bullet
* tomNumberAsNumber 6 0, 1, 2, ...
* tomNumberAsSequence 7 tomNumberingStart is first Unicode to use
*
* Other valid Unicode chars are Unicodes for bullets.
*/
#define PFA_JUSTIFY 4 /* New paragraph-alignment option 2.0 (*)
/* notification structures */
#ifndef WM_NOTIFY
#define WM_NOTIFY 0x004E
typedef struct _nmhdr
{
HWND hwndFrom;
_WPAD _wPad1;
UINT idFrom;
_WPAD _wPad2;
UINT code;
_WPAD _wPad3;
} NMHDR;
#endif /* !WM_NOTIFY */
typedef struct _msgfilter
{
NMHDR nmhdr;
UINT msg;
_WPAD _wPad1;
WPARAM wParam;
_WPAD _wPad2;
LPARAM lParam;
} MSGFILTER;
typedef struct _reqresize
{
NMHDR nmhdr;
RECT rc;
} REQRESIZE;
typedef struct _selchange
{
NMHDR nmhdr;
CHARRANGE chrg;
WORD seltyp;
} SELCHANGE;
#define SEL_EMPTY 0x0000
#define SEL_TEXT 0x0001
#define SEL_OBJECT 0x0002
#define SEL_MULTICHAR 0x0004
#define SEL_MULTIOBJECT 0x0008
/* used with IRichEditOleCallback::GetContextMenu, this flag will be
passed as a "selection type". It indicates that a context menu for
a right-mouse drag drop should be generated. The IOleObject parameter
will really be the IDataObject for the drop
*/
#define GCM_RIGHTMOUSEDROP 0x8000
typedef struct _endropfiles
{
NMHDR nmhdr;
HANDLE hDrop;
LONG cp;
BOOL fProtected;
} ENDROPFILES;
typedef struct _enprotected
{
NMHDR nmhdr;
UINT msg;
_WPAD _wPad1;
WPARAM wParam;
_WPAD _wPad2;
LPARAM lParam;
CHARRANGE chrg;
} ENPROTECTED;
typedef struct _ensaveclipboard
{
NMHDR nmhdr;
LONG cObjectCount;
LONG cch;
} ENSAVECLIPBOARD;
#ifndef MACPORT
typedef struct _enoleopfailed
{
NMHDR nmhdr;
LONG iob;
LONG lOper;
HRESULT hr;
} ENOLEOPFAILED;
#endif
#define OLEOP_DOVERB 1
typedef struct _objectpositions
{
NMHDR nmhdr;
LONG cObjectCount;
LONG *pcpPositions;
} OBJECTPOSITIONS;
typedef struct _enlink
{
NMHDR nmhdr;
UINT msg;
_WPAD _wPad1;
WPARAM wParam;
_WPAD _wPad2;
LPARAM lParam;
CHARRANGE chrg;
} ENLINK;
/* PenWin specific */
typedef struct _encorrecttext
{
NMHDR nmhdr;
CHARRANGE chrg;
WORD seltyp;
} ENCORRECTTEXT;
/* Far East specific */
typedef struct _punctuation
{
UINT iSize;
LPSTR szPunctuation;
} PUNCTUATION;
/* Far East specific */
typedef struct _compcolor
{
COLORREF crText;
COLORREF crBackground;
DWORD dwEffects;
}COMPCOLOR;
/* clipboard formats - use as parameter to RegisterClipboardFormat() */
#define CF_RTF TEXT("Rich Text Format")
#define CF_RTFNOOBJS TEXT("Rich Text Format Without Objects")
#define CF_RETEXTOBJ TEXT("RichEdit Text and Objects")
/* Paste Special */
typedef struct _repastespecial
{
DWORD dwAspect;
DWORD dwParam;
} REPASTESPECIAL;
/* UndoName info */
typedef enum _undonameid
{
UID_UNKNOWN = 0,
UID_TYPING = 1,
UID_DELETE = 2,
UID_DRAGDROP = 3,
UID_CUT = 4,
UID_PASTE = 5
} UNDONAMEID;
/* flags for the GETEXTEX data structure */
#define GT_DEFAULT 0
#define GT_USECRLF 1
/* EM_GETTEXTEX info; this struct is passed in the wparam of the message */
typedef struct _gettextex
{
DWORD cb; /* count of bytes in the string */
DWORD flags; /* flags (see the GT_XXX defines */
UINT codepage; /* code page for translation (CP_ACP for default,
1200 for Unicode */
LPCSTR lpDefaultChar; /* replacement for unmappable chars */
LPBOOL lpUsedDefChar; /* pointer to flag set when def char used */
} GETTEXTEX;
/* flags for the GETTEXTLENGTHEX data structure */
#define GTL_DEFAULT 0 /* do the default (return # of chars) */
#define GTL_USECRLF 1 /* compute answer using CRLFs for paragraphs*/
#define GTL_PRECISE 2 /* compute a precise answer */
#define GTL_CLOSE 4 /* fast computation of a "close" answer */
#define GTL_NUMCHARS 8 /* return the number of characters */
#define GTL_NUMBYTES 16 /* return the number of _bytes_ */
/* EM_GETTEXTLENGTHEX info; this struct is passed in the wparam of the msg */
typedef struct _gettextlengthex
{
DWORD flags; /* flags (see GTL_XXX defines) */
UINT codepage; /* code page for translation (CP_ACP for default,
1200 for Unicode */
} GETTEXTLENGTHEX;
/* BiDi specific features */
typedef struct _bidioptions
{
UINT cbSize;
_WPAD _wPad1;
WORD wMask;
WORD wEffects;
} BIDIOPTIONS;
/* BIDIOPTIONS masks */
#if (_RICHEDIT_VER == 0x0100)
#define BOM_DEFPARADIR 0x0001 /* Default paragraph direction (implies alignment) (obsolete) */
#define BOM_PLAINTEXT 0x0002 /* Use plain text layout (obsolete) */
#define BOM_NEUTRALOVERRIDE 0x0004 /* Override neutral layout (obsolete) */
#endif /* _RICHEDIT_VER == 0x0100 */
#define BOM_CONTEXTREADING 0x0008 /* Context reading order */
#define BOM_CONTEXTALIGNMENT 0x0010 /* Context alignment */
/* BIDIOPTIONS effects */
#if (_RICHEDIT_VER == 0x0100)
#define BOE_RTLDIR 0x0001 /* Default paragraph direction (implies alignment) (obsolete) */
#define BOE_PLAINTEXT 0x0002 /* Use plain text layout (obsolete) */
#define BOE_NEUTRALOVERRIDE 0x0004 /* Override neutral layout (obsolete) */
#endif /* _RICHEDIT_VER == 0x0100 */
#define BOE_CONTEXTREADING 0x0008 /* Context reading order */
#define BOE_CONTEXTALIGNMENT 0x0010 /* Context alignment */
/* Additional EM_FINDTEXT[EX] flags */
#define FR_MATCHDIAC 0x20000000
#define FR_MATCHKASHIDA 0x40000000
#define FR_MATCHALEFHAMZA 0x80000000
/* UNICODE embedding character */
#ifndef WCH_EMBEDDING
#define WCH_EMBEDDING (WCHAR)0xFFFC
#endif /* WCH_EMBEDDING */
#undef _WPAD
#ifdef _WIN32
#include <poppack.h>
#elif !defined(RC_INVOKED)
#pragma pack()
#endif
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* !_RICHEDIT_ */
/*++ BUILD Version: 0001 Increment this if a change has global effects
Copyright (c) 1985-1997, Microsoft Corporation
Module Name:
windows.h
Abstract:
Master include file for Windows applications.
Modified with WC_STATIC by F. Suckow 04.08.2011
--*/
#ifndef _WINDOWS_
#define _WINDOWS_
#ifndef WINVER
#define WINVER 0x0400
#else
#if defined(_WIN32_WINNT) && (WINVER < 0x0400) && (_WIN32_WINNT > 0x0400)
#error WINVER setting conflicts with _WIN32_WINNT setting
#endif
#endif
#ifndef WC_STATIC
#define WC_STATIC "Static"
#endif
#if(WINVER >= 0x0500)
#pragma message ("")
#pragma message ("NOTE: WINVER has been defined as 0x0500 or greater which enables")
#pragma message ("Windows NT 5.0 and Windows 98 features. When these headers were released,")
#pragma message ("Windows NT 5.0 beta 1 and Windows 98 beta 2.1 were the current versions.")
#pragma message ("")
#pragma message ("For this release when WINVER is defined as 0x0500 or greater, you can only")
#pragma message ("build beta or test applications. To build a retail application,")
#pragma message ("set WINVER to 0x0400 or visit http://www.microsoft.com/msdn/sdk")
#pragma message ("to see if retail Windows NT 5.0 or Windows 98 headers are available.")
#pragma message ("")
#pragma message ("See the SDK release notes for more information.")
#pragma message ("")
#endif
#ifndef _INC_WINDOWS
#define _INC_WINDOWS
#if defined (_MSC_VER) && (_MSC_VER >= 1020)
#pragma once
#endif
/* If defined, the following flags inhibit definition
* of the indicated items.
*
* NOGDICAPMASKS - CC_*, LC_*, PC_*, CP_*, TC_*, RC_
* NOVIRTUALKEYCODES - VK_*
* NOWINMESSAGES - WM_*, EM_*, LB_*, CB_*
* NOWINSTYLES - WS_*, CS_*, ES_*, LBS_*, SBS_*, CBS_*
* NOSYSMETRICS - SM_*
* NOMENUS - MF_*
* NOICONS - IDI_*
* NOKEYSTATES - MK_*
* NOSYSCOMMANDS - SC_*
* NORASTEROPS - Binary and Tertiary raster ops
* NOSHOWWINDOW - SW_*
* OEMRESOURCE - OEM Resource values
* NOATOM - Atom Manager routines
* NOCLIPBOARD - Clipboard routines
* NOCOLOR - Screen colors
* NOCTLMGR - Control and Dialog routines
* NODRAWTEXT - DrawText() and DT_*
* NOGDI - All GDI defines and routines
* NOKERNEL - All KERNEL defines and routines
* NOUSER - All USER defines and routines
* NONLS - All NLS defines and routines
* NOMB - MB_* and MessageBox()
* NOMEMMGR - GMEM_*, LMEM_*, GHND, LHND, associated routines
* NOMETAFILE - typedef METAFILEPICT
* NOMINMAX - Macros min(a,b) and max(a,b)
* NOMSG - typedef MSG and associated routines
* NOOPENFILE - OpenFile(), OemToAnsi, AnsiToOem, and OF_*
* NOSCROLL - SB_* and scrolling routines
* NOSERVICE - All Service Controller routines, SERVICE_ equates, etc.
* NOSOUND - Sound driver routines
* NOTEXTMETRIC - typedef TEXTMETRIC and associated routines
* NOWH - SetWindowsHook and WH_*
* NOWINOFFSETS - GWL_*, GCL_*, associated routines
* NOCOMM - COMM driver routines
* NOKANJI - Kanji support stuff.
* NOHELP - Help engine interface.
* NOPROFILER - Profiler interface.
* NODEFERWINDOWPOS - DeferWindowPos routines
* NOMCX - Modem Configuration Extensions
*/
#if defined(RC_INVOKED) && !defined(NOWINRES)
#include <winresrc.h>
#else
#if defined(RC_INVOKED)
/* Turn off a bunch of stuff to ensure that RC files compile OK. */
#define NOATOM
#define NOGDI
#define NOGDICAPMASKS
#define NOMETAFILE
#define NOMINMAX
#define NOMSG
#define NOOPENFILE
#define NORASTEROPS
#define NOSCROLL
#define NOSOUND
#define NOSYSMETRICS
#define NOTEXTMETRIC
#define NOWH
#define NOCOMM
#define NOKANJI
#define NOCRYPT
#define NOMCX
#endif
#if !defined(_68K_) && !defined(_MPPC_) && !defined(_PPC_) && !defined(_ALPHA_) && !defined(_MIPS_) && !defined(_X86_) && defined(_M_IX86)
#define _X86_
#endif
#if !defined(_68K_) && !defined(_MPPC_) && !defined(_PPC_) && !defined(_ALPHA_) && !defined(_X86_) && !defined(_MIPS_) && defined(_M_MRX000)
#define _MIPS_
#endif
#if !defined(_68K_) && !defined(_MPPC_) && !defined(_PPC_) && !defined(_ALPHA_) && !defined(_X86_) && !defined(_MIPS_) && defined(_M_ALPHA)
#define _ALPHA_
#endif
#if !defined(_68K_) && !defined(_MPPC_) && !defined(_PPC_) && !defined(_ALPHA_) && !defined(_X86_) && !defined(_MIPS_) && defined(_M_PPC)
#define _PPC_
#endif
#if !defined(_68K_) && !defined(_MPPC_) && !defined(_PPC_) && !defined(_ALPHA_) && !defined(_X86_) && !defined(_MIPS_) && defined(_M_M68K)
#define _68K_
#endif
#if !defined(_68K_) && !defined(_MPPC_) && !defined(_PPC_) && !defined(_ALPHA_) && !defined(_X86_) && !defined(_MIPS_) && defined(_M_MPPC)
#define _MPPC_
#endif
#ifndef _MAC
#if defined(_68K_) || defined(_MPPC_)
#define _MAC
#endif
#endif
#ifndef RC_INVOKED
#if ( _MSC_VER >= 800 )
#pragma warning(disable:4001)
#pragma warning(disable:4201)
#pragma warning(disable:4214)
#pragma warning(disable:4514)
#endif
#include <excpt.h>
#include <stdarg.h>
#endif /* RC_INVOKED */
#include <windef.h>
#include <winbase.h>
#include <wingdi.h>
#include <winuser.h>
#ifdef _MAC
DECLARE_HANDLE(HKEY);
typedef HKEY *PHKEY;
#endif
#if !defined(_MAC) || defined(_WIN32NLS)
#include <winnls.h>
#endif
#ifndef _MAC
#include <wincon.h>
#include <winver.h>
#endif
#if !defined(_MAC) || defined(_WIN32REG)
#include <winreg.h>
#endif
#ifndef _MAC
#include <winnetwk.h>
#endif
#ifndef WIN32_LEAN_AND_MEAN
#include <cderr.h>
#include <dde.h>
#include <ddeml.h>
#include <dlgs.h>
#ifndef _MAC
#include <lzexpand.h>
#include <mmsystem.h>
#include <nb30.h>
#include <rpc.h>
#endif
#include <shellapi.h>
#ifndef _MAC
#include <winperf.h>
#if(_WIN32_WINNT >= 0x0400)
#include <winsock2.h>
#include <mswsock.h>
#else
#include <winsock.h>
#endif /* _WIN32_WINNT >= 0x0400 */
#endif
#ifndef NOCRYPT
#include <wincrypt.h>
#endif
#ifndef NOGDI
#include <commdlg.h>
#ifndef _MAC
#include <winspool.h>
#ifdef INC_OLE1
#include <ole.h>
#else
#include <ole2.h>
#endif /* !INC_OLE1 */
#endif /* !MAC */
#endif /* !NOGDI */
#endif /* WIN32_LEAN_AND_MEAN */
#ifdef _MAC
#include <winwlm.h>
#endif
#ifdef INC_OLE2
#include <ole2.h>
#endif /* INC_OLE2 */
#ifndef _MAC
#ifndef NOSERVICE
#include <winsvc.h>
#endif
#if(WINVER >= 0x0400)
#ifndef NOMCX
#include <mcx.h>
#endif /* NOMCX */
#ifndef NOIME
#include <imm.h>
#endif
#endif /* WINVER >= 0x0400 */
#endif
#ifndef RC_INVOKED
#if ( _MSC_VER >= 800 )
#pragma warning(default:4001)
#pragma warning(default:4201)
#pragma warning(default:4214)
/* Leave 4514 disabled. It's a stupid warning anyway. */
#endif
#endif /* RC_INVOKED */
#endif /* RC_INVOKED */
#endif /* _INC_WINDOWS */
#endif /* _WINDOWS_ */
!*****************************************************************!
!* *!
!* 4C (FORESEE) Simulation Model *!
!* *!
!* *!
!* data module data_clas for forest type classification wclas *!
!* *!
!* Copyright (C) 1996-2018 *!
!* Potsdam Institute for Climate Impact Reserach (PIK) *!
!* Authors and contributors see AUTHOR file *!
!* This file is part of 4C and is licensed under BSD-2-Clause *!
!* See LICENSE file or under *!
!* http://www.https://opensource.org/licenses/BSD-2-Clause *!
!* Contact: *!
!* https://gitlab.pik-potsdam.de/foresee/4C *!
!* *!
!*****************************************************************!
module data_clas
real, allocatable, dimension(:) :: bpart
real lhpar, nhpar, alhpar, alnpar
end module data_clas
!*****************************************************************!
!* *!
!* 4C (FORESEE) Simulation Model *!
!* *!
!* climate data modules *!
!* *!
!* containes: *!
!* DATA_CLIMATE *!
!* DATA_EVAPO *!
!* DATA_INTER *!
!* DATA_DEPO *!
!* *!
!* Copyright (C) 1996-2018 *!
!* Potsdam Institute for Climate Impact Reserach (PIK) *!
!* Authors and contributors see AUTHOR file *!
!* This file is part of 4C and is licensed under BSD-2-Clause *!
!* See LICENSE file or under *!
!* http://www.https://opensource.org/licenses/BSD-2-Clause *!
!* Contact: *!
!* https://gitlab.pik-potsdam.de/foresee/4C *!
!* *!
!*****************************************************************!
module data_climate
! flag defines structure of climate data file
integer :: flag_climtyp = 0
integer :: i_exit ! day number of first missing data record
integer,allocatable,save,dimension(:) :: recs,yy
integer,allocatable,save,dimension(:,:) :: dd,mm
real,allocatable,save,dimension(:,:) :: tp,hm,prc,prs,rd,wd, tx, tn,vp, sdu,bw, sde
real,allocatable,save,dimension(:) :: tpmean
real :: airtemp = -99., & ! air temperature (°C)
airtemp_1 = -99., & ! air temperature of previous day (°C)
airtemp_2 = -99., & ! air temperature of two days before (°C)
airtemp_max = -99., & ! maximum air temperature (°C)
airtemp_min = -99., & ! minimum air temperature (°C)
hum = -99., & ! humidity (%)
prec = -99., & ! precipitation (mm)
press = -99., & ! pressure (hPa)
rad = -99., & ! solar radiation(J/cm2)
rad_max = -99., & ! maximal solar radiation(J/cm2)
wind = -99., & ! wind velocity (m/s)
rnet_tot = -99., & ! total net radiation(J/cm2)
avg_incl , & ! average sun inclination [degrees]
beta , & ! average sun inclination [radians]
dlength = -99., & ! day length == Photoperiode (h)
dptemp = -99., & ! dew point temperature
co2 = -99. ! atmospheric CO2 content (mol/mol)
integer :: flag_vegper = 0 ! indicates vegetation period described by temeprature > 10°C
integer :: flag_tveg = 0
integer :: iday_vegper = 0
! cumulative and mean values per year
real :: med_air ! yearly mean air temperature
real :: med_air_ms ! average temperature May - September
real :: med_air_mj ! avarage temperature May - July
real :: sum_prec ! yearly precipitation sum
real :: sum_prec_ms ! precipitation sum May - September
real :: sum_prec_mj ! precipitation sum may - July
real :: med_air_wm ! average temperature of the warmest month
real :: med_air_cm ! average temperature of the coldest month
real :: med_rad
real :: med_rad1 ! annual mean of daily solar radiation of the first year of simulation
real :: med_wind
real :: gdday ! annual growing degree day
! values per month
real, dimension(12) :: temp_mon ! mean monthly average air temperature (°C)
real, dimension(12) :: prec_mon ! mean monthly precipitation sum (mm)
real, dimension(12) :: rad_mon ! mean monthly average of daily radiation (J/cm2)
real, dimension(12) :: hum_mon ! mean monthly average daily relative humidity (%)
real :: aet_dec ! sum of AET of last december (mm)
real :: temp_dec ! mean average air temperature of last december (°C)
real :: prec_dec ! precipitation sum of last december (mm)
real :: rad_dec ! mean average of daily radiation of last december (J/cm2)
real :: hum_dec ! mean average of daily relative humidity of last december (%)
! values per week
real, dimension(53) :: temp_week ! mean monthly average air temperature (°C)
real, dimension(53) :: prec_week ! mean monthly precipitation sum (mm)
! for calculation of long-term monthly means
real, dimension(12) :: tempmean_mo ! long-term monthly means
real, dimension(12) :: tempmean_mo_a ! annual monthly means
integer :: days_summer = -99, & ! number of summer days (Tmax > 25°C)
days_hot = -99, & ! number of hot days (Tmax > 30°C)
days_ice = -99, & ! number of ice days (Tmax < 0°C)
days_dry = -99, & ! number of days without precipitation
days_hrain = -99, & ! number of days with heavy rain (> 10mm)
days_snow = -99, & ! number of days with snow (4C simulation)
days_rain = -99, & ! number of days with rain > 0.1 mm
days_rain_mj = -99, & ! number of days with rain > 0.1 mm May - July
days_wof = -99 ! number of days without frost Tmin > 0°C
! total mean values
real :: med_air_all ! overall yearly mean air temperature
real :: sum_prec_all ! overall mean yearly precipitation sum
real :: med_rad_all ! overall mean annual radiation
real :: gdday_all ! overlall mean annual growing degree day
! monthly climate indices
real :: ind_cout_mo ! monthly index Coutange
real :: ind_wiss_mo ! monthly index v. Wissmann
real :: ind_arid_mo ! monthly Index UNEP
real :: cwb_mo ! monthly climate water balance
! annual climate indices
real :: ind_arid_an ! annual aridity index UNEP
real :: cwb_an ! annual climate water balance
real :: ind_lang_an ! annual climate index acc. Linsser/Lang
real :: ind_cout_an ! annual index Coutange
real :: ind_wiss_an ! annual index v. Wissmann
real :: ind_mart_an ! annual index Martonne
real :: ind_mart_vp ! annual index martonne vegetation period (May- Sept.)
real :: ind_emb ! annual index Emberger
real :: ind_weck ! annual index Weck
real :: ind_reich ! annual index Reichel
real :: con_gor ! annual continentality index Gorczynski
real :: con_cur ! annual continentality index Currey
real :: con_con ! annual continentality index Conrad
real :: ind_bud ! annual dryness index Budyko
real :: ind_shc ! annual index Seljaninov
real :: cwb_an_m ! mean annual climate water balance of simulation period
! mean annual climate inidces of the simulation period
real :: ind_arid_an_m ! annual aridity index UNEP
real :: ind_lang_an_m ! annual climate index acc. Linsser/Lang
real :: ind_cout_an_m ! annual index Coutange
real :: ind_wiss_an_m ! annual index v. Wissmann
real :: ind_mart_an_m ! annual index Martonne
real :: ind_mart_vp_m ! annual index martonne vegetation perio (May- Sept.)
real :: ind_emb_m ! annual index Emberger
real :: ind_weck_m ! annual index Weck
real :: ind_reich_m ! annual index Reichel
real :: con_gor_m ! annual continentality index Gorczynski
real :: con_cur_m ! annual continentality index Currey
real :: con_con_m ! annual continentality index Conrad
real :: ind_bud_m ! annual dryness index Budyko
real :: ind_shc_m ! annual index Seljaninov
! values for evaluation of npp module
real,allocatable,save,dimension(:) :: tempfield
real,allocatable,save,dimension(:) :: globfield
real,allocatable,save,dimension(:) :: dayfield
real, dimension(5) :: clim_waterb = 0. ! climatic water balance (fire_risk)
! Mauna Loa CO2 time series, annual means
REAL :: year_CO2 = 2016
REAL :: Mauna_Loa_CO2(1959:2016) ! time series of annual mean CO2 measured at Mauna Loa, Hawaii
Real :: RCP_2p6(1765:2300)
Real :: RCP_6p0(1765:2150)
DATA Mauna_Loa_CO2 /0.00031598, 0.00031691, 0.00031765, 0.00031845, 0.00031899, &
0.00031952, 0.00032003, 0.00032137, 0.00032218, 0.00032305, &
0.00032462, 0.00032568, 0.00032632, 0.00032746, 0.00032968, &
0.00033025, 0.00033115, 0.00033215, 0.0003339, 0.0003355, &
0.00033685, 0.00033869, 0.00033993, 0.00034113, 0.00034278, &
0.00034442, 0.0003459, 0.00034715, 0.00034893, 0.00035148, &
0.00035291, 0.00035419, 0.00035559, 0.00035637, 0.00035704, &
0.00035888, 0.00036088, 0.00036264, 0.00036376, 0.00036663, &
0.00036831, 0.00036948, 0.00037102, 0.0003731, 0.00037564, &
0.00037738, 0.00037975, 0.00038185, 0.00038372, 0.00038557, &
0.00038738, 0.00038985, 0.00039163, 0.00039382, 0.00039648, &
0.00039861, 0.00040083, 0.00040421/
DATA RCP_2p6/278.05,278.11,278.22,278.34,278.47,278.60,278.73,278.87,279.01,279.15,279.30,279.46,279.62,279.78,279.94,280.10,280.24,280.38,280.52,280.66,&
280.80,280.96,281.12,281.28,281.44,281.60,281.75,281.89,282.03,282.17,282.30,282.43,282.55,282.67,282.79,282.90,283.01,283.11,283.21,283.31,283.40,283.49,&
283.58,283.66,283.74,283.80,283.85,283.89,283.93,283.96,284.00,284.04,284.09,284.13,284.17,284.20,284.22,284.24,284.26,284.28,284.30,284.32,284.34,284.36,&
284.38,284.40,284.39,284.28,284.13,283.98,283.83,283.68,283.53,283.43,283.40,283.40,283.43,283.50,283.60,283.73,283.90,284.08,284.23,284.40,284.58,284.73,&
284.88,285.00,285.13,285.28,285.43,285.58,285.73,285.90,286.08,286.23,286.38,286.50,286.63,286.78,286.90,287.00,287.10,287.23,287.38,287.53,287.70,287.90,&
288.13,288.40,288.70,289.03,289.40,289.80,290.23,290.70,291.20,291.68,292.13,292.58,292.98,293.30,293.58,293.80,294.00,294.18,294.33,294.48,294.60,294.70,&
294.80,294.90,295.03,295.23,295.50,295.80,296.13,296.48,296.83,297.20,297.63,298.08,298.50,298.90,299.30,299.70,300.08,300.43,300.78,301.10,301.40,301.73,&
302.08,302.40,302.70,303.03,303.40,303.78,304.13,304.53,304.98,305.40,305.83,306.30,306.78,307.23,307.70,308.18,308.60,309.00,309.40,309.75,310.00,310.18,&
310.30,310.38,310.38,310.30,310.20,310.13,310.10,310.13,310.20,310.33,310.50,310.75,311.10,311.50,311.93,312.43,313.00,313.60,314.23,314.85,315.50,316.27,&
317.08,317.80,318.40,318.93,319.65,320.65,321.61,322.64,323.90,324.99,325.86,327.14,328.68,329.74,330.59,331.75,333.27,334.85,336.53,338.36,339.73,340.79,&
342.20,343.78,345.28,346.80,348.65,350.74,352.49,353.86,355.02,355.89,356.78,358.13,359.84,361.46,363.16,365.32,367.35,368.87,370.47,372.52,374.76,376.81,&
378.81,380.83,382.78,384.80,387.00,389.29,391.56,393.84,396.12,398.40,400.68,402.97,405.25,407.53,409.80,412.07,414.33,416.52,418.60,420.60,422.52,424.35,&
426.10,427.75,429.31,430.78,432.16,433.44,434.59,435.65,436.63,437.52,438.33,439.06,439.69,440.22,440.66,441.02,441.35,441.62,441.86,442.08,442.28,442.46,&
442.60,442.70,442.75,442.76,442.73,442.66,442.55,442.41,442.25,442.08,441.89,441.67,441.42,441.13,440.80,440.43,440.01,439.54,439.05,438.54,438.02,437.48,&
436.92,436.34,435.76,435.18,434.60,434.00,433.38,432.78,432.19,431.62,431.06,430.51,429.96,429.41,428.86,428.30,427.73,427.14,426.57,426.00,425.46,424.94,&
424.43,423.93,423.43,422.93,422.43,421.92,421.40,420.90,420.41,419.95,419.50,419.06,418.62,418.17,417.71,417.25,416.77,416.28,415.80,415.32,414.87,414.42,&
413.99,413.55,413.10,412.64,412.17,411.69,411.19,410.70,410.22,409.76,409.31,408.86,408.42,407.97,407.52,407.07,406.61,406.15,405.69,405.26,404.84,404.45,&
404.07,403.68,403.29,402.90,402.51,402.10,401.69,401.28,400.89,400.53,400.17,399.83,399.49,399.14,398.79,398.43,398.06,397.68,397.31,396.96,396.62,396.30,&
395.99,395.68,395.36,395.03,394.70,394.36,394.00,393.66,393.33,393.02,392.72,392.44,392.14,391.85,391.54,391.23,390.91,390.58,390.26,389.95,389.65,389.38,&
389.11,388.83,388.55,388.27,387.97,387.67,387.35,387.05,386.75,386.48,386.21,385.96,385.70,385.44,385.16,384.88,384.59,384.29,384.00,383.72,383.45,383.20,&
382.96,382.72,382.46,382.20,381.93,381.66,381.37,381.08,380.81,380.56,380.32,380.09,379.86,379.61,379.36,379.11,378.84,378.56,378.29,378.03,377.78,377.56, &
377.33,377.11,376.87,376.63,376.38,376.12,375.85,375.59,375.34,375.11,374.89,374.67,374.45,374.23,373.99,373.75,373.50,373.24,372.98,372.74,372.52,372.30,&
372.10,371.89,371.67,371.44,371.21,370.96,370.71,370.46,370.23,370.01,369.80,369.60,369.40,369.19,368.97,368.74,368.50,368.26,368.02,367.79,367.58,367.38,&
367.18,366.98,366.78,366.57,366.35,366.11,365.87,365.64,365.42,365.21,365.02,364.83,364.64,364.44,364.23,364.02,363.79,363.55,363.32,363.11,362.91,362.72,&
362.54,362.35,362.16,361.95,361.75,361.52,361.29,361.07,360.86,360.67/
DATA RCP_6p0/ 278.05,278.11,278.22,278.34,278.47,278.60,278.73,278.87,279.01,279.15,279.30,279.46,279.62,279.78,279.94,280.10,280.24,280.38,280.52,280.66,&
280.80,280.96,281.12,281.28,281.44,281.60,281.75,281.89,282.03,282.17,282.30,282.43,282.55,282.67,282.79,282.90,283.01,283.11,283.21,283.31,283.40,283.49,&
283.58,283.66,283.74,283.80,283.85,283.89,283.93,283.96,284.00,284.04,284.09,284.13,284.17,284.20,284.22,284.24,284.26,284.28,284.30,284.32,284.34,284.36,&
284.38,284.40,284.39,284.28,284.13,283.98,283.83,283.68,283.53,283.43,283.40,283.40,283.43,283.50,283.60,283.73,283.90,284.08,284.23,284.40,284.58,284.73,&
284.88,285.00,285.13,285.28,285.43,285.58,285.73,285.90,286.08,286.23,286.38,286.50,286.63,286.78,286.90,287.00,287.10,287.23,287.38,287.53,287.70,287.90,&
288.13,288.40,288.70,289.03,289.40,289.80,290.23,290.70,291.20,291.68,292.13,292.58,292.98,293.30,293.58,293.80,294.00,294.18,294.33,294.48,294.60,294.70,&
294.80,294.90,295.03,295.23,295.50,295.80,296.13,296.48,296.83,297.20,297.63,298.08,298.50,298.90,299.30,299.70,300.08,300.43,300.78,301.10,301.40,301.73,&
302.08,302.40,302.70,303.03,303.40,303.78,304.13,304.53,304.98,305.40,305.83,306.30,306.78,307.23,307.70,308.18,308.60,309.00,309.40,309.75,310.00,310.18,&
310.30,310.38,310.38,310.30,310.20,310.13,310.10,310.13,310.20,310.33,310.50,310.75,311.10,311.50,311.93,312.43,313.00,313.60,314.23,314.85,315.50,316.27,&
317.08,317.80,318.40,318.93,319.65,320.65,321.61,322.64,323.90,324.99,325.86,327.14,328.68,329.74,330.59,331.75,333.27,334.85,336.53,338.36,339.73,340.79,&
342.20,343.78,345.28,346.80,348.65,350.74,352.49,353.86,355.02,355.89,356.78,358.13,359.84,361.46,363.16,365.32,367.35,368.87,370.47,372.52,374.76,376.81,&
378.81,380.83,382.78,384.80,386.93,389.07,391.17,393.24,395.30,397.35,399.39,401.42,403.43,405.43,407.40,409.36,411.30,413.22,415.14,417.08,419.04,421.00,&
422.98,424.95,426.92,428.88,430.83,432.81,434.83,436.92,439.07,441.29,443.57,445.90,448.28,450.70,453.15,455.65,458.18,460.76,463.41,466.12,468.91,471.77,&
474.69,477.67,480.70,483.78,486.92,490.10,493.34,496.64,500.02,503.48,507.02,510.63,514.31,518.03,521.80,525.62,529.49,533.40,537.38,541.44,545.59,549.82,&
554.13,558.49,562.87,567.27,571.70,576.15,580.61,585.10,589.65,594.26,598.92,603.54,608.02,612.36,616.57,620.65,624.58,628.38,632.06,635.65,639.14,642.60,&
646.06,649.52,652.95,656.36,659.75,663.11,666.42,669.72,673.02,676.29,679.50,682.65,685.71,688.69,691.59,694.40,697.11,699.73,702.28,704.76,707.20,709.60,&
711.93,714.21,716.40,718.52,720.56,722.51,724.37,726.16,727.90,729.59,731.24,732.85,734.39,735.86,737.26,738.59,739.83,740.99,742.08,743.12,744.13,745.10,&
746.02,746.88,747.68,748.40,749.05,749.62,750.09,750.51,750.87,751.20,751.49,751.74,751.92,752.00 /
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!^
end module data_climate
module data_evapo
! evapotranspiration data
real :: aet = 0. ! daily total actual evapotranspiration / mm
real :: aet_cum = 0. ! yearly total actual evapotranspiration / mm
real :: aet_m = 0. ! mean yearly total actual evapotranspiration / mm
real :: pet = 0. ! daily total potential evapotranspiration / mm
real :: pet_cum = 0. ! yearly total potential evapotranspiration / mm
real :: pet_m = 0. ! mean yearly total potential evapotranspiration / mm
real :: pev_s = 0. ! potential evaporation of soil / mm
real :: pev_sn = 0. ! potential evaporation of snow / mm
real :: dew_rime = 0. ! dew or rime resp. / mm
real :: dew_cum = 0. ! yearly total dew or rime resp. / mm
real :: dew_m = 0. ! mean yearly total dew or rime resp. / mm
real :: trans_dem = 0. ! potential transpiration / mm
real :: trans_tree= 0. ! actual transpiration of trees / mm
real :: trans_sveg= 0. ! actual transpiration of ground vegetation / mm
real :: tra_tr_cum= 0. ! yearly transpiration of trees / mm
real :: tra_sv_cum= 0. ! yearly transpiration of ground vegetation / mm
real :: aev_s = 0. ! actual evaporation of soil / mm
real :: aev_i = 0. ! actual evaporation of intercepted water / mm
real :: demand_mistletoe_cohort = 0. ! helping variable: transfer of mistletoe demand from evapo.f to soil.f
REAL, dimension(12) :: aet_mon ! monthly actual evapotranspiration sum / mm
REAL, dimension(53) :: aet_week ! weekly actual evapotranspiration sum / mm
REAL, dimension(12) :: pet_mon ! monthly potential evapotranspiration sum / mm
REAL, dimension(53) :: pet_week ! weekly potential evapotranspiration sum / mm
real :: Rnet_cum = 0. ! net radiation J/cm²
integer:: unit_eva
end module data_evapo
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
module data_inter
! interception data
real :: interc_can = 0. ! total daily canopy interception / mm
real :: int_st_can = 0. ! canopy interception storage / mm
real :: int_cum_can = 0. ! cumulative canopy interception / mm
real :: interc_m_can = 0. ! mean yearly canopy interception / mm
real :: prec_stand = 0. ! stand precipitation / mm
real :: prec_stand_red= 0. ! reduction of stand precipitation by percentage (drought experiments) / %
real :: interc_sveg = 0. ! total daily interception of ground vegetation / mm
real :: int_st_sveg = 0. ! interception storage of ground vegetation / mm
real :: int_cum_sveg = 0. ! cumulative interception of ground vegetation / mm
real :: interc_m_sveg= 0. ! mean yearly interception of ground vegetation / mm
real :: stem_flow = 0. ! stem flow / mm
logical:: lint_snow = .false. ! interception of snow = .true.
end module data_inter
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
module data_depo
! deposition data
real,allocatable,save,dimension(:,:) :: NHd, NOd ! input fields / mg N/m2
real :: NH_dep = 0. ! deposition of NHx-N / g N/m2
real :: NO_dep = 0. ! deposition of NOx-N / g N/m2
real :: Ndep_cum = 0. ! yearly cumulative deposition / g N/m2
real :: Ndep_cum_all = 0. ! overall mean yearly deposition / g N/m2
end module data_depo
!*****************************************************************!
!* *!
!* 4C (FORESEE) Simulation Model *!
!* *!
!* environmental variables and indices *!
!* *!
!* containes: *!
!* DATA_BIODIV *!
!* DATA_FROST *!
!* *!
!* Copyright (C) 1996-2018 *!
!* Potsdam Institute for Climate Impact Reserach (PIK) *!
!* Authors and contributors see AUTHOR file *!
!* This file is part of 4C and is licensed under BSD-2-Clause *!
!* See LICENSE file or under *!
!* http://www.https://opensource.org/licenses/BSD-2-Clause *!
!* Contact: *!
!* https://gitlab.pik-potsdam.de/foresee/4C *!
!* *!
!*****************************************************************!
module data_biodiv
! indices of fire and biodiversity
! sum of hot days (Tmax>=25°C) and precipitation sum in the potential fire period
integer :: Ndayshot
real :: Psum_FP
integer :: prec_flag1 = 0 ! flag is equal 1 if first time precipitation of 5 mm occurs after bud burst of birch
integer :: prec_flag2 = 0
real :: ntindex ! temperature index
! fire risk
integer :: fire_indw = -99 ! fire index west
integer :: fd_fire_indw(1:5) = 0 ! frequency distribution of fore index west values
integer :: fire_inde = -99 ! fire index east
integer :: fire_indi_day = 0 ! days with forest fire indicator greater then a threshold (east)
real :: fire_indi = 0.0 ! forest fire indicator (east)
real :: fire_indi_max = 0.0 ! maximum forest fire indicator (east)
real :: fire_indb = -99 ! fire index Bruschek
real :: fire_indb_m = -99 ! mean yearly fire index Bruschek of simulation period
real :: tsumrob ! temperature sum 'Robinie'
real :: day_bb_rob = 0 ! day of budburst 'Robinie'
real :: tsumbi ! temperature sum birch
real :: day_bb_bi = 0 ! day of budburst birch
integer :: day_nest = 0 ! days since the last prec. greater then 3 mm (Nesterov)
real :: p_nest = 0.0 ! ignition index of Nesterov
type fire_risk
integer :: index ! daily fire risk level
integer, dimension (5):: frequ ! frequency of of fire risk levels (5 classes) of a year
real :: mean ! mean fire risk level of a year
real :: mean_m ! mean yearly fire risk level of simulation period
end type fire_risk
type (fire_risk),dimension(3) :: fire ! 1 - fire index west
! 2 - fire index east (M68 international)
! 3 - fire index Nesterov
! upper limit of climatic water balance for fire risk class (west)
real, dimension(4,7) :: risk_class
DATA risk_class &
/ 5., -3., -9., -15., & ! march
3., -8., -16., -27., & ! april
-3., -16., -25., -35., & ! may
-12., -24., -32., -41., & ! june
-12., -24., -31., -40., & ! july
-8., -20., -28., -37., & ! august
-6., -18., -26., -35./ ! september
integer, dimension(38) :: daybb_rob
integer, dimension(38) :: daybb_bi
DATA daybb_bi/100,114,115,113,120,115,111,109,123,124,113,110,119,99,117,117,118,117,120,124,101,117,113,117,112,119,116,112, &
102,92,106,109,109,110,111,112,112,101/
DATA daybb_rob/152,165,156,151,166,148,153,153,160,163,151,161,160,163,159,161,162,158,153,163,153,153,154,159,151,152,166,154, &
147,143,168,145,135,148,151,155,155,138/
end module data_biodiv
module data_frost
integer, allocatable, save, dimension(:) :: dnlf ! number of days with late frost during vegetation period
real, allocatable, save, dimension (:) :: tminmay_ann ! minimum temperature in may
integer, allocatable, save, dimension(:) :: date_lf ! date of last frost after start of vegetation period per year
integer, allocatable, save, dimension(:) :: date_lftot ! annual date of last frost event
integer, allocatable, save, dimension(:) :: anzdlf ! number of days with frost from April until June
integer, allocatable, save, dimension(:) :: sumtlf ! sum of temperature of days with frost from April until June
integer :: dlfabs ! number of day of the last frost for the whole simulation period
real :: tminmay ! minimum temperature of may of the whole simulation period
integer, allocatable, save, dimension(:) :: dnlf_sp ! number of day with late frost during vegetation period
integer :: dlfabs_sp ! number of day of the last frost for the whole simulation period
real :: tminmay_sp ! minimum temperature of may of the whole simulation period
real :: temp_frost = 0. ! temperature threshold of frost
integer :: lfind ! last frost index
real :: mlfind ! mean lfind
integer :: maxlfind ! maximum value of 5 part inidces
integer :: lfind_sp ! last frost index birch
integer :: maxlfind_sp ! last frost index beech
real :: mlfind_sp ! mean lfind
integer :: taxnum
end module data_frost
!*****************************************************************!
!* *!
!* 4C (FORESEE) Simulation Model *!
!* *!
!* *!
!* data module *!
!* data_help *!
!* data_help_dbh *!
!* *!
!* Copyright (C) 1996-2018 *!
!* Potsdam Institute for Climate Impact Reserach (PIK) *!
!* Authors and contributors see AUTHOR file *!
!* This file is part of 4C and is licensed under BSD-2-Clause *!
!* See LICENSE file or under: *!
!* http://www.https://opensource.org/licenses/BSD-2-Clause *!
!* Contact: *!
!* https://gitlab.pik-potsdam.de/foresee/4C *!
!* *!
!*****************************************************************!
Module data_help
integer :: hnspec=0 ! species number
real :: mschelp ! weight of seed class
real ::heihelp ! height of plant class
REAL :: x_sap,x_hrt,x_fol,x_frt,x_Ahb !inital values for cohorts
integer :: fail
end module data_help
module data_help_dbh
! for function in calc_dbh
real :: fAhb = 0., & ! cross sectional area heartwood at tree base
fB = 0., & ! bole height,
fH = 0., & ! heartwood
fHt = 0., & ! total tree height
fsprhos
end module data_help_dbh
!*****************************************************************!
!* *!
!* 4C (FORESEE) Simulation Model *!
!* *!
!* *!
!* module data_init *!
!* declaration of variables for additional information *!
!* used during initialisation *!
!* *!
!* Copyright (C) 1996-2018 *!
!* Potsdam Institute for Climate Impact Reserach (PIK) *!
!* Authors and contributors see AUTHOR file *!
!* This file is part of 4C and is licensed under BSD-2-Clause *!
!* See LICENSE file or under: *!
!* http://www.https://opensource.org/licenses/BSD-2-Clause *!
!* Contact: *!
!* https://gitlab.pik-potsdam.de/foresee/4C *!
!* *!
!*****************************************************************!
MODULE data_init
IMPLICIT NONE
INTEGER :: spec_nrDSW(120) ! species ordinal number in DSW according to BRA
INTEGER :: spec_nrBAY(120) ! species ordinal number in Bavaria
INTEGER :: spec_4C(120) ! species code number of 4C assigned to DSW species
CHARACTER (3) :: spec_code(120) ! specifies three letter code in DSW according to BRA
CHARACTER (50) :: GER_name(120) ! german name
CHARACTER (50) :: LAT_name(120) ! scientific, latin name
CHARACTER (50) :: ENG_name(120) ! english name
INTEGER :: spnum_for_DSW(800) ! species ordinal number (1..120) for DSW in element of vector
! which corresponds to species number according to BRA
! variables for treatment of DSW initialisation data
TYPE group_vec
INTEGER :: locid ! ID for stand
INTEGER :: taxid ! 4C species number
INTEGER :: BRAid ! DSW species code
INTEGER :: alter
INTEGER :: baumzahl
INTEGER :: schicht ! 10 = upper storey trees/Oberstand, 20 = retention trees/berhlter, 40 = understorey 50 = selction/plenter forest/ plenterartig
REAL :: dm
REAL :: mhoe
REAL :: gf
REAL :: patchsize
REAL :: standsize
REAL :: volume
END TYPE group_vec
TYPE(group_vec), DIMENSION(:), ALLOCATABLE :: ngroups
! variables for plenterwald initialisation
INTEGER, DIMENSION(4) :: low_age, high_age
! Parameter for volume functions provided by Eberswalde
REAL, DIMENSION (10,3) :: parEBW
! Parameter Pine (Kiefer) EBERSWALDE
DATA parEBW(10,1:3)/-9.780614,1.96047,0.89443/
! Parameter Ponderosa pine taken equal to Pine (Kiefer) EBERSWALDE
DATA parEBW(10,1:3)/-9.780614,1.96047,0.89443/
! Parameter for volume function adapted from SILVA
REAL, dimension (11,9) :: par_S
! Paramter Fichte/spruce SILVA
DATA par_S(2,1:9)/-3.59624,1.80213,-0.288243, 1.06247, -0.128993, 0.0353434, 0.142264, -0.058259, 0.00459854/
! Parameter Buche/beech SILVA
DATA par_S(1,1:9)/-2.7284,0.837563,-0.105843,1.62283,-0.214812,0.0289272,-0.0879719,0.0325667,-0.00446295/
! Parameter Eiche/oak SILVA
DATA par_S(4,1:9)/-3.06118,1.45506,-0.19992,1.93898,-0.689727,0.112653,-0.165102,0.120127,-0.0202543/
! Parameter Kiefer/ pine SILVA
DATA par_S(3,1:9)/-5.80915,3.387,-0.494392,3.67116,-1.83211,0.273999,-0.459282,0.29989,-0.0444931/
! Parameter Birke/birch SILVA = Weichlaub
DATA par_S(5,1:9)/-5.98031,2.65905,-0.3374,3.78395,-1.47318,0.188661,-0.540955,0.296957,-0.0385165/
! Parameter Pinus contorta (von Kiefer)
DATA par_S(6,1:9)/ -5.80915,3.387,-0.494392,3.67116,-1.83211,0.273999,-0.459282,0.29989,-0.0444931/
! Parameter Pinus ponderosa (von Kiefer)
DATA par_S(7,1:9)/ -5.80915,3.387,-0.494392,3.67116,-1.83211,0.273999,-0.459282,0.29989,-0.0444931/
! parameter Populus tremula
DATA par_S(8,1:9)/ -5.98031,2.65905,-0.3374,3.78395,-1.47318,0.188661,-0.54095500,0.296957,-0.03851650/
! parameter Robinie( black locust)
DATA par_S(11,1:9)/-2.7284,0.837563,-0.105843,1.62283,-0.214812,0.0289272,-0.0879719,0.0325667,-0.00446295/
END ! module data_init
!*****************************************************************!
!* *!
!* 4C (FORESEE) Simulation Model *!
!* *!
!* *!
!* data module management SR *!
!* *!
!* Copyright (C) 1996-2018 *!
!* Potsdam Institute for Climate Impact Reserach (PIK) *!
!* Authors and contributors see AUTHOR file *!
!* This file is part of 4C and is licensed under BSD-2-Clause *!
!* See LICENSE file or under: *!
!* http://www.https://opensource.org/licenses/BSD-2-Clause *!
!* Contact: *!
!* https://gitlab.pik-potsdam.de/foresee/4C *!
!* *!
!*****************************************************************!
module data_manag
real :: basarea_tot ! total basal area
real :: tardiam_dstem=15. ! diameter target for dead stems to C_opm_stems
integer :: thin_type ! type of management scenario
integer :: thin_nr ! Number of thinnings (years with management actions)
integer :: act_thin_year ! year field index of thinning
integer :: target_type ! type of thinning in case of target thinning
integer,allocatable,save,dimension(:) :: thin_year ! Field of management years
integer,allocatable,save,dimension(:) :: thin_age ! stand age of target thinning
integer,allocatable,save,dimension(:) :: thin_tree ! number of remaining stems after thinning
integer,allocatable,save,dimension(:) :: thin_spec ! species number for thinning (target)
integer,allocatable,save,dimension(:) :: thin_tysp ! type of thinning (for target thinning)
real, allocatable,save,dimension(:) :: target_mass ! target value of stem mass
integer,allocatable,save,dimension(:) :: thinyear ! year of last thinning
integer, allocatable, save, dimension(:) :: thin_stor ! information of storey which hase to manage
real,allocatable,save,dimension(:) :: np_mod ! multiplier for 'Nutzungsprozent'
integer :: thin_dead = 0 ! 0 dead stembiomass is accumulated in litter pools
! 1 dead stem biomass is removed as harvested
integer :: domspec ! dominant species of initialised stnad for management
integer :: domspec_reg ! dominant species of regenerated/planted stand after clear cut/shelterwood
real :: stump_sum= 0
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! thinning types
! 1 - Niederdurchforstung (mäßig) low thinning ( moderate)
! 2 - Niederdurchforstung (stark) low thinning (heavy)
! 3 - Hochdurchforstung crown thinning
! 4 - Auslesedurchforstung selective thinning
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
real :: ho1=0. ! dominant height first thinning
real :: ho2=0. ! dominant height second thinning
real :: ho3=0. ! dominant height third thinning
real :: ho4=0. ! dominant height fourth thinning
integer :: thr1=0 ! thinning regime for ho2
integer :: thr2=0 ! thinning regime for ho3
integer :: thr3=0 ! thinning regime for ho4
integer :: thr4=0 ! thinning regime for ho>ho4
integer :: thr5=0 ! 'Rückegassen'
real :: thr6=0. ! if thr5=1 this flag control time of realization =ho1,ho2,ho3 or ho4
integer :: thr7=0 ! management regime for rotation year
integer :: mgreg=0 ! regeneration, natural/artificial
integer :: thin_ob ! control of optimal basal area thinning, =1 yes, =0 no
real :: optb= 1. ! optimal 'Bestockungsgrad'
integer :: thinonce =0 ! special case of managemnet for only one single management activity; default=0
integer, allocatable,save,dimension(:) :: thin_flag1 ! aux. varaibles for adaptive management
integer, allocatable,save,dimension(:) :: thin_flag2
integer, allocatable,save,dimension(:) :: thin_flag3
integer, allocatable,save,dimension(:) :: thin_flag4
real, allocatable, save, dimension(:) :: zbnr ! number of 'Zielbäume'/target trees
real, allocatable, save, dimension(:) :: tend ! percentage of young tree tending/'tending of plantations'
integer, allocatable,save,dimension(:) :: rot ! rotation
integer, allocatable, save, dimension(:) :: regage ! age of natural/planted regeneration
integer :: flag_direct=0 !
integer :: thinstep=0 ! number of years between thinning if ho>ho4
integer :: flag_brush=1 ! defaul, if 1 then all harvested stems remain in the litter and are not removed from the stand
integer :: cutyear =0 ! year of cutting
real :: direcfel=0. ! percentage display of 'Rückegassen' creation 'directional felling'
real :: limit=0. ! limit für hight query (+- range)
integer :: shelteryear=0 ! year of last shelterwood mang.
integer :: stand_age =0 ! age of stand
integer :: flag_manreal=0 ! management no/yes
integer :: flag_shelter = 0! shelterwood management started
integer :: flag_sh_first=0 ! aux variable for the case age(1) > regage and age(1)> rotage-20
integer :: flag_plant_shw = 0 ! flag for planting in specieal case trhat initial age is > rot-20
character(30) :: maninf ! description of measure
integer :: meas ! flag of measure
! parameter for thinning depending on age ang stand density : percent of using
real, dimension(20,20) :: usp
! multi-species management
integer,allocatable,save,dimension(:) :: specnr, age_spec,anz_tree_spec
! Austrian management
integer,dimension(10) :: num_rel_cl ! number of relative diameter classes
integer :: num_man ! total numbe rof management treatments
integer, allocatable, save, dimension(:) :: yman ! years of management for each species
integer, allocatable, save, dimension(:) :: dbh_clm ! number of relative dbh class wihich is used for thinning
integer, allocatable, save, dimension(:) :: spec_man ! number of species for treatment
real, allocatable, save, dimension(:) :: rem_clm ! removal of biomass
integer, allocatable, save, dimension(:) :: act ! activity flag
real, allocatable,save, dimension(:) :: rel_part ! mixture flag for planting
! disturbance management
integer, allocatable, save, dimension(:) :: dis_id ! number of standid with disturbance
integer :: dis_row_nr ! the total number of disturbance events (line number of disturbance section)
integer, dimension(1:6,1:2) :: dis_control ! array which is used to control the dirsturbance simulation (dim1=disturbance type(D,X,P,R,S), dim2=zeile man-file)
character(1), allocatable, save, dimension(:) :: dis_type ! disturbance type D - defoliator, X - xylem clogger, P - phloem feeder
! R - root pathogen or feeder, S - stem rot
integer, allocatable, save, dimension(:) :: fortype ! forest type 1 managed forest, 2 - naturla forest
integer, allocatable, save, dimension(:) :: dis_year ! date of disturbance
integer, allocatable, save, dimension(:) :: dis_spec ! disturbed tree species
integer, allocatable, save, dimension(:) :: dis_start ! start of disturbance within year
real, allocatable, save, dimension(:) :: dis_rel ! relative value of disturbed area
real, allocatable,save, dimension(:) :: sum_dis ! accumulated value of disturbed area (relative), for each standid
real, allocatable, save, dimension(:) :: dis_year_id ! year of last disturbance for each standid
integer ::dis_number
integer :: count_dis_real =0 ! counter for realised disturbances
! aspen managment
integer :: nsprout = 3 ! number of sprouts per tree
integer :: flag_sprout = 0 ! 0 - sprouting 1-if sprouts exist
! liocourt management
real :: dbh_max ! maximum diameter
real :: lic_a ! parameter a of licourt function
real :: lic_b ! parameter b of licourt function
real :: thin_proc ! volume removal percent
integer :: spec_lic ! species number für li management
integer :: thin_int ! thinning interval
integer, dimension(22,11) :: ntree_lic ! filed for calculation of licourt function for species i and diamter class j
end module data_manag
!*****************************************************************!
!* *!
!* 4C (FORESEE) Simulation Model *!
!* *!
!* *!
!* data module for statistics with observed and simulated values *!
!* *!
!* Copyright (C) 1996-2018 *!
!* Potsdam Institute for Climate Impact Reserach (PIK) *!
!* Authors and contributors see AUTHOR file *!
!* This file is part of 4C and is licensed under BSD-2-Clause *!
!* See LICENSE file or under: *!
!* http://www.https://opensource.org/licenses/BSD-2-Clause *!
!* Contact: *!
!* https://gitlab.pik-potsdam.de/foresee/4C *!
!* *!
!*****************************************************************!
module data_mess
character(150):: dirmess = 'mess/' ! directory of files with measurements
integer:: anz_mesf = 1 ! amount of measurement files
character(150),allocatable,dimension(:) :: mesfile ! name of files with measurements
logical:: flag_mess ! TRUE: measurements within the simulation period / FALSE: no measurements
integer:: unit_cons ! console unit
integer:: unit_stat ! output unit for statistical analysis
integer:: unit_mess = -99 ! unit of file with measurements
integer:: unit_mout = -99 ! output unit of file with measurements and residuals
integer unitday, unitsum, unitlit, unittemp, unitwater, unitsoil, unitsoilini, unitcbal, &
unitveg, unitveg_pi, unitveg_sp, unitveg_bi
integer,allocatable,save,dimension(:) :: unit_mon ! array of output unit numbers for monthly values
integer,allocatable,save,dimension(:) :: unit_mon_stat ! array of output unit numbers for statistics of monthly values
integer imkind, & ! amount of read maesurement value typs
tkind, & ! chronological resolution of measurement values( 1 - Tage
! 2 - Jahre)
imess, & ! amount of read measuerment values
anz_val, & ! amount of filled in measurement values
imk_nme, & ! amount of measurment numbers for mean value calculation NME
imk_nmae, & ! amount of measure numbers for mean value calculation NMAE
imk_nrmse, & ! amount of measure numbers for mean value calculation NRMSE
imk_rsq ! amount of measure numbers for mean value calculations RSQ
real,allocatable,dimension(:,:):: mess1, mess2, sim1, help2
integer,allocatable,dimension(:,:):: mtz ! arry for dates of measurements: day of the year, year
integer,allocatable,dimension(:,:):: help1, stz
integer,allocatable,dimension(:):: app
real:: &
nme_av, & ! Average normalised mean error
nmae_av, & ! Average normalised mean absolut error
nrmse_av, & ! Average normalised root mean square error
pme_av, & ! Average mean precental error
prmse_av, & ! Average mean squared percental error
tic_av, & ! Average Theil's inequality coefficient
meff_av, & ! Average modell efficiency
rsq_av ! Average coefficient of determination
type res_struct
character(15) :: mkind ! measurement value type
integer :: imes ! amount of measurement value
integer :: tkind ! chronological resolution of measurement values
integer,pointer,dimension(:):: day, year
real,pointer,dimension(:) :: resid
real,pointer,dimension(:) :: sim
real,pointer,dimension(:) :: mess
end type res_struct
type (res_struct),allocatable,dimension(:),target :: val
integer:: ikind = 50 ! amount of allowed measurement value types
integer:: fkind = 0 ! amount of not defined measurement value types
character(10), dimension(50):: sim_kind
integer, dimension(80):: mpos1, mpos2 ! position of measurement value in input file
integer, dimension(80):: spos1, spos2 ! position of variables in simulations output
integer, dimension(80):: opos1, opos2 ! position of variables in simulation output file
end module data_mess
!**************************************************************