|
lParam points to a NMHDR structure, or a structure that contains NMHDR as a first member. NMHDR has a member named 'code', containing the notification code. Expression that tests the notification code looks like this:
((NMHDR)lParam)->code
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
the NMHDR has to be LPNMHDR in my case, but perfect!
|
|
|
|
|
the NMHDR has to be LPNMHDR in my case
Sure! I've forgot to include '*' in the cast expression. LPNMHDR is just a typedef for 'NMHDR *'.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I have list control and its operation is just like the explorer
But when I sorting this list control the directory and files and mixed.
How can I sort it separately like explorer
|
|
|
|
|
Hi,
I'd like to know how can I fill region
with 50% OPACITY white color ?
I need it for hiliting .
Probably the answer is alpha channel functions ( Win2k ) or
OpenGL , but I want to be as simple as possible and working
under Win95 and higher.
Thanks !
|
|
|
|
|
The current issue of WDJ has an article on how to get ahold of the bits of a bitmap and iterate through them, it shows some simple filters. Next month my article on an alphablend function for W95 will be published, but it basically uses the techniques shown by the tech tip in question - copy your bitmap to a DIBSection, iterate through the bits to modify and copy back.
Christian
#include "std_disclaimer.h"
The careful application of terror is also a form of communication.
Eagles may soar, but weasels don't get sucked into jet engines.
|
|
|
|
|
Actually , I don't wanna deal with copying bitmaps back and forth.
I need smth like
FillRgn(
HDC hdc, // handle to device context
HRGN hrgn, // handle to region to be filled
HBRUSH hbr // handle to brush used to fill the region
)
function modified sucha way that it will be able to draw x% opacity
color.
|
|
|
|
|
The region thing may be interesting, but the point of what I said is it is buried in a function, so all you have to do is pass in the HDC that holds the bitmap.
Christian
#include "std_disclaimer.h"
The careful application of terror is also a form of communication.
Eagles may soar, but weasels don't get sucked into jet engines.
|
|
|
|
|
I have created a dlgbox with combo box. In the style properties of it i have selected option drop list. But when i run the dlgbox, i could select the data only when i write the first letter of it and after i could choose other thanks to the keyboard.So, my problem is that i couldn't select the data directly with the combobox, e.g, when i click on the combobox it doesn't show all the data we could choose. WHY?
thanks in advance
gerald
|
|
|
|
|
You need to change the dropdown height. In the dialog editor, click on the combo's arrow button and drag the resize handles to increase the height.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Hi All,
We've developed a fair sized application in Visual C++ 6.0. The App is supposed to run on all Windows (NT, 9x, 2000) platforms. Primarily we developed the App on Windows NT and it runs just fine. But when we run it on Windows 98, strange things happen. The system font i.e. the font in all Windows gets changed and strange messages, which are in the resource file from the past but we don't use, appear. We are deleting all GDI objects that we create in the App. We'll highly appreciate any idea about the reasons or pointers to any helpful articles.
Thanks,
Asif
|
|
|
|
|
We are deleting all GDI objects that we create in the App.
This is not enough. Probably your objects are selected into some device context when you're deleting them. MFC objects are freed, but their GDI counterparts are not. The result is GDI resource leak.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Thanks Tomasz. It worked. The problem was the code like the following:
font.DeleteObject();
pDC->SelectObject(pFontSave);
We just reversed the order of the two lines and the thing is working. In the beginning we were assuming that the CGDIObject destructor deletes the associated GDI object and since we were using local variables we were sure that the destructor was called. Then we called DeleteObject() but it doesn't work while the object is selected in a DC.
Thanks again.
Asif
|
|
|
|
|
Assuming that 'font' variable is a local, you don't even need to call DeleteObject() manually, destructor will do it for you when object goes out of scope. The problem is that DeleteObject will fail if object to be deleted is still selected in some DC.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Hi Tomasz,
One thing I always asked myself: do SaveDC/RestoreDC work the same?
I suppose so, as long as you call RestoreDC before objects destruction.
Is this right?
Paolo.
|
|
|
|
|
do SaveDC/RestoreDC work the same?
Yes, RestoreDC should de-select objects selected after SaveDC. The real question is: what's the performance impact of SaveDC/RestoreDC? Without a profiler session, I can't give you any real advice. I think that using SaveDC/RestoreDC in small functions called in tight loops could cripple the performance, but that's only a guess.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
That's what we thought and we always select the saved objects before leaving the scope. But the thing just wasn't working in Windows 95. It only worked after we excplicitly called DeleteObject().
|
|
|
|
|
Hello !!
I want to take the system into sleep state aand wake the system after say 10 seconds..
I am using the API SetSystemPowerState(). I have used Setwaitabletimer for 10 seconds to fire an signal after 10 seconds so as to wake the system and come out of sleep state.The system is going into sleep state and then returning from sleep after 10 seconds(indicator lights on the monitor changes but nothing appears on the screen) but nothing on the screen is visible afterwards. Only when I press a key or move the mouse does the monitor gets refreshed. Is there some problem in the permissions set???
Can you please help.
I have used the following:
OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY,&hToken));
LookupPrivilegeValue(NULL,SE_SHUTDOWN_NAME ,&tkp.Privileges[0].Luid);
AdjustTokenPrivileges(hToken,FALSE,&tkp,sizeof(TOKEN_PRIVILEGES), &oldtp&dwSize);
Sandeep
|
|
|
|
|
Could it be a systems setting?
I remeber of something like "Restore desktop after sleep/suspend mode" for NT4 and Win95. (Don't know the exact option, I'm Italian).
It should be somewhere in the PowerSavings options.
Paolo
|
|
|
|
|
When I create a Dialog Based Application the second dialog of the wizard allows me to choose the language of my resource file. I get the default of US English and choices of Spanish and others.
Later if I add other dialogs to the same project they are defined as Australian resources and placed in another section of the RC file.
What I want to know is how do I get Australian English into the wizard?
Should I make all the resources US English?
If so how? It just magically makes them Australian.
I know I could manually edit the RC file and move them to which ever section I desire, but this in a pain in the arse I can do wihtout. What do others do about this? Or doesn't anyone else worry about this and leave it to the default dished out?
Michael Martin
Pegasystems Pty Ltd
Australia
martm@pegasystems.com
+61 413-004-018
|
|
|
|
|
Right click on any resource (dialog, menu, whatever) in the Resource View, then select properties. There's a combobox with languages - just select the appropriate one. VC++ uses your locale settings as the default value.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Tomasz
thanks very much for the help, that's two in a row now, it might become a habit. This seems to be one of those little things that someone who has used VC++ since 1995 circa Version 4 should already know, but I don't.
Are these tricks something that you found by trial and error, someone showed you or there's a list of them somewhere.
Michael Martin
Pegasystems Pty Ltd
Australia
martm@pegasystems.com
+61 413-004-018
|
|
|
|
|
Hi,
I need BCGLibrary version 5.1 for my final essay. I'd like to add some functions into BCGlibarary myself but later versions doesn't have source. Do you have it?
Thank in advance
Ngo Khai Hoa
|
|
|
|
|
|
Hi,
I may have a solution to your problem. When Stas I was very sad because as I am only 16 I wasn't able to meet the price he wanted for the software. But lucky for me I had a read of his registration page to see what the price was. As I was reading through I came to three registration forks (on the page http://www.bcgsoft.com/register.htm): Commercial (full price), Shareware (discount), Freeware / Student Developer (FREE) <- Do you hear? FREE!
So you can get the full software (along with the source) for nothing. There are only two conditions - You must be student (which it sounds like you are, [and who care anyway?]), and you put a little note in your splash screen that goes something like 'Bits of this software were mad by Stas Leven' or something.
I hope thats helpful
Joel Holdsworth
'My cup of tea's caught fire!'
|
|
|
|