|
I am trying to create a window in which I display the html contents as in a browser. I have used the code given by jeff in(http://www.codeproject.com/com/cwebpage.asp) The Internet Explorer Server class in which the contents are actually displayed doesnt support Ctrl+C copy but supports select text->right click->copy. What should I do now? How do I implement Ctrl+C copy? Do you need any more information, pls let me know.
thnax
|
|
|
|
|
sanjay_ksk wrote:
doesnt support Ctrl+C copy but supports select text->right click->copy
If you get the Ctrl+C to your window, try to send the WM_COPY to html window.
It is only a try. Please don't blame me if it is not working, because I don't know how the copy text is implemented in your code.
Please let me know the results.
Goodluck!
- NS -
|
|
|
|
|
sanjay_ksk wrote:
supports select text->right click->copy
How did you implement the rightclick and copy?
- NS -
|
|
|
|
|
i havent! May be the code given by jeff does it. and I am new to MFC and OLE. I just created a window and passed the handle the html contents to jeff's code. Then he creates 3 other windows which are in the following order
--My Window->Shell Doc Object View->Shell Embedding->Internet Explorer Server.
In this Internet Explorer Server(IES) is where the contents are displayed. I can find the IES wnd handle and then probably handle messages. how do i write a message map for ctrl+c?
|
|
|
|
|
|
You can the function ExecWB in IWebBrowser2...
Eg:
ExecWB(OLECMDID_COPY, OLECMDEXECOPT_DONTPROMPTUSER, NULL, NULL);
The selected text in the web page will be copied to the Clipboard.
Articles on this are available in CP....
|
|
|
|
|
i have a question about scope of items in a static library.
is it possible to give access to members of a class to functions within the library, but not functions in the application referencing the library (such as the 'internal' keyword in c#) without specifying 'friend' for every class i need to have access to it?
sorry i worded that weird
|
|
|
|
|
No, I don't think so.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
thanks
it's hard moving from managed back to unmanaged
|
|
|
|
|
Yeah, I've moved from C# back to C++, and while I love it overall, there are definately things I notice are 'missing' ( although the same is true going the other way )
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Why is it that even when my worker thread has already done its task, I still can't touch my GUI? Debug Assertion Failed message occurs when the program is about to do something like, EnableWindow(TRUE) and calling OnCancel() to close the dialog. Please Help
|
|
|
|
|
Can you show me some codes, so that i can identify the problem more clearly.
- NS -
|
|
|
|
|
CWnd objects are not thread safe.
If your calling window related fucntions from a worker thread, you need to do them through the HWND parameter.
If you vote me down, my score will only get lower
|
|
|
|
|
MFC has two kinds of threads, UI and non-UI (i.e. worker) threads.
Non-UI threads are not allowed to do UI-related things (although you can occasionally get away with it). You need to post a message from your worker thread to a UI thread and process it there.
The two most common elements in the universe are Hydrogen and stupidity. - Harlan Ellison
Awasu 2.1.2 [^]: A free RSS reader with support for Code Project.
|
|
|
|
|
like said above,there are two thread types.....
well the goood news is there is a good documentation on both these types ny Joseph Newcomer!
just search for threading in the Codeproject itself!
cheerz....
"faith, hope, love remain, these three.....; but the greatest of these is love" -1 Corinthians 13:13
|
|
|
|
|
Hello,
I have an app that for the most part runs in the background but occasionally needs to send pop up messages (simple dialog boxes) to the user (MessageBox dialogs are not an option). The default seems to be for these pop-ups to display themselves beneath all other open windows. This is not much good for 'notifications'.
First, how can one force MFC dialogs to pop-up/display on top of all others?
Second, how can one get these windows to stay on top regardless of which window recieves the input focus (the best example I can think of for this behavior is WinAmp with the 'Always on Top' option set)?
Thanks,
Grem
|
|
|
|
|
Look into setWindowPos. Grab your window handle and use the TOPMOST const as defined in the API docs, I forget the actual const name... Good luck.
|
|
|
|
|
Thanks Chris,
For anyone who is curious, setWindowPos() is the answer. The fn. call in my own code looks like this:
popup.SetWindowPos(
&CWnd::wndTopMost,
0,0,0,0,
SWP_NOSIZE|SWP_NOMOVE);
While digging around in the MSDN I cam across an alternative that can be used in a situation like mine where you want to create and display the window on top immediately; you can set the WS_EX_TOPMOST style for the dialog when you create it with CreateEx(...).
Grem
|
|
|
|
|
I have a simple function that uses FindWindow() to find, and shut down, explorer.exe so that I can edit some system settings in the registry. It works really great, but it does not work on Windows XP 64. I also have a bunch of sleeps in the code that don't seem to be firing off. This has been thoroughly tested on every OS, it just doesn't work on XP 64. Here's the code:
//---------------------------------------------------------------------------// Description: This function simply shuts down Explorer.exe
//---------------------------------------------------------------------------
void CSystem::ShutDownExplorer()
{
HWND hwndShell = NULL;
hwndShell = FindWindow("Progman", NULL)
if(hwndShell != NULL)
{
if(!PostMessage(hwndShell, WM_QUIT, 0, 0L))
{
throw csErrorImplications;
}
else
{
throw csErrorImplications;
}
}
SleepEx(5000, FALSE);
}
|
|
|
|
|
Since you have to close all instances of explorer.exe to be able to restore the taskbar you could scan for explorer.exe instances and terminate these processes.
Don't try it, just do it!
|
|
|
|
|
hi to all,
i finaly managed to get some free time and would like to create my first program using Visual Studio .NET. i would like a program with a nice menu, toolbar, dockable treeview on the left and other free space filled with richtextbox. it would be something like article writer, that's all. now i would like to find out few things, even though we're programming in vc++ .net on our faculty. anyhow, here they are:
1. when creating new .NET project, what type of project to select if i would like to write a program as mentioned above? should it be:
- Empty Project (.NET) or
- Windows Forms Application (.NET)
- MFC Application (MFC)
i noticed that that 2nd one has support for more Windows Forms components, also it has imagelist with selection about color depth etc. if i'm creating a program, it should also look good.
i noticed also, that in this example the best option is to use Windows Forms Applications.
What is your opinion? What are the actual diferences between those three?
2. but, if i'm talking about Windows Forms Application, i have a question about it,.. when viewing Class View for that type of project, i didn't noticed any main class. so, where to write my own code that would be executed when program would be runned? which is the main class when creating WFA?
3. the last question is somehow related with first two ones. i would really like to know, what type of project fits the best for a)dialog based applications (example- mIRC, UltraEdit, FTP programs, ... any kind of programs actually; if they're written in VC++ .NET)?
i would really apretiate your answers! thanks in advance and best regards to all
|
|
|
|
|
lordgreg wrote:
- Empty Project (.NET) or
- Windows Forms Application (.NET)
- MFC Application (MFC)
Depends, do you want to use MFC or .NET ? Both of these options will work, albeit they are vastly different, because they use different libraries to achieve the same goal.
lordgreg wrote:
What is your opinion? What are the actual diferences between those three?
1 - creates an empty app that links to .NET
2 - creates an app that uses Windows Forms and therefore requires the .NET framework and knowledge of managed C++
3 - creates an app that either statically links to the MFC dll, or requires it to be installed. MFC is how C++ Windows apps were written before VS.NET, and still are, but it's the older option.
lordgreg wrote:
when viewing Class View for that type of project, i didn't noticed any main class. so, where to write my own code that would be executed when program would be runned?
I'm starting to wonder if you are really creating your first program at ALL, in which case, you're being way to ambitious. You shoud learn C++ before learning ANY windows library.
A forms app will have a form class which has events you can put code into. So will an MFC app, for that matter.
lordgreg wrote:
i would really like to know, what type of project fits the best for a)dialog based applications (example- mIRC, UltraEdit, FTP programs, ... any kind of programs actually; if they're written in VC++ .NET)?
The answer is option 2 or 3, depends on what library you want to use.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
thank you for your answers Christian- they helped alot!
|
|
|
|
|
I have a Canon USB camera, and when you plug it in, a dialog comes up and asks what app to launch to use the camera. I want to register my app for this event. Can anyone tell me how ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|