|
I don't know if it helps you,you can write it in registery.
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
There is a TimeDataStamp field in the IMAGE_FILE_HEADER if you want to traverse the PE file format of your executable. That field indicates when the linker created the actual executable.
There are a few good articles in MSDN by Matt Pietrek regarding a program called PEDUMP. You can use the code from PEDUMP in order to get to that field pretty easily.
|
|
|
|
|
Hi there,
I was just wondering how you could find and highlight a text in a CScrollView based view? In the past I had done some text searching in a Edit box, but I am not too sure how you do the same when you have a view? For instance, if I cast my view to an edit control, it does find the text I am searching for, but then how do I go about highlighting it?
|
|
|
|
|
CScrollView doesn't contain any text by default. It's your class derived from CScrollView which handles drawing (text - if any - usually comes from document). So you'll need to search yourself.
Tomasz Sowinski -- http://www.shooltz.com
- It's for protection - Protection from what? Zee Germans?
|
|
|
|
|
Hi!
In a tree ctrl, can an item be on multiple lines? Basically, I want to know if the text of a tree item can be wrapped into separate lines, like in an edit control?
Thanks,
NC
|
|
|
|
|
Probably you could achieve this with custom draw.
Tomasz Sowinski -- http://www.shooltz.com
- It's for protection - Protection from what? Zee Germans?
|
|
|
|
|
Hi!
Thanks for replying.
I have another question. You had helped me earlier this week in using custom draw. I had to increase the indentation of items in a tree ctrl. I used custom draw and did that. But when I scroll the tree ctrl horizontally some items do not get redrawn. How can I force it to redraw on horizontal scroll?
Thanks,
NC
|
|
|
|
|
NC wrote:
How can I force it to redraw on horizontal scroll?
I'm not sure. I'd handle WM_HSCROLL and call Invalidate/UpdateWindow.
Tomasz Sowinski -- http://www.shooltz.com
- It's for protection - Protection from what? Zee Germans?
|
|
|
|
|
Hi!
Thanks, again.
Tried that, but didn't work. If I minimize and restore the window the items are drawn properly. I am not sure where else I could force it to redraw?
Thanks
NC
|
|
|
|
|
Do you know where I can find a setp by setp turorial for write a Factory class in an ATL project?
|
|
|
|
|
Thats the beauty of ATL, it will completely take care of the ClassFactory for you.
Here are the few simple steps that you need to take:
- Register your COM object with the server. You can do this by locating the OBJECT_MAP in your server. The object map looks like this:
BEGIN_OBJECT_MAP(ObjectMap)
OBJECT_ENTRY(CLSID_CMyClass, CMyClass)
END_OBJECT_MAP()
This lets the server know about your object, and enters the ClassFactory into the table of creatable objects, once you define your ClassFactory.
- The next thing is to derive your class from CComCoClass. This class will create the ClassFactory automatically for your. When you derive from this class, you specify the CLSID and the name of your class like this:
class CMyClass : ...,
public CComCoClass<CMyClass, &CLSID_CMyClass>
{
...
};
I hope that this helps you. However if you want a more complete reference, especially how to extend a ClassFactory, then refer to Rector / Sells book on ATL Internals. It has an excellent chapter on COM Servers.
|
|
|
|
|
dear all,
I am using MFC Dialog based application in my project.
it will run on NT services.
My question is
"how can i send a mail if there is any error occur"
please help me
thanks in advance
|
|
|
|
|
|
ok, since everyone ignored me i'm going to ask the question again.
please take the time to reply if you know the answer:
Is there any way to know from inside an Explorer bar what page is
displayed on the main window of the web browser, and/or catch
events (HTML) from that page?
~!~!~
|
|
|
|
|
Hi!
This sample is some about your problem:
=== CUT ===================================================================
#include <iostream>
#include <atlbase.h> // for CComPtr
#include "exdisp.h" // ShellWindows
#include "mshtml.h" // MSHTML
void main()
{
CoInitialize(NULL);
try
{
CComPtr<IShellWindows> spShWin;
if (FAILED(spShWin.CoCreateInstance( __uuidof( ShellWindows))))
throw std::cout << "Couldn't create object SHDocVW::ShellWindows";
// Get Open windows counter
LONG nCount;
spShWin->get_Count( &nCount);
std::cout << ((nCount)?"Shell windows list:":"none ...") << std::endl;
for (int i=0; i<nCount; i++)
{
// get next window
CComPtr<IDispatch> pDisp;
spShWin->Item( CComVariant(i), &pDisp);
CComQIPtr<IWebBrowser2> pIE( pDisp);
if (pIE == NULL)
throw "Unable to query Internet Explorer object";
// get URL (or folder)
USES_CONVERSION;
CComBSTR bsUrl;
pIE->get_LocationURL( &bsUrl);
LPTSTR lpstrUrl = W2T(bsUrl);
// Try to get html-document
CComPtr<IDispatch> pDispDoc;
pIE->get_Document( &pDispDoc);
CComQIPtr<IHTMLDocument2> pHtmlDoc( pDispDoc);
// If success - then this is Internet Explorer's window
if (pHtmlDoc)
{
std::cout << " Internet Explorer: " << lpstrUrl << std::endl;
// for example, change bkgr color to blue
pHtmlDoc->put_bgColor( CComVariant( L"blue"));
}
// Else it is Explorer simply.
else
{
std::cout << " Window Explorer: " << lpstrUrl << std::endl;
// Close window
pIE->Quit();
}
}
}
catch(char* lpstrErr) {
std::cout << lpstrErr << std::endl;
}
catch(...) {
// Unknown error...
std::cout << "Unknown error..." << std::endl;
}
CoUninitialize();
return;
}
=== /CUT ===================================================================
May be this way will be useable
This page contains description of IHTMLDocument2 interface -
this interface allow to do all with IE instance.
http://msdn.microsoft.com/library/default.asp?url=/workshop/browser/mshtml/reference/ifaces/document2/document2.asp
|
|
|
|
|
thank u so much for not ignoring me,
and for helping me.
again, thanks !!
|
|
|
|
|
How can I make use of hicolor bitmaps in my toolbars?
|
|
|
|
|
void SetTbImageList(CToolBar &tb, UINT nMessage, UINT nIDBitmap)
{
CImageList imageList;
CBitmap bitmap;
bitmap.LoadBitmap(nIDBitmap);
BITMAP bm;
bitmap.GetBitmap(&bm);
imageList.Create(bm.bmHeight, bm.bmHeight, ILC_COLORDDB|ILC_MASK, 0, 1);
imageList.Add(&bitmap, RGB(255,0,255));
tb.SendMessage(nMessage, 0, (LPARAM)imageList.m_hImageList);
imageList.Detach();
bitmap.Detach();
}
SetTbImageList(m_toolbar, TB_SETIMAGELIST, nBitmapColdID);
SetTbImageList(m_toolbar, TB_SETHOTIMAGELIST, nBitmapHotID);
SetTbImageList(m_toolbar, TB_SETIMAGELIST, nBitmapID);
Tomasz Sowinski -- http://www.shooltz.com
- It's for protection - Protection from what? Zee Germans?
|
|
|
|
|
Thanx...i'll use that later to if you don't mind.
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Is there a way to enable hicolor when using LoadToolBar? I dont want to create the tool bar from code.
|
|
|
|
|
Use LoadToolBar first - it'll assign command IDs to buttons. Then, call the routine I've posted to change images to hicolor.
Tomasz Sowinski -- http://www.shooltz.com
- It's for protection - Protection from what? Zee Germans?
|
|
|
|
|
See following article -
http://www.codeproject.com/docking/toolbar_hotbuttons.asp
|
|
|
|
|
Hi,
I wanna implement child windows in a Win32-Application (not using MFC). Works fine, but there's a problem with the focus: in apps like Photoshop, the tool windows stay "blue", i.e. they dont get deactivated when clicking anywhere else in the main window. Also, when clicking in one of these tool windows, the main window doesnt get deactivated, and they are floating, so they are no overlapped windows. Any ideas how to implement this?
|
|
|
|
|
Handle WM_NCACTIVATE to avoid color changes in title bar.
Tomasz Sowinski -- http://www.shooltz.com
- It's for protection - Protection from what? Zee Germans?
|
|
|
|
|
Thanks.
Oh man, its THAT easy.
I really should learn to search the MSDN with better keywords.
*doh* =)
|
|
|
|