|
Hi all,
I have made a dialog based application and my application is closing if i press ctrl+scrolllock.
I want to disable this action in my application.
Thanks in advance
|
|
|
|
|
Use PreTranslateMessage to intercept the CTRL+SCROLLLOCK key. Add the function to the dialog using the class wizard.
BOOL myDlg::PreTranslateMessage(MSG* pMsg)
{
if(pMsg->message==WM_KEYDOWN)
{
if( GetKeyState( VK_CONTROL )
{
if( pMsg->wParam == VK_SCROLL) ) { return TRUE; }
}
}
return CDialog::PreTranslateMessage(pMsg);
}
More [here]
|
|
|
|
|
Start with a blank dialog application. Run it and press the Ctrl+ScrLck keys. Does anything happen?
"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
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
modified 1-Dec-11 9:22am.
|
|
|
|
|
yes it closes the dialog box
|
|
|
|
|
I got TopCoder23's suggestion to work by changing VK_SCROLL to VK_CANCEL in that last if statement. I'm unsure of why, however.
"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
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
Hi all,
I have make a three views in a child frame using split window. But I'm unable to re size them. How can I do that. Also those views are appeared when I click on the view. Why is that ?
Thanks.
|
|
|
|
|
With that much information it's impossible to guess what's happening in your code. Show some of the code that fails and explain what it is supposed to be doing.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Invoke a Call to the function CSplitterWnd::SetColumnInfo to set the specified column size.
Invoke a Call to the function CSplitterWnd::SetRowInfo to set the specified row size.
Invoke a Call to the function CSplitterWnd::RecalcLayout redisplay the splitter window after adjusting row or column size.
MSDN docs: [CSplitterWnd::SetColumnInfo] and [CSplitterWnd::SetRowInfo] and [CSplitterWnd::RecalcLayout].
Sample code:
void CMyFrame::OnSize(UINT nType, int cx, int cy)
{
if(::IsWindow(m_wndSplitter.m_hWnd) && ::IsWindow(m_wndSplitter2.m_hWnd))
{
m_wndSplitter.SetRowInfo(0, cy*2/3, 10);
m_wndSplitter.SetRowInfo(1, cy/3, 10);
m_wndSplitter2.SetColumnInfo(0, cx/4, 10);
m_wndSplitter2.SetColumnInfo(1, cx*3/4, 10);
RecalcLayout();
}
}
|
|
|
|
|
In VB, I used string.contains to see if a value exist in a string, Is there a c++ equivalent?
I looked at find, replace, but wasn't sure about them, or I don't know what the nomenclature is for it.
I want to make sure that a WCHAR doesn't contain the value before I wcsncat_s it.
modified 28-Nov-11 13:13pm.
|
|
|
|
|
yes, find is what you want.
str.find("target");
or
str.find("target", startPos);
|
|
|
|
|
Is that for string?, I forget to mention I was working with unicode characters (WCHAR)
I'll give it a try right now, Thanks Chris.
|
|
|
|
|
jkirkerx wrote: Is that for string?
for std::string and std::wstring, yes.
|
|
|
|
|
I got lucky, and used wcsncpy_s, as nomenclature, that lead me to a very long list of functions in MSDN, and I found wcsstr. It was buried so deep, and the description was very vague.
So I wrote it, and so far so good, no double entries anymore. That was a hard one, Eric scared me off with having to use pointers, and I could not find anything on the subject.
Thanks Chris and Eric for the Help.
pzMatch = _tcsstr(szNewServerNames, szAddServerName);
int iMatch = (int)(pzMatch -szNewServerNames + 1);
if (pzMatch = NULL) {
_tcsncat_s(szNewServerNames, iSNs, szAddServerName, iASN );
}
|
|
|
|
|
Use the CString class in C++. Yes, you can use in in Win32 if you include the header and lib.
If not, noy need to write raw C style code, searching an array for a pattern drectly. And as a VB coder, you are going to hit poiters big time, be prepared, its gnarly.
==============================
Nothing to say.
|
|
|
|
|
Richard got me using WCHAR's, and Ihaven't made it over the pointer mountain yet. I still have a code module to work on from Richard that works with pointers.
Let me try the find first, it's a registry function and I want to stick with the same format.
Thanks!
|
|
|
|
|
jkirkerx wrote: Ihaven't made it over the pointer mountain yet.
Worth persevering, pointers are very very usefull. When you write C, you really are aware of writing real code, and I dont mean that in an elitist way, just that you are directly manipulating the machine. Well, OK assembler is more direct, but C is as close, without having to tell it how to eat and breathe.
==============================
Nothing to say.
|
|
|
|
|
I must concur that message.
Writing my program is getting depressing. Now I'm doing the SQL stuff, and opened a whole new can of worms to eat for another week.
I'll get to the pointers soon, but this was a quick patch for my registry program until I figure out the pointers and use the code that Richard wrote for me, so I can implement it.
|
|
|
|
|
Hi Experts.
I had created a system driver, which is successfully installed in x86 system. But when i try to install in x64 it gives error, Unsigned Driver Installation Unsupported
Is there any logical work around so that unsigned driver can be installed in x64 system.
I am a individual developer, so i am unable to get code signing certificate.
please guide..
Regards,
Vishal
modified 3-Dec-11 13:01pm.
|
|
|
|
|
You can test sign a driver during development.
You can use some tools that come along with the WDK to do this.
Basically you first create a test certificate using MakeCert.exe .
You then install the certificate using CertMgr.exe .
Then sign the driver binaries using SignTool.exe .
The above method is use to sign the driver binaries.
You can also use Inf2Cat.exe to create a CAT file if your driver has an INF based package.
Another important step is that you must first put the system into Test Mode to install test signed drivers.
This applies to both steps mentioned above.
You can do this by executing the command bcdedit -set testsigning on from an elevated command prompt.
More information here - Signing Drivers during Development and Test (Windows Vista and Later)[^]
|
|
|
|
|
Thanx, can this method be used in the production environment..
Regards,
Vishal
|
|
|
|
|
Definitely not.
Because the test certificate is not strong enough and customers will not appreciate going into test mode.
|
|
|
|
|
sorry for late reply. Thanx for your valuable suggestion.
Regards,
Vishal
|
|
|
|
|
sorry for late reply. Thanx for your valuable suggestion. I am considering Code Signing Certificate for Individual developer, I had talked to few providers, but they replied that only a business entity can get this certificate.
Regards,
Vishal
|
|
|
|
|
|
Hi Experts,
Is there any way I can get all logical drives information with follwing attribtes:
1. Active Partition
2. Start Sector number
3. End Sector Number
|
|
|
|