|
Dear by using Visual Studio 6.0 I could not set line color of CTreeCtrl.
It is saying that "SetLineColor" is not a member of CTreeCtrl
I have checked for the alternative method for Send message but it is also not compiling.
pls help me in this regards
Currently I am working as software engineer at Network System Technologies Pvt. Ltd (NeST). Most of my project are in C++. Most interesting are is GUI programming.
|
|
|
|
|
Use TreeView_SetLineColor( hTreeCtrl, clr )
- NS -
|
|
|
|
|
stil im getting error....
error C2065: 'TreeView_SetLineColor' : undeclared identifier
I have also tried this one...
m_TreCtrl.SendMessage(TVM_SETLINECOLOR,0, RGB(255,0,0));
seems it is the problem with some #define s
Currently I am working as software engineer at Network System Technologies Pvt. Ltd (NeST). Most of my project are in C++. Most interesting are is GUI programming.
|
|
|
|
|
Can u send some other TVM_ messages?
- NS -
|
|
|
|
|
Some times u may not be having the latest Platform SDK...
no problem ...the value of TVM_SETLINECOLOR is 0x00001128 ..
So just use this value to send the message
m_TreCtrl.SendMessage( 0x00001128,0, RGB(255,0,0));
nave
|
|
|
|
|
But I don't understand the reason...
This consant and macro will work only if _WIN32_IE >= 0x0500... Did u see the declarations in the CommCtrl.h ?
- NS -
|
|
|
|
|
smartsarath ...did set the winversion to 0X500
_WIN32_WINNT=0X501 (set this value in the preprocessor setting of the project settings )
nave
|
|
|
|
|
Naveen R wrote: _WIN32_WINNT=0X501 (set this value in the preprocessor setting of the project settings )
Just modify the stdafx.h file. And do modify the IE version too.
Nibu thomas
Software Developer
|
|
|
|
|
Have you set the version of IE.
You need Comctl32 version 5.80 or above for TVM_SETLINECOLOR to work.
This means you will need IE 5 or greater.
Nibu thomas
Software Developer
|
|
|
|
|
You mean Naveen's solution will not work?
- NS -
|
|
|
|
|
The problem is with IE version.
Unless the versions are defined properly these macros won't be available as these are defined in guarded blocks.
Nibu thomas
Software Developer
|
|
|
|
|
no need of macro ... I can send the message like
m_TreCtrl.SendMessage( 0x00001128,0, RGB(255,0,0));
This will work. Right?
nave
|
|
|
|
|
Naveen R wrote: This will work. Right?
Why do you want to do such things! Just define the proper IE version. That's all.
Well if you have the wrong dll installed no matter what you do it won't work.
Nibu thomas
Software Developer
|
|
|
|
|
But what if it is the dll version problem....?
- NS -
|
|
|
|
|
If the problem is only because of dll version, The program compiles and links with out error.. but will not work...
Because the message will not be handled in that dll
nave
|
|
|
|
|
Hi All
I am making an application which will rename some of the files at system booting(Before windows loading),
For this, making application using Native APIs, because will use this applications's exe in
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager
Boot Execute value to run desired exe after session manager will load.
So I want to know that which NATIVE API is used for Renaming files.
Please reply
Thnaks & Regards
|
|
|
|
|
if you read something in the registry, then windows is already loaded.
if you use a Win32 API to rename files, then windows is already loaded.
if you want to rename a file in pure C/C++, then open your file, read the content, then create another file with the new name, write the content of the other file in it, close them, delete then old file, and you've got it.
|
|
|
|
|
Yuo can use CopyFile and Deletefile or MoveFile APIs.
cheers..mil10
|
|
|
|
|
Thanks for your replies...
Infact I am asking about renaming a file by using Native APIs not by using Win 32 API.
Please reply,
Thanks
|
|
|
|
|
You need to do what v2.0 is saying, to do that using the Native API, you need to use:
ZwCreateFile //To Open and Create the new file
ZwReadFile
ZwWriteFile
Also you'l need a lot of patience, because the Native API is almost not documented.
|
|
|
|
|
did you read my post ?
|
|
|
|
|
rajeevktripathi wrote: I am making an application which will rename some of the files at system booting(Before windows loading),
You can get Windows to do this for you... Call MoveFileEx() while Windows is running, and specify the MOVEFILE_DELAY_UNTIL_REBOOT flag to schedule the rename for the next reboot.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Why do you think you need to use the Native API just to rename a few files at startup time? Your problem can easily be solved with MoveFileEx(..., MOVEFILE_DELAY_UNTIL_REBOOT) .
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
Yes
exatctly can do by using MOVEFILE or by SHFileOperation but I need to do it by using Native APIs ( not using Win 32 APIs).
So Please tell me the way to rename a file using Native APIs.
Thanks
|
|
|
|
|
rajeevktripathi wrote: can do by using...SHFileOperation...
No, because by the time a program using SHFileOperation() started, the file being renamed might already be in use.
rajeevktripathi wrote: ...I need to do it by using Native APIs...
Why? What do these functions do that the Win32 API doesn't?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|