Click here to Skip to main content
15,909,325 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Scroll bars in an Explorer Bar? Pin
mahesh31-May-00 8:00
mahesh31-May-00 8:00 
GeneralRe: Scroll bars in an Explorer Bar? Pin
mahesh1-Jun-00 4:22
mahesh1-Jun-00 4:22 
GeneralCFileDialog does not open Pin
Member 135631-May-00 2:42
Member 135631-May-00 2:42 
GeneralRe: CFileDialog does not open Pin
Brigg Thorp1-Jun-00 1:45
Brigg Thorp1-Jun-00 1:45 
GeneralRe: CFileDialog does not open Pin
Blake Miller4-Jun-00 15:08
Blake Miller4-Jun-00 15:08 
GeneralRe: CFileDialog does not open Pin
Member 13564-Jun-00 23:59
Member 13564-Jun-00 23:59 
GeneralRe: CFileDialog does not open Pin
Member 13565-Jun-00 0:13
Member 13565-Jun-00 0:13 
GeneralATL com Web Browser Component Pin
Aruna Reddy30-May-00 19:12
Aruna Reddy30-May-00 19:12 
I am creating a WebBrowser Control using ATL com Lite Html control. I am trying to add scroll bars to my control.The Scrolling is not depending on the hTML page size.it is not scrolling for the length of the page. How can I get The page size. The code i am using is
LRESULT OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
CAxWindow wnd(m_hWnd);
HRESULT hr = wnd.CreateControl(IDH_BROWSER);
long dwStyle=wnd.GetWindowLong(GWL_STYLE);
wnd.SetWindowLong(GWL_STYLE,dwStyle | WS_HSCROLL | WS_VSCROLL);
if (SUCCEEDED(hr))
hr = wnd.SetExternalDispatch(static_cast<ibrowserui*>(this));
if (SUCCEEDED(hr)) {
hr = wnd.QueryControl(IID_IWebBrowser2, (void**)&m_spBrowser);
_bstr_t path("www.yahoo.com");
m_spBrowser->put_StatusBar(true);
m_spBrowser->Navigate(path,NULL,NULL,NULL,NULL);
}
m_nHscrollPos = 0;
m_nVscrollPos = 0;

// Get the initial dimensions of the dialog
::GetClientRect(m_hWnd,&m_ClientRect);
m_bInitialized = TRUE;
}
LRESULT OnHScroll(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
// TODO : Add Code for message handler. Call DefWindowProc if necessary.
int nInc;
UINT nPos=HIWORD(wParam);
switch (LOWORD(wParam))
{
case SB_TOP: nInc = -m_nHscrollPos; break;
case SB_BOTTOM: nInc = m_nHscrollMax-m_nHscrollPos; break;
case SB_LINEUP: nInc = -1; break;
case SB_LINEDOWN: nInc = 1; break;
case SB_PAGEUP: nInc = -HORZ_PTS; break;
case SB_PAGEDOWN: nInc = HORZ_PTS; break;
case SB_THUMBTRACK: nInc = nPos - m_nHscrollPos; break;
default: nInc = 0;

}

nInc = max(-m_nHscrollPos, min(nInc, m_nHscrollMax - m_nHscrollPos));

if (nInc)
{

m_nHscrollPos += nInc;
int iMove = -HORZ_PTS * nInc;
::ScrollWindow(m_hWnd,iMove, 0, NULL, NULL);
::SetScrollPos(m_hWnd,SB_HORZ, m_nHscrollPos, TRUE);
::UpdateWindow(m_hWnd);
}

return 0;
}
LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
if (!m_bInitialized)
return -1;

::ScrollWindow(m_hWnd,m_nHscrollPos*HORZ_PTS, 0, NULL, NULL);
::ScrollWindow(m_hWnd,0, m_nVscrollPos*VERT_PTS, NULL, NULL);
m_nHscrollPos = 0;
m_nVscrollPos = 0;
::SetScrollPos(m_hWnd,SB_HORZ, m_nHscrollPos, TRUE);
::SetScrollPos(m_hWnd,SB_VERT, m_nVscrollPos, TRUE);
CRect tempRect;

::GetClientRect(m_hWnd,&tempRect);

