23 #define NONAMELESSUNION 45 #include "msiserver.h" 135 #define WM_MSI_DIALOG_CREATE (WM_USER+0x100) 136 #define WM_MSI_DIALOG_DESTROY (WM_USER+0x101) 138 #define USER_INSTALLSTATE_ALL 0x1000 253 if( *
p !=
'\\' && *
p !=
'&' )
257 for(
i=++
p;
i<
q;
i++ )
258 if( *
i ==
'}' || *
i ==
'\\' )
293 memset( &lf, 0,
sizeof lf );
430 TRACE(
"Dialog %s control %s hwnd %p\n",
448 if (!rec)
return NULL;
539 memset( &tvi, 0,
sizeof tvi );
576 if (text_fmt)
text = text_fmt;
593 TRACE(
"progress: func %lu val1 %lu val2 %lu\n",
func, val1, val2 );
610 ctrl->progress_current = 0;
616 if (val2)
dialog->package->action_progress_increment = val1;
617 else dialog->package->action_progress_increment = 0;
620 if (
ctrl->progress_backwards)
623 else ctrl->progress_current = 0;
628 else ctrl->progress_current =
ctrl->progress_max;
636 FIXME(
"unknown progress message %lu\n",
func );
674 TRACE(
"already subscribed\n");
678 if (!(sub =
msi_alloc(
sizeof(*sub) )))
return;
712 L"SELECT * FROM `EventMapping` WHERE `Dialog_` = '%s' AND `Control_` = '%s'",
853 while (*
p && *
p !=
'{')
p++;
854 if (!*
p++)
return text;
856 while (*
p && *
p !=
'}')
p++;
857 if (!*
p++)
return text;
873 if (
p && (
p[1] == 0 ||
p[1] ==
' '))
881 else ERR(
"Badly formatted property string - what happens?\n");
932 L"SELECT * FROM `ControlEvent` WHERE `Dialog_` = '%s' AND `Control_` = '%s' ORDER BY `Ordering`",
936 ERR(
"query failed\n");
943 if (
dialog->pending_event)
956 HBITMAP hOleBitmap = 0,
hBitmap = 0, hOldSrcBitmap, hOldDestBitmap;
974 IStream_Release( stm );
977 ERR(
"failed to load picture\n");
981 r = IPicture_get_Handle( pic, (
OLE_HANDLE *)&hOleBitmap );
984 ERR(
"failed to get bitmap handle\n");
992 ERR(
"failed to get bitmap size\n");
1007 StretchBlt( destdc, 0, 0,
cx,
cy, srcdc, 0, 0, bm.bmWidth, bm.bmHeight,
SRCCOPY );
1014 if (pic) IPicture_Release( pic );
1107 return state[0] ? 1 : 0;
1228 TRACE(
"Dialog %s control %s hwnd %p\n",
1441 for (
j = 0;
j <
info->num_items;
j++)
1465 info->addpos_items++;
1477 L"SELECT * FROM `ComboBox` WHERE `Property` = '%s' ORDER BY `Order`",
property );
1588 for (
j = 0;
j <
info->num_items;
j++)
1645 info->addpos_items = 0;
1675 #define MAX_NUM_DIGITS 11 1718 #define MASK_MAX_GROUPS 20 1760 for(
i=0,
n=0;
i<
info->num_groups;
i++ )
1762 if (
info->group[
i].len == ~0
u)
1770 if (
info->group[
i].len +
n >
info->num_chars)
1772 ERR(
"can't fit control %d text into template\n",
i);
1777 for(
r=0;
r<
info->group[
i].len;
r++)
1784 if(
r !=
info->group[
i].len )
1791 TRACE(
"%d/%d controls were good\n",
i,
info->num_groups);
1793 if(
i ==
info->num_groups )
1808 for(
i=0;
i<
info->num_groups;
i++ )
1813 if(
i >= (
info->num_groups-1) )
1863 for(
i = 0;
i <
info->num_groups;
i++ )
1905 if(
p[0] == 0 ||
p[0] ==
'>' )
1910 info->group[0].type =
'&';
1911 info->group[0].len = ~0
u;
1918 for(
n=0;
p[
n] ==
p[0];
n++ )
1921 info->group[
i].type =
p[0];
1937 info->num_groups =
i;
1957 for(
i = 0;
i <
info->num_groups;
i++ )
1961 if (
info->num_chars)
1975 ERR(
"failed to create mask edit sub window\n");
2006 WARN(
"mask template is empty\n");
2023 ERR(
"Failed to create maskedit container\n");
2238 group->parent->hwnd );
2317 r =
MSI_OpenQuery( package->db, &
view,
L"SELECT * FROM `RadioButton` WHERE `Property` = '%s'", prop );
2320 ERR(
"query failed for dialog %s radio group %s\n",
2326 group.parent = control;
2420 package = info->dialog->package;
2425 ERR(
"item %p feature was NULL\n",
hItem);
2517 memset( &tvis, 0,
sizeof tvis );
2536 if (
feature->Display % 2 != 0 )
2542 info->selected = hfirst;
2547 const int bm_width = 32, bm_height = 16, bm_count = 3;
2548 const int bm_resource = 0x1001;
2556 ERR(
"failed to create image list\n");
2560 for (
i=0;
i<bm_count;
i++)
2565 ERR(
"failed to load bitmap %d\n",
i);
2727 for (
j = 0;
j <
info->num_items;
j++)
2751 info->addpos_items++;
2762 L"SELECT * FROM `ListBox` WHERE `Property` = '%s' ORDER BY `Order`",
property );
2834 info->addpos_items = 0;
2917 if ( !
wcscmp( wfd.cFileName,
L"." ) || !
wcscmp( wfd.cFileName,
L".." ) )
2924 item.pszText = wfd.cFileName;
3020 switch (nmhdr->
code)
3036 ERR(
"no list-view item selected\n");
3121 L"VolumeCostVolume",
3123 L"VolumeCostAvailable",
3124 L"VolumeCostRequired",
3125 L"VolumeCostDifference",
3189 total_cost += ((
LONGLONG)each_cost) * 512;
3195 total_cost -= ((
LONGLONG)each_cost) * 512;
3216 if ( !
size )
return;
3219 if ( !drives )
return;
3241 difference =
free.QuadPart - cost;
3244 lvitem.iSubItem = 1;
3245 lvitem.pszText = size_text;
3246 lvitem.cchTextMax =
lstrlenW(size_text) + 1;
3250 lvitem.iSubItem = 2;
3251 lvitem.pszText = size_text;
3252 lvitem.cchTextMax =
lstrlenW(size_text) + 1;
3255 lvitem.iSubItem = 3;
3256 lvitem.pszText = cost_text;
3257 lvitem.cchTextMax =
lstrlenW(cost_text) + 1;
3261 lvitem.iSubItem = 4;
3262 lvitem.pszText = size_text;
3263 lvitem.cchTextMax =
lstrlenW(size_text) + 1;
3307 ERR(
"No ComboBox item selected!\n");
3328 if ( !
size )
return;
3331 if ( !drives )
return;
3383 while (*
p && *
p !=
'<')
p++;
3396 if (*
p ==
'\"' || *
p ==
'\'')
quote = *
p++;
3434 else item.szUrl[0] = 0;
3488 if (
MSI_OpenQuery(
dialog->package->db, &
view,
L"SELECT * FROM `ListView` WHERE `Property` = '%s' ORDER BY `Order`",
3527 col.cx = rc.
right - 16;
3623 memset( &lf, 0,
sizeof lf );
3675 center.
x =
MulDiv( center.
x, xres, 100 );
3676 center.
y =
MulDiv( center.
y, yres, 100 );
3679 if (
dialog->package->center_x &&
dialog->package->center_y)
3681 pos->left =
dialog->package->center_x - sz.
cx / 2.0;
3683 pos->top =
dialog->package->center_y - sz.
cy / 2.0;
3688 pos->left = center.
x - sz.
cx/2;
3690 pos->top = center.
y - sz.
cy/2;
3694 dialog->package->center_x = center.
x;
3695 dialog->package->center_y = center.
y;
3709 struct list tab_chain;
3716 dialog->hWndFocus = control->hwnd;
3721 if (!control->tabnext)
break;
3730 prev = control->hwnd;