|
A pointer on a TVITEM structure. Here you go:
typedef struct tagTVITEM{
UINT mask;
HTREEITEM hItem;
UINT state;
UINT stateMask;
LPTSTR pszText;
int cchTextMax;
int iImage;
int iSelectedImage;
int cChildren;
LPARAM lParam;
} TVITEM, FAR *LPTVITEM;
See MSDN for more info.
Typical code snippet:
TVITEM tvi;
ZeroMemory(&tvi,sizeof(tvi));
tvi.hItem = YourItemId;
tvi.mask = TVIF_TEXT |TVIF_STATE;
m_TreeCtrl.GetItem(&tvi);
// Now tvi is fulled with the item's attributes.
~RaGE();
|
|
|
|
|
Thanku rage
but i m getting an error of
GetItem cannot convert parameter 1 from 'struct myClass::MyFunction:tagTVITEM *' to 'struct tagTVITEMA *'
|
|
|
|
|
Can you post the part of the code where you are doing the call ? Are you using MFC ?
~RaGE();
|
|
|
|
|
You've erroneously made tagTVITEM part of your class, which is unnecessary.
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
Good point David, I missed the myClass::MyFunction . He must have misinterpreted my thread and define the TVITEM I gave as an example. Never give too much information
~RaGE();
|
|
|
|
|
kandukuri wrote:
but what is the parameter for this GetItem( ) method
A pointer to a TVITEM structure.
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
Hi,
I am trying to do TDI hook driver, I just need to get notification, something like sysinternals.com TDIMon does.
I have no problem to get most of the TDI IRPs but
TDI_ACCEPT or TDI_SEND I never got..
Does anyone know what I am doing wrong?
What is special on this IRPs?
Thanx for help
viliam
|
|
|
|
|
You have implemented a filter driver on top of \Device\Tcp ? If you are on the top of the device stack you will get all the IRPs there is no special handling of those particular IRPs unless you are doing something different than I beleive you to be doing.
What Application are you attempting to filter that is not working correctly, have you verified that TDIMon is working correctly in the same situation? Also, there is a seperate device used by sockets which is \Device\Afd which I believe has a different interface than TDI. I believe there is an open source project which is a firewall that filters this interface for which you may be able to review (It also filters TDI) to find out this interface. I believe it is on sourceforge.
8bc7c0ec02c0e404c0cc0680f7018827ebee
|
|
|
|
|
Hi all,
I have created a (very simple) bitmap editing program with a dialog based MFC project. Everything seems in order so far but I don't know how to save the HBITMAPs that I have created to file. I have tried using snippets of code from other examples but to no avail.
Any help would be much appreciated
|
|
|
|
|
Is it not possible to serialize your bitmap ? Create a CBitmap from your handle HBITMAP using CBitmap::FromHandle , then Serialize it.
~RaGE();
|
|
|
|
|
If it is a DDB(device dependent bitmap) use GetDIBits(...) on the HBITMAP and get the
DIB with the format of your choice specified via the BITMAPINFO. Once got the DIB bits,
you can save to the file by putting the BITMAPFILEHEADER,BITMAPINFO and the bits itself
to a file in that sequence.
Vipin - MVP
|
|
|
|
|
|
hi,
strange problem with my colors: i want to display a tray icon but it always appears in black & white although the image HAS color. I've tried it with a 256 color bitmap, a 256 color icon, a 24 Bit color bitmap and a 24 Bit color icon (every variant with 16x16 Pixel) each time the same effect - JUST BLACK AND WHITE. Even with different functions for loading the images hasn't changed it. (tried LoadIcon, LoadImage and CreateIconIndirect )
any ideas what this may trigger ?
greets
|
|
|
|
|
Unless you're using Windows XP, tray icons always render using the standard 16 system colours, so you'll need to provide a 16 colour icon to stop it trying to convert it for you (which usually looks awful)
On XP, it renders the icons properly, using all available colours
--
Help me! I'm turning into a grapefruit!
Buzzwords!
|
|
|
|
|
you're right - windows converts my icon into 16 colors. but how do i can make sure to use only the standard 16 system colors ?
|
|
|
|
|
The simplest way is to copy your existing icon, add a new 16 colour icon to the resource in visual studio, and paste in your icon. This will create a 16 colour icon which you can then manually edit until it looks good enough (you can often redraw the icon yourself far better than windows will do itself when it remaps the icon at runtime)
--
Help me! I'm turning into a grapefruit!
Buzzwords!
|
|
|
|
|
hm, although i hoped that i didn't have to redraw the icon by my self it's seems there leads no way around.
16 colors are ridiculous however,
thanks anyway.
|
|
|
|
|
Hi,
I want to create a program that can monitor another processes memory usage..
Where it can find information about other processes memory usage??
WinAPI is large and wide and I am lost
|
|
|
|
|
|
You can also use OpenProcess and VirtualQueryEx
People that start writing code immediately are programmers (or hackers), people that ask questions first are Software Engineers - Graham Shanks
|
|
|
|
|
Ok, thanks!
|
|
|
|
|
what is the difference between
Child thread
Worker thread
How do we create both threads /??
Vikas Amin
Embin Technology
Bombay
|
|
|
|
|
I believe they are the same thing.
Worker threads are child threads if they are in the same process.
A child thread closes when the main thread of the program closes.
this is this.
|
|
|
|
|
Conceptually, in MFC we got two type of threads:-
UI threads and worker threads.
Have a look at AfxBeginThread(...) documentation.
Vipin - MVP
|
|
|
|
|
Vipin Aravind wrote: Conceptually, in MFC we got two type of threads:-
UI threads and worker threads.
Specifically, however, they are thread with message pump, and thread without message pump.
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|