|
Hi Friends,
I am trying to set focus on the first button in a toolbar control if a key combination like ALT + SHIFT + A is pressed. I am using preTranslate Message, like this
if ( pMsg->message == WM_SYSCHAR && (GetKeyState(VK_SHIFT) & 0x8000) && (pMsg->wParam == 'a' || pMsg->wParam == 'A') )
{
m_wndToolBar.SetFocus();
}
Now. I am getting focus on first button of toolbar. I clicked SPACEBAR and this button get pressed. It open a dialog , after my operation I closed it.
After that, Unfortunately second button get activated. I pressed spacebar again.It will pressed that button and called related function , which will open another dialog. After my operation, I closed it .
Now the focus went to First button. According to project requirement the focus must retain to the last clicked button. I checked in project code, nowhere first button getting activated explicitly.
Please help me out.
Regasrd,
Amrit Agrawal
|
|
|
|
|
I am working on a legacy Windows app written in Win32.
There's a checkbox in the screen and i call the SetFocus() function to have the focus on it. I know that it works as far as setting the focus, because now i can use space button in keyboard to check and uncheck the checkbox.
But the problem is, when a control get's the focus, it's supposed show a broken rectangle around it. In my case this broken rectangle is not drawn/shown all the time. Sometimes it shows the broken rectangle and some times it doesn't.
I need to show some visual indication to user that this checkbox has the focus. I tried using WM_CTLCOLORSTATIC, but that creates some painting issues in the window.
So am looking for a simpler solution, by which i could show some visual indicator to user that this checkbox is having focus.
Like changing the text color or background color or even force draw a broken rectangle.
But i have no idea how to do this without using the WM_CTLCOLORSTATIC.
Is there a easier way to show some sort of visual indication on a checkbox in Win32?
Thanks in advance!
|
|
|
|
|
I don't know exactly, but it seems to me that you should never call SetFocus() method. Instead, we have to post WM_SETFOCUS message to the checkbox control as follows:
HWND hCheckBoxWnd = NULL;
if ((hCheckBoxWnd = ::GetDlgItem(hDlg,IDC_YOUR_CHECK_BOX_ID)))
::PostMessage(hCheckBoxWnd, WM_SETFOCUS, 0, 0);
Actually, you should not send the message using SendMessage(...) Win32API function, all you have to do is to post the message using PostMessage(...) instead.
|
|
|
|
|
I have 10+ years experience with C#. I now have an opportunity learn C++.
I'd like to work in Visual Studio (2012 and higher).
Can someone recommend a decent starter book or web reference?
Thanks
If it's not broken, fix it until it is
|
|
|
|
|
There's a bunch of good texts listed in this[^] thread.
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment
"Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst
"I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
|
|
|
|
|
Thanks
If it's not broken, fix it until it is
|
|
|
|
|
|
My app was running fine with Windows 7 & 8.1 using URLDownloadTofile(NULL,sUrl,SFile,0,NULL). With the upgrade to Windows 10 it has stopped working. I've made sure my app has security settings to allow it through the firewall (and this hasn't changed) but now the request to download fails. Also the Visual Studio 2008 Document explorer now just comes up with "Unable to download <help page="">" which makes me suspect it's a more general problem that just my app. I can't find any security settings that should be blocking my app.
If any one could shed some light on my problem I'd be grateful. I've trawled around the web for a day with no useful results.
Thanks,
David.
|
|
|
|
|
Have you tried running Visual Studio as administrator?
What is the error that you are getting?
|
|
|
|
|
Thanks it turned out the problem was that the directory that the Temporary Internet files were stored in no longer existed after the update to Windows 10. Trying to change this under the Control Panel application for Internet settings failed to change the directory as the one that it was trying to move the files from did not exist. The only way to correct the problem was to manually edit the registry key as explained here:
https://msdn.microsoft.com/en-us/library/ms940828(v=winembedded.5).aspx
|
|
|
|
|
Hi,
I want to read an xml file in C++. Is there any sample code or any library available.?
I want to read the contents of XML file. Its nodes and attribute's value.
I need an XML parser written in C++.
Any help will be appreciated.
Regards,
Mbatra
modified 12-Aug-15 6:17am.
|
|
|
|
|
Oh I doubt it. I dont think anyone's ever used c++ to read xml files, let alone written a library for it. Google will surely vindicate me..
"When I was 5 years old, my mother always told me that happiness was the key to life. When I went to school, they asked me what I wanted to be when I grew up. I wrote down 'happy'. They told me I didn't understand the assignment, and I told them they didn't understand life." - John Lennon
|
|
|
|
|
See if this will get you started.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
|
MSXML and tinyXML are two options for you.
|
|
|
|
|
I use Expat to read XML files. See http://www.libexpat.org/.
I use to this to read Excel XLSX files once they are unzipped with the zlib library.
|
|
|
|
|
We build our own library on top of MSXML (painful).
Now, I'm trying to push http://pugixml.org/[^] for our XML need; I've used it for relatively small and not too complex XML files and it works great.
I'd rather be phishing!
|
|
|
|
|
Using MSXML to read XML documents[^]
Great, intuitive lib to MSXML.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<a href="http://www.soonr.com">soonr.com -- PC Power delivered to your phone</a>
|
|
|
|
|
I like c language...but i now learning 7 programing language
modified 11-Aug-15 11:26am.
|
|
|
|
|
|
to i develop the code project system
|
|
|
|
|
|
|
Hi All,
i need C/C++ developers that have skills about reverse engineering. I need to reading custom closed file format, parse the content and fill a defined structure.
if you have experience with reverse engineering and you want more detail about this task please contact me @ luca_2000it@yahoo.it or reply to this message with your private contact.
Thanks
Luca
|
|
|
|
|
This is not the appropriate forum for such a post, please remove it.
|
|
|
|