// Calculate how many scrolling increments for the client area
m_nHorzInc = (m_ClientRect.Width() - tempRect.Width())/HORZ_PTS;
m_nVertInc = (m_ClientRect.Height() - tempRect.Height())/VERT_PTS;

// Set the vertical and horizontal scrolling info
m_nHscrollMax = max(0, m_nHorzInc);
m_nHscrollPos = min (m_nHscrollPos, m_nHscrollMax);

::SetScrollRange(m_hWnd,SB_HORZ, 0, m_nHscrollMax, FALSE);
::SetScrollPos(m_hWnd,SB_HORZ, m_nHscrollPos, TRUE);

m_nVscrollMax = max(0, m_nVertInc);
m_nVscrollPos = min(m_nVscrollPos, m_nVscrollMax);
// MessageBox("The Size handler");
::SetScrollRange(m_hWnd,SB_VERT, 0, m_nVscrollMax, FALSE);
::SetScrollPos(m_hWnd,SB_VERT, m_nVscrollPos, TRUE);
return 0;
}
LRESULT OnVScroll(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
int nInc;

UINT nPos=HIWORD(wParam);
switch (LOWORD(wParam))
{
case SB_TOP: nInc = -m_nVscrollPos; break;
case SB_BOTTOM: nInc = m_nVscrollMax-m_nVscrollPos; break;
case SB_LINEUP: nInc = -1; break;
case SB_LINEDOWN: nInc = 1; break;
case SB_PAGEUP: nInc = min(-1, -m_nVertInc); break;
case SB_PAGEDOWN: nInc = max(1, m_nVertInc); break;
case SB_THUMBTRACK: nInc = nPos - m_nVscrollPos; break;
default: nInc = 0;
}

nInc = max(-m_nVscrollPos, min(nInc, m_nVscrollMax - m_nVscrollPos));

if (nInc)
{
m_nVscrollPos += nInc;
int iMove = -VERT_PTS * nInc;
::ScrollWindow(m_hWnd,0, iMove, NULL, NULL);
::SetScrollPos(m_hWnd,SB_VERT, m_nVscrollPos, TRUE);
}
return 0;
}

Can anybody help me
Thanks in advance
Aruna
GeneralFind Replace Problem MSWord 200 from C++ Pin
Neil Katalino30-May-00 17:12
Neil Katalino30-May-00 17:12 
GeneralFind Replace Problem MSWord 200 from C++ Pin
Neil Katalino30-May-00 17:09
Neil Katalino30-May-00 17:09 
QuestionToolbar-like Framework? Pin
Sid Price30-May-00 11:43
Sid Price30-May-00 11:43 
AnswerRe: Toolbar-like Framework? Pin
Dmitriy31-May-00 4:56
Dmitriy31-May-00 4:56 
Generalupdateresource question Pin
drkar30-May-00 11:09
drkar30-May-00 11:09 
GeneralRe: updateresource question Pin
Paolo Messina30-May-00 11:36
professionalPaolo Messina30-May-00 11:36 
GeneralRe: updateresource question Pin
Dmitriy31-May-00 4:54
Dmitriy31-May-00 4:54 
GeneralRe: updateresource question Pin
Blake Miller9-Jun-00 21:58
Blake Miller9-Jun-00 21:58 
GeneralRe: updateresource question Pin
Blake Miller5-Jun-00 4:40
Blake Miller5-Jun-00 4:40 
Generalc++ Pin
Jeff Szielenski30-May-00 10:02
Jeff Szielenski30-May-00 10:02 
GeneralRe: c++ Pin
Brigg Thorp1-Jun-00 1:51
Brigg Thorp1-Jun-00 1:51 
GeneralRe: c++ Pin
Member 14741-Jun-00 9:31
Member 14741-Jun-00 9:31 
GeneralRe: c++ Pin
Brigg Thorp2-Jun-00 1:19
Brigg Thorp2-Jun-00 1:19 
GeneralRe: c++ Pin
Member 7505-Jun-00 18:12
Member 7505-Jun-00 18:12 
GeneralFirst-chance exception Pin
nickinchina30-May-00 9:56
nickinchina30-May-00 9:56 
GeneralRe: First-chance exception Pin
Tim Deveaux30-May-00 13:04
Tim Deveaux30-May-00 13:04 
GeneralRe: First-chance exception Pin
Arvind2330-May-00 13:53
Arvind2330-May-00 13:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.