|
for IE4+ you can use BHO search for it in MSDN.
|
|
|
|
|
Is there a way to get transparent backgrounds for a CStatic ??
If so - how ??
Thx
TJ
|
|
|
|
|
If you are using the dialog wizard just select the transparent extended style. (Right click on the static bitmap, select Properties and click the Extended Styles tab. Tick the Transparent option.) This generates something like
LTEXT "A Message",IDC_STATIC,167,73,121,40,0,WS_EX_TRANSPARENT
in your resource file. If you are doing your own control, you can use the WS_EX_TRANSPARENT style with any window I believe. There is also a WM_EX_TRANSPARENT message you can catch. I don't know what this does but good luck.
|
|
|
|
|
Awhile ago, when I was annoyed enough by a message box that I always answered no, I tried to implment a hook that would add a "don't ask me this again" checkbox to all message boxes. After much struggling, I got the check to be inserted and work properly. Then I hit a roadblock... How would I store the information on which message boxes were to be auto-answered? Simple sequential search didn't seem right, because message boxes happen pretty often... Anyone have any ideas on how to store/recognize that kind of data? (mainly just app exe name, title, and text.)
I figure I should defer to people who know better on this one.
-wParam
|
|
|
|
|
Wow -- that is a great idea! Now when Wordpad
asks if I would like to save every .txt file in text
format -- losing any special formatting -- I wouldn't
have to answer the message.
Perhaps you could create a key in the registry for each
exe with sub-values for the title or text indicating if
the message box should be answered (and how) or ignored.
The option to ignore msg boxes from specific exes would
be useful too. To implement this you might have to add
an 'advanced options' button beside the check box to
allow the user to set these options.
Daniel
|
|
|
|
|
How are you hooking the MessageBox? do you simply replace the function pointer! if so you know what parameters are on the stack - as your hook function probably has the same prototype - we'll start with the basics a single exe multiple MessageBox calls note this is all off the top of my head -
Within the MessageBox replacement function get the return address off the stack this will be unique and the same everytime you call the function from a specifi place in the code (remeber were dealing in basics here)now if the user selects 'Don't ask me again' save the executable name + path and the address of the call (registry/flat file). Now if you restart the app get all the entries from the registry/file bingo you'll know what MessageBoxes not to show.
Things as far as see can get a little more complicated when dealing with DLL's that show MessageBoxes (something I'm totally against) the reason is rebasing! lets assume that the developer of an app ensured that none of his DLL's clashed when loading and hence no rebasing took place - the address will always be unique as in the simple case above. But if rebasing did occur then your addresses may change with each application run. (I'm thinking of running within a different proces such as IE and it loading ActiveX controls for instance)
So he's what I suppose you could do given the return address determine what module it belongs too (this is the tricky bit) get the modules preferred base address (as specified when compiling)and then do some math to get the relative position for this call - save the new relocation base address in the registry/file. Now if the user changes the base address or when an application changes the relocation at startup to something different with a bit more math you can determine if this is the same position as last time.
The last para needs a little more thought (hopefully by somebody else) and as I say it's off the top of my head but in theory I think it may just do the trick.
Regards.
Robert Rolls.
|
|
|
|
|
Although they don't replace something like SoftICE, the diagnostic tools in VC are sometimes nice. I have just found a short-indexed loop with a "delete *obj" which caused a leak in my app. The tool I used was _CrtDumpMemoryLeaks(). The documentation has this to say:
"_CrtDumpMemoryLeaks is frequently called at the end of program execution to verify that all memory allocated by the application has been freed. The function can be called automatically at program termination by turning on the _CRTDBG_LEAK_CHECK_DF bit field of the _crtDbgFlag flag using the _CrtSetDbgFlag function."
This is typical MSDN doublespeak. It's not exactly wrong, just highly misleading. The two methods give different results. If you call _CrtDumpMemoryLeaks() at the end of your app InitInstance for example, it will detect the main window context and your dynalinks (and I suppose any other external linkage blocks as well) and report them as leaks. Even if you overload your WinApp destructor and put the dump as the very last thing you do in the app, the dynalinks are still detected. You may learn to live with this but I wan't only real leaks reported.
If you include the following code as suggested above,
int tmpDbgFlag = _CrtSetDbgFlag( _CRTDBG_REPORT_FLAG );
tmpDbgFlag |= _CRTDBG_LEAK_CHECK_DF;
_CrtSetDbgFlag( tmpDbgFlag );
you will get the correct result and all reported leaks will be your own doing only.
I don't pretend to be a Windows guru but this might help some poor sod trying to plug the leaks on the moth-bitten MFC object arrays or the poxy MS STL.
|
|
|
|
|
Nice tip, I just about to try it.
|
|
|
|
|
Hi, am looking for some websites, with tutorials and help
for game programming, any good around?
THX
|
|
|
|
|
What about going to www.google.com and putting a string such as "Game programming" and click search button!
|
|
|
|
|
I have a CEdit control in my dialog and I need to enable it for editing
via. my program... and not the user selecting it. Can this be done.
and if so... how can I make sure that the text is selected in the CEdit control?
Kind Regards
Peter Marino ( www.ioi.dk )
|
|
|
|
|
What is the windows message no. 0x101E is for ?
(I found it is sent to "syslistview32" list view of open file common dialog)
and...
How can we know details of some mysterious messages like this ?
|
|
|
|
|
|
Dear all,
I want to write a programe that:
1. A dialog box is prompted at the beginning, but the browser will be activated after the user has input the information in the dialog box.
2. The process of the dialog box is stilling running at the backend.
3. If the user input some HotKey such as Ctrl+q/Ctrl+l/Ctrl+f..., the process of my application can receive these keyboard hotkey command and jump to perform another process.
How can I receive these keyboard command and also, how to identifiy the command is equal to Ctrl+q or Ctrl+l...?
Looking forward for your reply. Thx a lot!
|
|
|
|
|
I am trying to develop a toolbar application using COM - that is a COM obj. that only impliments a toolbar. Currently I have designed it as follows - an ATL CDialogImp derived class with the class containing a CToolBarCtrl (MFC) as a member.
MyClass : CDialogImp<>
{
CToolBarCtrl m_MyTB;
}
Things haven't been easy but it is almost done, the only outstanding issue is hotkeys for the toolbar buttons. I still have 2 problems when the toolbar has the TBSTYLE_FLAT style. Toolbar buttons with borders works fine.
1. If there is no 'hotkey' provided (using an '&' in the button text) the MFC toolbar defaults the first letter of the button text as the 'hotkey'. Another similiar issue is the underline indicating a hotkey does not always appear ??
The MFC toolbar is supposed to be doing all this under the covers I'm assuming because there doesn't seem to be a way to access it.
2. If the default hotkey (from 1.) is pressed and NOT the ALT key, the button becomes HOT (i.e. looks raised), and if the the same key is presed again the whole thing crashes
I'm new to MFC/COM any suggestions would be greatly appreciated.
|
|
|
|
|
I have PIDL (absolute) of the folder and I want to know number of items (subfolders (normal, hidden, etc.) and files) in this folder. How can I do it with Shell?
|
|
|
|
|
Maybe you could use CFileFind?
Get the path from the PIDL (dumb acronymn )
and call an fn like this one:
int FindFiles(LPCSTR lpszPath)
{
int iFileCount = 0;
CFileFind fnd;
if (fnd.FindFile(lpszPath)) {
do {
if (!fnd.IsDots() && !fnd.IsDirectory()))
iFileCount++;
if (fnd.IsDirectory())
iFileCount += CountFiles();
} while (fnd.FindNextFile(fnd.GetFilePath()));
}
fnd.Close();
return iFileCount;
}
I'm not sure this will work -- I might have forgotten
something. Notice that the fn calls itself recursively
if it finds a folder, so it will find all the files in
that folder too.
Regards,
Daniel
|
|
|
|
|
How do i change the color, in a dialog base App, i want to change the background color of the dialog, from old boring gray to green..
Thank you for you help
|
|
|
|
|
Look for WM_CTLCOLORDLG in MSDN. That should
be what you're looking for.
Regards,
Daniel
|
|
|
|
|
I got a small problem ...
I'm using CArray<> which I define like this:
typedef CArray<"CListCtrlEx, CListCtrlEx&"> Type_aCListCtrlEx;
Type_aCListCtrlEx m_aCListCtrlEx;
(WHEN I PREVIEWED THE POSTING I HAD PROBLEMS WITH <> THEREFOR I
ADDED THE " SO THAT NO CODING ERROR)
Where CListCtrlEx is a CListCtrl derrived class.
Then I do this to add a new CListCtrlEx class to the array:
CListCtrlEx wndList;
m_aCListCtrlEx.Add(wndList);
The problem is that it first gave me copy contructor needed and =operator not found error. So I tried to solve it in the CListCtrlEx class like this:
HWND operator=(CListCtrlEx &s)
{ return s.GetSafeHwnd(); }
CListCtrlEx(const CListCtrlEx &s) {}
I do not know if this is the correct way to do it.
But when I try to retrive the CListCtrl wnd handle to use its methods etc like this it doesn't work:
CListCtrlEx wnd;
wnd = m_aCListCtrlEx.GetAt(0);
If someone could gimme a few hints I would be forever greatfull ...
Cheers,
Henrik
|
|
|
|
|
try using pointers to the list controls, instead of references. this way, you avoid "=" operator problems, construction and destruction problems.
-c
|
|
|
|
|
There is no copy constructor for the CArray class. So you have to define one by inheriting the CArray class.
leonwoo
|
|
|
|
|
Does anybody know how to create an unique number runtime?
I would like a number that is just as unique as a GUID.
|
|
|
|
|
a GUID is essentially a 16 BYTE number. so, if you can generate 4 random int's, you're all set.
the "uniqueness" of your number depends on what you use for seed values. even with :
seed(0);
int i1= rand();
int i2= rand();
int i3= rand();
int i4= rand();
you didn't say you needed crypto-strength random values (which these really aren't) or just statistically random values. statistally speaking, there's a lot of room in 2^128, so you should be OK.
a GUID is partly based on machine-specific data (usually your network card's address). so if you can get at that data, you can use it, too.
-c
|
|
|
|
|
Sorry, I know this is not the right page but I´m looking for someone who`s really good in creating
grafix for user-interfaces.
If you think you`re the one who will create the grafix ( background, switches etc. ) for our apps
(almost music-based)than write a short mail maybe with an example of your work to:
mario@klangwerker.de
Greatings Mario ///
... Coding is one thing - be creative another one ...
----------------------
www.klangwerker.de
mario@klangwerker.de
rocknix@lycos.de
----------------------
|
|
|
|