|
T.RATHA KRISHNAN wrote: What to do if I've to run it inside the GUI application?
Change your design. One application cannot run inside of another in the fashion that you describe. One solution would be to change your second application to be an ActiveX control instead.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Hi All!
I want on a tree control (under Win32 SDK) to retrieve item text by using NM_CLICK notification.
The problem i have is when I use NM_CLICK I retrieve NULL at HTREEITEM handle (I checked with NM_DBLCLK and i retrieved a handle).
would it be good idea to use TVHITTESTINFO with TreeView_HitTest?
The code is:
...
case NM_CLICK
{
char str[32];
int ret = 0;
TV_ITEM item;
HTREEITEM hItem = NULL;
// Get next selected item
// When i use NM_DBLCLK hItem is not NULL<-------
hItem = (HTREEITEM)TreeView_GetNextItem(hTree, hItem, TVGN_CARET);
if (hItem == NULL)
ret = 0;
item.mask = TVIF_TEXT;
item.cchTextMax= 32;
item.pszText= str;
item.hItem = hItem;
if (!TreeView_GetItem(hTree, &item))
ret = -1;
}
Thanks
|
|
|
|
|
There's no item associated with the NM_CLICK notification.
NM_CLICK (treeview):
"Notifies the parent window of a tree-view control
that the user has clicked the left mouse button within
the control"
What are you trying to do? Which item do you expect
to get when the user clicks the control?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi all,
In my application I need to open "My Network Places" in tree control. My system is on LAN and there is one share folder on server say "ShareFol". This ShareFol is password protected.
I open this share folder by Start->run->"type ShareFol here" and it ask for user name and password.
I am able to open My Network Places in my tree control and also able to get the name of ShareFol. I need to expand this folder in tree and before expanding it should ask for user name and password in the same window that I get when I open it through Start->run->"type ShareFol".
I tried it by using ShellExecute() method but when I give correct user name and password it opens ShareFol in to new window but not expand in tree.
Please give me some useful suggestions.
Thanks
|
|
|
|
|
BOOL Expand(
HTREEITEM hItem,
UINT nCode
);
is of any help???
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/xml>
|
|
|
|
|
Hello,
i create a new folder with :
CreateDirectory(path);
and that works fine, but now i need that new directory to have compressed property,
is that posible, to change properties after creation of folder??
My first try is with :
GetFileAttributes(path);
but this don't take any changes!
Any suggestion for me, maybe with little example???
thanks for any help!!!
termal
|
|
|
|
|
Use DeviceIoControl() with the FSCTL_SET_COMPRESSION control code (documentation here).
Regards,
--Perspx
"The Blue Screen of Death, also known as The Blue Screen of Doom, the "Blue Screen of Fun", "Phatul Exception: The WRECKening" and "Windows Vista", is a multi award-winning game first developed in 1995 by Microsoft" - Uncyclopedia
Introduction to Object-Oriented JavaScript
|
|
|
|
|
added to My tips with your name.. hope this will not present any problem to you.. if still it present problem.. please let me know!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/xml>
|
|
|
|
|
ThatsAlok wrote: hope this will not present any problem to you
Nope, not at all Glad you find it useful.
Regards,
--Perspx
"The Blue Screen of Death, also known as The Blue Screen of Doom, the "Blue Screen of Fun", "Phatul Exception: The WRECKening" and "Windows Vista", is a multi award-winning game first developed in 1995 by Microsoft" - Uncyclopedia
Introduction to Object-Oriented JavaScript
|
|
|
|
|
thanks!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/xml>
|
|
|
|
|
Hello,
thanks for answer, i try this function but i dont know hot to get a HANDLE hHandle to folder,
if i use CreateDirectory(..) i don't have any type to save handle for DeviceIoControl(...)?
Is there any other way to create a folder as CreateDirectory(...)???
regards
termal
|
|
|
|
|
After using CreateDirectory() , pass the directory name (and path) to CreateFile() , which will open the directory, returning a HANDLE which can be used with DeviceIoControl() . The documentation for CreateFile() can be found here.
Regards,
--Perspx
"The Blue Screen of Death, also known as The Blue Screen of Doom, the "Blue Screen of Fun", "Phatul Exception: The WRECKening" and "Windows Vista", is a multi award-winning game first developed in 1995 by Microsoft" - Uncyclopedia
Introduction to Object-Oriented JavaScript
|
|
|
|
|
Hi,
thanks for help, CreateFile works now and i receive a handle for folder, now i have a next problem, with DeviceIoControl(),
if i use this function i always become as answer error code 5(access denied)??
My problem is that i don't know how to set, how to assing, parameter for DeviceIoControl(...), no one of all samples have complete code snippet for that
thanks for help!!
termal
|
|
|
|
|
What platform are you running this on? If it is Windows Vista then you may need to run the process as Administrator.
Regards,
--Perspx
"The Blue Screen of Death, also known as The Blue Screen of Doom, the "Blue Screen of Fun", "Phatul Exception: The WRECKening" and "Windows Vista", is a multi award-winning game first developed in 1995 by Microsoft" - Uncyclopedia
Introduction to Object-Oriented JavaScript
|
|
|
|
|
Hi,
i try this in Windows XP Professional SP2, i have a admin rights!
Here a sample from my code:
if(FALSE == (bTrue = DeviceIoControl(
(HANDLE) hFile,
FSCTL_SET_COMPRESSION,
(LPVOID)COMPRESSION_FORMAT_DEFAULT,
sizeof(USHORT),
NULL,
0,
(LPDWORD) lpBytesReturned,
NULL
)))
{
dwError = GetLastError();
}
thanks
termal
|
|
|
|
|
How do you open the directory using CreateFile() ?
Regards,
--Perspx
"The Blue Screen of Death, also known as The Blue Screen of Doom, the "Blue Screen of Fun", "Phatul Exception: The WRECKening" and "Windows Vista", is a multi award-winning game first developed in 1995 by Microsoft" - Uncyclopedia
Introduction to Object-Oriented JavaScript
|
|
|
|
|
Hi,
thank you very much for your time to help me, here is a code how i open a folder:
HANDLE hFile = NULL;
DWORD dwErr = NULL;
if(INVALID_HANDLE_VALUE == (hFile = CreateFile(
myfolder,
GENERIC_READ,
FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
NULL,
OPEN_EXISTING,
FILE_FLAG_BACKUP_SEMANTICS,
NULL)))
{
dwErr = GetLastError();
}
and i have a valid handle, but can't access to folder!!
Next thing that make me confuse is that i can write files to folder after creation,
but can't use DeviceIoControl() --> become Errorvalue 5(access denied)!!
Just for testing i use fopen() to try to write to the new created folder and this is ok!
with best regards
termal
|
|
|
|
|
HI,
i solved my problem, it works!
thanks for help!!!
with best regards!
termal
|
|
|
|
|
Hi All
Can any one give me example of SHChangeNotifyRegister.I read MSDN but i need some example.
Plz help me
|
|
|
|
|
HWND hWnd = GetSafeHwnd();
LPITEMIDLIST ppidl;
if(SHGetSpecialFolderLocation(hWnd, CSIDL_DESKTOP, &ppidl) == NOERROR)
{
SHChangeNotifyEntry shCNE;
shCNE.pidl = ppidl;
shCNE.fRecursive = TRUE;
m_ulSHChangeNotifyRegister = SHChangeNotifyRegister(hWnd,
SHCNE_DISKEVENTS,
SHCNE_MEDIAINSERTED|SHCNE_MEDIAREMOVED,
WM_USER_MEDIACHANGED,
1,
&shCNE);
ASSERT(m_ulSHChangeNotifyRegister != 0);
}
else
ASSERT(FALSE);
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Can you give me this example link..
|
|
|
|
|
here[^]
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Good Afternoon!
I have a string
str = "FFCA0D0000"
I want to convert it into array of bytes
byArray = {0xFF, 0xCA, 0x0D, 0x00, 0x00}
plz supply with some sample code
thankyou!
|
|
|
|
|
What about reading OP's replies?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
yes i have reposted same question because i hav got couple of replies from your team
1. from u, written in 'C' i need it in VC++, although it is similiar,
what shall i use in place of sscanf(..) in VC++?
2. i got another sample code but i couldn't understand the code itself,
it was using std::vector..
so please if possible answer my question in VC++ in most simplest way, i have to use it in VS 2005.
hope you understood my problem.
thanks
|
|
|
|