I am using a Basic MSI My company hasrequested that I display the license agreement, and make the user scroll all of the way to the bottom before I can enable the Next button.
The only way I could think of to do this was to create something in C++, but that would be very comlicated.
Has anyone got any other ideas on how you could attack this?
This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
License Agreement - wait for user click
Started by
luke_s
, Jul 18 2003 05:39
3 replies to this topic
Posted 24 July 2003 - 10:44
Luke, I also have this requirement. Have you found a way to address this yet,
Simon
Simon
Posted 24 July 2003 - 12:47
Sajan, from the msi newsgroups posted me some c-code that finds the window, and scroll bar control.
I will post this code so that you can look at it.
I will post this code so that you can look at it.
Posted 25 July 2003 - 07:12
BOOL CALLBACK EnumChildProc(HWND hwnd,LPARAM lParam)
{
TCHAR buf[100];
GetClassName( hwnd, (LPTSTR)&buf, 100 );
if ( _tcscmp( buf, _T("RichEdit20W") ) == 0 )
{
*(HWND*)lParam = hwnd;
return FALSE;
}
return TRUE;
}
UINT __stdcall checkIfLicenseViewed(MSIHANDLE ihnd)
{
HWND hWnd;
HWND hWndChild=NULL;
DWORD ret,size;
SCROLLINFO scrollInfo;
UINT max_pos,current;
int iPos = 0;
int linecount = 0;
hWnd = FindWindow(NULL, "LicenseScreen");
if (hWnd)
{
EnumChildWindows( hWnd, EnumChildProc, (LPARAM)&hWndChild );
if ( hWndChild )
{
/*
** Find the max scroll position and take of
** one page length -5, this leaves a bit of
** overlap for user scroll.
*/
ZeroMemory(&scrollInfo,sizeof(SCROLLINFO));
scrollInfo.cbSize = sizeof(SCROLLINFO);
scrollInfo.fMask = SIF_ALL;
GetScrollInfo(hWndChild,SB_VERT,&scrollInfo);
max_pos = scrollInfo.nMax - scrollInfo.nPage - 5;
current = GetScrollPos(hWndChild,SB_VERT);
if (scrollInfo.nPos >= max_pos)
MsiSetProperty(ihnd, TEXT("LICENSE_VIEWED"), "1");
else
MsiSetProperty(ihnd, TEXT("LICENSE_VIEWED"), "0");
}
}
return ERROR_SUCCESS;
}
{
TCHAR buf[100];
GetClassName( hwnd, (LPTSTR)&buf, 100 );
if ( _tcscmp( buf, _T("RichEdit20W") ) == 0 )
{
*(HWND*)lParam = hwnd;
return FALSE;
}
return TRUE;
}
UINT __stdcall checkIfLicenseViewed(MSIHANDLE ihnd)
{
HWND hWnd;
HWND hWndChild=NULL;
DWORD ret,size;
SCROLLINFO scrollInfo;
UINT max_pos,current;
int iPos = 0;
int linecount = 0;
hWnd = FindWindow(NULL, "LicenseScreen");
if (hWnd)
{
EnumChildWindows( hWnd, EnumChildProc, (LPARAM)&hWndChild );
if ( hWndChild )
{
/*
** Find the max scroll position and take of
** one page length -5, this leaves a bit of
** overlap for user scroll.
*/
ZeroMemory(&scrollInfo,sizeof(SCROLLINFO));
scrollInfo.cbSize = sizeof(SCROLLINFO);
scrollInfo.fMask = SIF_ALL;
GetScrollInfo(hWndChild,SB_VERT,&scrollInfo);
max_pos = scrollInfo.nMax - scrollInfo.nPage - 5;
current = GetScrollPos(hWndChild,SB_VERT);
if (scrollInfo.nPos >= max_pos)
MsiSetProperty(ihnd, TEXT("LICENSE_VIEWED"), "1");
else
MsiSetProperty(ihnd, TEXT("LICENSE_VIEWED"), "0");
}
}
return ERROR_SUCCESS;
}