Click here to Skip to main content
15,943,479 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralRe: Getting AppData Directory Path Pin
Richard Andrew x645-Sep-11 10:13
professionalRichard Andrew x645-Sep-11 10:13 
AnswerRe: Getting AppData Directory Path Pin
MicroVirus6-Sep-11 1:28
MicroVirus6-Sep-11 1:28 
GeneralRe: Getting AppData Directory Path Pin
jwalker3436-Sep-11 5:44
jwalker3436-Sep-11 5:44 
GeneralRe: Getting AppData Directory Path Pin
MicroVirus6-Sep-11 15:31
MicroVirus6-Sep-11 15:31 
GeneralRe: Getting AppData Directory Path Pin
jwalker3437-Sep-11 16:03
jwalker3437-Sep-11 16:03 
Questionhelp me!!! Pin
zz526335731-Aug-11 5:30
zz526335731-Aug-11 5:30 
QuestionHow to use forms / dialog boxes with an ATL Project / BHO? Pin
abetterword23-Aug-11 4:22
abetterword23-Aug-11 4:22 
AnswerRe: How to use forms / dialog boxes with an ATL Project / BHO? Pin
MicroVirus6-Sep-11 2:06
MicroVirus6-Sep-11 2:06 
I was reading http://msdn.microsoft.com/en-us/library/bb250489.aspx[^] after I saw your post. Scrolling down to around 2/3 of the page under the heading Responding to Events, there is the following:

From MSDN:

Finally, add a simple OnDocumentComplete event handler.
C++
void STDMETHODCALLTYPE CHelloWorldBHO::OnDocumentComplete(IDispatch *pDisp, VARIANT *pvarURL)
{
    // Retrieve the top-level window from the site.
    HWND hwnd;
    HRESULT hr = m_spWebBrowser->get_HWND((LONG_PTR*)&hwnd);
    if (SUCCEEDED(hr))
    {
        // Output a message box when page is loaded.
        MessageBox(hwnd, L"Hello World!", L"BHO", MB_OK);
    }
}

Notice that the message box uses the top-level window of the site as its parent window, rather than simply passing NULL in that parameter. In Internet Explorer 6, a NULL parent window does not block the application, meaning that the user can continue to interact with the browser while the message box is waiting for user input. In some situations, this can cause the browser to hang or crash. In the rare case that a BHO needs to display a UI, it should always ensure that the dialog box is application modal by specifying a handle to the parent window.


Basically, where the MessageBox is, is *any* dialog box you want or create. The actual creation and display of the dialog inside a BHO is exactly the same as for a normal windows application. Just be sure to set the parent to the browser hWnd, as is suggested by this article.

So, to learn how to do this, all you need to do is learn how to display a dialog in a normal 32 bits application. And then hook it up to your BHO and display it at the right time.
QuestionFailure to Recognise Base Class [modified] Pin
Bram van Kampen19-Aug-11 13:47
Bram van Kampen19-Aug-11 13:47 
AnswerRe: Failure to Recognise Base Class Pin
Richard MacCutchan20-Aug-11 0:23
mveRichard MacCutchan20-Aug-11 0:23 
GeneralRe: Failure to Recognise Base Class Pin
Bram van Kampen20-Aug-11 15:47
Bram van Kampen20-Aug-11 15:47 
GeneralRe: Failure to Recognise Base Class Pin
Richard MacCutchan20-Aug-11 23:32
mveRichard MacCutchan20-Aug-11 23:32 
AnswerRe: Failure to Recognise Base Class Pin
«_Superman_»22-Aug-11 13:14
professional«_Superman_»22-Aug-11 13:14 
QuestionCommon Controls Issue Pin
Tracy Software16-Aug-11 2:55
Tracy Software16-Aug-11 2:55 
Questioniterator default value [modified] Pin
liquid_5-Aug-11 1:34
liquid_5-Aug-11 1:34 
AnswerRe: iterator default value Pin
Stephen Hewitt6-Aug-11 20:40
Stephen Hewitt6-Aug-11 20:40 
GeneralRe: iterator default value Pin
liquid_7-Aug-11 9:18
liquid_7-Aug-11 9:18 
QuestionSOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\ Pin
VeganFanatic24-Jul-11 8:44
VeganFanatic24-Jul-11 8:44 
QuestionRe: SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\ Pin
Richard MacCutchan24-Jul-11 21:09
mveRichard MacCutchan24-Jul-11 21:09 
AnswerRe: SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\ Pin
VeganFanatic25-Jul-11 2:25
VeganFanatic25-Jul-11 2:25 
GeneralRe: SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\ Pin
Richard MacCutchan25-Jul-11 3:33
mveRichard MacCutchan25-Jul-11 3:33 
AnswerRe: SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\ Pin
MicroVirus6-Sep-11 2:18
MicroVirus6-Sep-11 2:18 
QuestionHelp regarding method WNetCancelConnection2 Pin
tasumisra18-Jul-11 23:42
tasumisra18-Jul-11 23:42 
AnswerRe: Help regarding method WNetCancelConnection2 Pin
Richard MacCutchan19-Jul-11 0:35
mveRichard MacCutchan19-Jul-11 0:35 
QuestionProblems with Docking Toolbars Pin
Syamlal S Nair18-Jul-11 17:59
Syamlal S Nair18-Jul-11 17:59 

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.