|
Hello,
Here is the issue.
I have a win32 dialog on which there are some controls and I have call back method defined for handling the messages. One of the control is a button. Once the button is clicked and released, WM_COMMAND is received by the call back method. But as i need to handle button click and button release messages seperately i used Subclassing. I defined one more call back method for this button and now i am able to receive button down and button up messages.
There is a shortcut assigned to this button. On pressing the shortcut key, WM_COMMAND is received by the window call back but not the control call back. On releasing no message is sent to any of the call backs. Is there a way to enable the framework to send appropriate message to the control call back...
Please let me know if you need more details.
Thanks in advance,
Hari krishna.
|
|
|
|
|
Adarapu Harikrishna wrote: I defined one more call back method for this button and now i am able to receive button down and button up messages.
you mean Lbuttondown and LbuttonUp ?? Its better to handle the BM_CLICK message. It will be fired in all cases.
|
|
|
|
|
Thanks Naveen for your reply. I need any sort of message to the control call back on pressing the shortcut key and also on the release of the same. Right now it goes to the dialog call back as WM_COMMAND once the shortcut key is pressed.
|
|
|
|
|
Did you try handling BM_CLICK message in the button's call back function..?
|
|
|
|
|
Hi Experts,
I have a CListCtrl with LVS_EX_CHECKBOXES style but if I check/uncheck the item from list how can get the index of it?
I also used LVN_ITEMCHANGED and NM_CLICK but could not get the selected item index.
|
|
|
|
|
MPTP wrote: how can get the index of it?
Have you had a look at the dozens of CodeProject Articles about using CListCtrl?
led mike
|
|
|
|
|
|
I have never used MSXML, so bear with me. I have a small C++ app that receives a message via another app. The message received is XML format but is contained in a string and not passed as an XML doc. Stuck with this, nothing I can do about this part.
So, I need to implement MSXML, I am hoping this is the right path, to load the string into an XML doc and parse through it. Does anyone have or know of a simple example of how to do this? The xml string I receive only has 2 elements, so this does not have to be a very involved example with lots of bells and whistles. Just looking for the basics.
BTW, I am using MSXML 6.0.
Thanks a lot in advance for the help.
Troy Schenk
|
|
|
|
|
MSXML implements an XML DOM and maybe also a SAX parser. You can go study how those things work at web sites like TOP XML and www.w3schools.com
I also believe you will find sample code using MSXML at w3schools. Now those samples might be in something like Javascript but that doesn't matter because the COM interfaces are the same when you use them from C++. Of course if you don't have experience using COM interfaces from C++ then you will also need to learn about that.
led mike
|
|
|
|
|
thanks, I will definitely check out the w3school website.
|
|
|
|
|
|
When the cursor stays on an icon(i.e. an icon of a folder or an application), how can i get the message that there is a folder under the cursor? Just like the tooltip, when the cursor stays on an icon, it appears. I want to accomplish the same function.
|
|
|
|
|
mceros wrote: Just like the tooltip, when the cursor stays on an icon, it appears. I want to accomplish the same function.
Store these icon locations in a vector/list. Then on mouse move check whether the current mouse position is within any of the above icon locations. Handle ON_WM_MOUSEMOVE to track mouse movement. You can wrap the icon, it's location and corresponding tooltip in a structure so that you don't have go hunting again for tooltip.
Some other functions that could interest you are...
std::find_if
GetCursorPos
SetCapture
ReleaseCapture
Nibu babu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
|
|
|
|
|
Well, I have thought about this method, but if I adjust my screen resolution, it seems that locations of folders would change. And another problem: I want my program to display something like the tooltip when user stays its cursor on any icon of folder, so it is almost impossible to store the locations of all folders.
When I use Spy++ to chase messages, I found that a message called TTM_WINDOWFROMPOINT was posted. But the problem is that MSDN says this message only can be posted by coder, and recieved by system. So I wonder whether there is a message or a function can get the message that the cursor is on an icon at current positon.
I suppose function WindowFromPoint() is usefull, but I'v got no ideas how to accomplish my purpose.
|
|
|
|
|
mceros wrote: I want my program to display something like the tooltip when user stays its cursor on any icon of folder, so it is almost impossible to store the locations of all folders.
What application is this? Explorer?
Nibu babu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
|
|
|
|
|
a little win32 application
|
|
|
|
|
mceros wrote: I want my program to display something like the tooltip when user stays its cursor on any icon of folder, so it is almost impossible to store the locations of all folders.
If your folders are controls then you can call EnableTooltips in OnCreate or OnInitDialog and handle TTN_NEEDTEXT notification.
MSDN has useful code snippet. This way you don't need to store icon locations.
Prototype for TTN_NEEDTEXT looks like this...
BOOL TooltipHandler( UINT id, NMHDR * pTTTStruct, LRESULT * pResult );
Nibu babu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
|
|
|
|
|
The folders I mean are those which on the desktop or Explorer.exe, not in my application.
|
|
|
|
|
mceros wrote: The folders I mean are those which on the desktop or Explorer.exe, not in my application.
Mmm I guessed it earlier that's why I asked whether you want to handle explorer icons!
You need to write a shell extension... Here is a tutorial series by Michael Dunn!
http://www.codeproject.com/KB/shell/shellextguide3.aspx[^]
Nibu babu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
|
|
|
|
|
Well, thank you all the same!
|
|
|
|
|
mceros wrote: Well, thank you all the same! [Smile]
No problem!
Nibu babu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
|
|
|
|
|
Aha! It's exactly what I want! Thank you!
|
|
|
|
|
Hi all,
I want to get the network path in tree control such that if I expand the tree then if that particular folder on network is password protected then it should ask for the user name and password first then expand the tree.
For example- My system is connected to LAN and I have one account on "development" (we keep the backup files on "development" that is handled by server and save to server). I open development by clicking Start->run->(\\development) and it ask for user name and password, if uname and pwd are correct then I am able to open my account on development.
Now I need to implement this in to my code. Network path should come in tree and when I expand "development" then it should pop up the same window for the userid and password.
Please give me your suggestions.
Thanks
|
|
|
|
|
|
Hi Mihai,
Thanks for replying. I went through the web link that you provided to me. I just want to know that how can I check that the folder on the network is password protected?
In John McTainsh's article it is showing the network path in tree but when I click to expand the password protected folder("\\development") it does not ask for user name and password and also does not expand it.
When I open this through Start->run->\\development(provide here uname and pwd) and again run the .exe that John provided then the tree expand "development" without asking uname and pwd.
What I need is- This should ask the uname and password if the folder is password protected on the network. For that I need to check the folder accessibility on the network. I am confused that how to check that this one require user name and password to open or expand?
Thanks
|
|
|
|