|
Hi DiDi,
I haven't done this myself, but I have done this with Dialog Based apps, so I am making some assumptions here.
In your SDI, in the View class, there is a function OnInitialUpdate(). This function is called after the window is 'created' but before it is actually displayed on the screen.
In order to set the window text, the window must exist. But, I understand that you want to set the text before the window becomes visible. The aforementioned function is the perfect place to put such code.
In your View class, override OnInitialUpdate(), call the base class CView::OnInitialUpdate(), and then add your code to change the name of your window before this function finishes.
Hope this helps
Jeff
|
|
|
|
|
http://home.socal.rr.com/samhobbs/VC/ChangeTitle.html
|
|
|
|
|
Hello,
I've downloaded and used the BandObjs MSDN sample which shows how to create an Explorer Bar.
However, what the sample fails to show is how to communicate between the Explorer Bar and Internet Explorer itself.
What I need to know how to do is the following:
1. When the user enters a new address or clicks on a Favorite, I need my Explorer Bar to know what the new address is.
2. I would like to also be able to *Set* the address of the Browser (IOW "goto" a new website in the same browser window that my Explorer Bar resides).
Thanks much for any articles or help.
- Robert Thompson
|
|
|
|
|
To know when the user goes to a new URL, write a browser helper object. It gets notified when the browser navigates to a new URL. You can then use standard IPC techniques to communicate with your explorer bar.
|
|
|
|
|
Thanks Michael,
Do you know where any sample code is for this?
This kind of thing is difficult w/o some samples to look at.
- Robert
|
|
|
|
|
If you are already developing an explorer bar, you don't neccessarily need a browser helper object. In your SetSite implementation of your explorer bar, you should be getting the IWebBrowser2 pointer, similar to the code snippet below. Then you can do an Advise on the webbrowser to recieve the events it dispatches of DWebBrowserEvents2. Then you can see when the URL changes. Or you can use the web browser object to make a call to Navigate or Navigate2 to move to a different URL of your choice.
IOleCommandTarget* pCmdTarget;
hr = pUnkSite->QueryInterface(IID_IOleCommandTarget, (LPVOID*)&pCmdTarget);
if (SUCCEEDED(hr))
{
IServiceProvider* pSP;
hr = pCmdTarget->QueryInterface(IID_IServiceProvider, (LPVOID*)&pSP);
pCmdTarget->Release();
if (SUCCEEDED(hr))
{
if (s_pFrameWB)
{
s_pFrameWB->Release();
s_pFrameWB = NULL;
}
hr = pSP->QueryService(SID_SWebBrowserApp, IID_IWebBrowser2, (LPVOID*)&s_pFrameWB);
_ASSERT(s_pFrameWB);
pSP->Release();
}
}
|
|
|
|
|
I want to start a process on a NT Server machine from my NT Workstation. Please give me some ideas of how I can do that.
I need to write both the client and server process.
Thanx,
Jagadish.
|
|
|
|
|
I do not know much about RPCs except that they are technical and complex, but they might be just the thing for you. I am 95% sure that DCOM uses RPC for it's inter-system communication. Perhaps there is a good DCOM solution; at least then you will be using current Windows technology. I think that there are some articles that say that since DCOM uses RPC, and since RPC is standard technology, DCOM can sometimes communicate with non-Windows systems that do not have DCOM. If you use RPC directly, then you will probably have a very portable solution, in case that matters.
|
|
|
|
|
Hi,
I am using an electronic device that uses parallel port to communicate with the computer. The problem is that: This device is used to record some sound (It has an ADC converter on it.) By using an assembly program in DOS, i was able to record the sound at 8 KHz. However, i cannot record the sound under Windows.
How can i notify my program every 1/8 ms?
Or how can i pause my program at a specified line for 1/8 ms long?
Thank you for any helps in advance!
Mustafa Demirhan
|
|
|
|
|
I have two program - one design by delphi ,I have source,the other design by VC,I can't change it,The
second program send a message to the first,the message include a data struct like:
struct
{
int a;
int b;
LPSTR *pFilePtr; //what's this?
}
how can I get the message and controrl it?
please give me a sample by delphi or C
Thanks
|
|
|
|
|
You can't pass a pointer to your structure in a message wParam or lParam, because the two programs have different address spaces.
As far as I know you have to use the WM_COPYDATA message, refer to MSDN for details, I never used it.
Otherwise you may try some other way to communicate with another process, such as mailslots, named pipes, memory mapped files ...
Hope this helps,
Paolo.
|
|
|
|
|
Can I made a DLL and share a shared struct then I call the DLL,and He send data to DLL ?
|
|
|
|
|
When you load a DLL into different processes its code runs in the calling process address space, so you can't.
However there's a way to use a DLL to share some memory between processes, but I don't know it in details (you define a shared memory section in the DLL).
I think a WM_COPYDATA msg is the simplest thing to just pass a structure. If you need info go to:
http://msdn.microsoft.com/library/default.asp?URL=/library/psdk/winbase/ipc_2mw1.htm
Paolo.
|
|
|
|
|
I'm using Win98, Visual Studio/C++ 6.0, writing a simple Win32 Console App, such as Hello World. The dos console window produced is 80x25, and captures only the last 25 lines written to it.
How can I capture more lines and print them out?
Rick Marshall
SAIC @ China Lake
|
|
|
|
|
This can change the number of lines in the console - you'll need to #include <windows.h>
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
if(hConsole != INVALID_HANDLE_VALUE)
{
COORD size;
size.X = 100;
size.Y = 500;
SetConsoleScreenBufferSize(hConsole, size);
}
And I think you can read the output with ReadConsoleOutput. There are other fns for sizing the window size - SetConsoleWindowInfo - etc. Check the console reference in the MSDN.
|
|
|
|
|
Thank you, Tim, the code worked just fine.
Rick Marshall
SAIC @ China Lake
|
|
|
|
|
Does anbody know how to specify the parameters for the copy function of an Excel worksheet?
//get the second sheet in the workbook
_Worksheet sheet = sheets.GetItem(COleVariant((short)2));
//Now copy the worksheet into the same workbook
sheet.Copy(const VARIANT& Before, const VARIANT& After);
How do you go about specifying the params for the Copy function? I tried "Sheet2", "Template", using index of 2...
|
|
|
|
|
Howdy!
I was hoping that someone could tell me how to make my application get it's "fake" system colors (wich I define) on another place in the registry. I want to be able to redirect where my application(and mine only) gets its colors on another location in the registry. How would this be done in visual c++? And what would the code be like?
Thankfull for any answers,
/Fredrik
|
|
|
|
|
I don't understand what you're asking for. What do you mean by "gets it's colors"? What do you mean by "on another location in the registry"?
|
|
|
|
|
The dialog window looks for what colors windows have in the registry and uses these colors to color the dialog. Thats the system colors that are located in the registry under the key: "MyComputer\HKEY_CURRENT_USER\Control Panel\Colors". These are the so called system colors, the colors the system sets for your dialog (if you don't draw it yourself). What I want to do is, I'd like my dialog window to look for it's own colors in the same kind of way, but at another location, wich I would have define. Maybe, "MyComputer\HKEY_CURRENT_USER\Software\MyProgram\Colors" where I can set the dialog window colors myself. To do this, I have to change where in the registry my dialog window looks for it's colors. Adding the necissary keys and colors is no biggie, but how do I redirect where\how the program looks for these colors?
|
|
|
|
|
Sorry, but you simply can't do this.
In order to get different colors, you have to intercept the WM_CTLCOLOR messages for each control (or control type) and for the dialog itself.
|
|
|
|
|
Ah, would have been real neat though =)
Ok, could you help me with intercepting the WM_CTLCOLOR messages. I've tried this but I only managed to do it with te buttons, and used SetDialogBgColor() to chandge the dialogs "view" color, but a few things remain. The color of my slider, ComboBox, the menu, the boarder (or is it called frame) of the dialog window.
Thx, most thankfull for help. =)
/Fredrik
|
|
|
|
|
Hallo
Can somebody help me.
How can i record in realtime from a video camera to my hard drive??(AVI File) i need the code for AV and DV(firewire)
or somebody can tell me how they talk togheter.
B.R
BA
|
|
|
|
|
its very simple try using avicap class.it automatically save the video in file name capture.avi.there is a hell of detail in msdn or contact me i am also doing same things now a dayz
bye
bobbies_2001@yahoo.com
bobby
|
|
|
|
|
How to change the PropertySheet tab caption's color
|
|
|
|