|
Hello, the codegurus around the world.;)
First of all, even though you creates the button at run time,
you can use Message Map to catch the button click message as long as
we know ID of the button, I think.
Second, if we use PreTranslateMessage function, we can check the current input focus
control or which control sends the message to the parent.
That is, if (pMsg->hwnd == GetDlgItem(ID_BUTTON)->GetSafeHwnd( )) works since
the button clicked must send the message to the parent.
or if (pMsg->hwnd == GetDlgItem(ID_BUTTON)->m_hWnd)....
The button clicked have the current input foucs.
so, if (GetFocus() == GetDlgItem (ID_BUTTON))....
However, I didn't check my old code, so...?
Have a nice day!
-Masaaki Onishi-
|
|
|
|
|
Hello, the codegurus around the world.;)
I make a simple test.
BOOL CButtonDlg::PreTranslateMessage(MSG* pMsg)
{
if ((pMsg->message == WM_LBUTTONDOWN && pMsg->hwnd == GetDlgItem(IDC_BUTTON1)->GetSafeHwnd())
|| pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_RETURN &&
pMsg->hwnd == GetDlgItem(IDC_BUTTON1)->GetSafeHwnd())
TRACE ("Click or push the button");
return CDialog::PreTranslateMessage(pMsg);
}
</br>
These codes pick up the message if we click the button by PreTranslateMessage.
However, if we use MessageBox rather than TRACE, I got the strange behavior.
Window message stream is more difficult than I expect..
Have a nice day!
-Masaaki Onishi-
|
|
|
|
|
I would override OnCommand virtual function
CTestDlg::OnCommand(WPARAM wParam, LPARAM lParam)
{
if (HIWORD(wParam) == BN_CLICKED)
{
if (LOWORD(wParam) == myButtonID)
{
MessageBox("Y");
return TRUE;
}
}
return CDialog::OnCommand(wParam, lParam);
}
---
Multitasking: Screwing up several things at once.
|
|
|
|
|
Does anyone know where I can find GOOD DirectX 8 (C++) information, books, tutorials, etc. that go beyond spinning a cube in space ?
Thanks,
Thierry
|
|
|
|
|
Hi Guys !
I'm a newbie
i'm using Visual C++ 6.0 Prof.
i had to load a Word Document to edit some Data Fields.
After edtiting i'll print the Document.
Now my problem:
How can i load a Word Document into a buufer or something els to edit the text ???
THX for your suggestions
Joachim
|
|
|
|
|
Hello, the codegurus around the world.;)
If you print out Word doucemnt, you had better use Word Automation.
You find several sample codes for Automation in MSDN library.
However, Visaul Basic is easier tool to do this than Visual C++.
If you aren't familiar with COM by VC++, VB COM may be easy.
Have a nice day!
-Masaaki Onishi-
|
|
|
|
|
Thx for the help but i didn't have Visual Basic and COM isn't familiar.
But i had to realise this problem with VC++
|
|
|
|
|
Hello!
The question is :
There is computer with 2 network cards. Is it possible that this computer has two different hostnames? If yes, wich of them does the "gethostname" API function return? How can i retreive the second one ?
Thanks a lot.
Best regards,
Furer Alexander
Sentry-Com
alex_f@sentry-com.co.il
When a password just isn't secure enough,
and email confirmations don't quite cut it,
You need Voice authentication.
You need Sentry-Com.
|
|
|
|
|
A Windows computer can only have one name.
Of course it can have different names (records) in a DNS-Server, but it can only have one "real" Windows name.
- Anders
|
|
|
|
|
Hello, can anyone help find a resource site where I can pick up old C++ exams, and possibly notes. I want to test my knowledge. Thank you
|
|
|
|
|
Hi
I wan't to be able to get a filetypes icon, preferably the position in the system image list, and the description string. Is there any API for this?
OBS! I know that I can use SHGetFileInfo, but then I must supply filename. I need it on extension basis.
I prefer to be anonymous.
|
|
|
|
|
I think you can still use the SHGetFileInfo, but you have to specify the GFI_USEFILEATTRIBUTES flag in the uFlags argument, this way the function does not access the specified file, so you can pass a bogus file name with the extension you want.
If this does not work, you can still look for all the informations you want in the registry......
Good luck!
Rui Lopes
|
|
|
|
|
Thanks a lot! It worked perfectly except for the icons for directories!
|
|
|
|
|
My app uses Shlwapi.dll which I would like to include with my installer.
I understand this is part of IE.
Is there a redistributable IE I can include with my installer incase the user does not have this DLL?
--
The Obliterator
|
|
|
|
|
I think with things like this, you must redistribute IE.
Yes, you are groaning with the displeasure of it all.
Seems that that is the way MS like it. A damn good way of
ensuring that everyong has IE on their machine
Stephen Kellett
|
|
|
|
|
Thought as much
So, where do I get hold of a redistributable IE setup file for inclusion on my CD?
I cannot find a full version for download anymore - only a setup which downloads components from the net.
I need a full self contained setup for IE.
Also, anybody know of any legal issues which apply inorder to redist IE?
--
The Obliterator
|
|
|
|
|
Have downloaded the full version of IE many times but not for a while so my memory is sketchy. I can't remember exact button names but think I can fudge my way through.
When you download the setup.exe stay connected to the Internet, run setup.exe. Click your way past the force agreement section, you should then be presented with a screen with the choices of Minimal or Typical installation (mutually exclusive Radio Buttons). Select Minimal (as this is also custom) click Next, on this screen select everything (or what is required) BUT before clicking Next look for another button on the screen (I think at the top). This is something to do with associations or some crap, in the ensuing dialog select download only don't install (something like that) and sit back and relax as it is a ~60 MB download.
I have a fattish pipe to the net at work, if by extreme chance you happen to be in the Sydney Australia area send me an e-mail I can download it for you and burn it to CD.
Michael Martin
Pegasystems Pty Ltd
Australia
martm@pegasystems.com
+61 413-004-018
|
|
|
|
|
Thanks... Serves me right for not reading the install options fully!
You are right, choosing minimal allows you access to an advanced section which provides support to download rather than install. Perfect, thanks.
Still don't understand why MS couldn't just let you download the full thing directly like you used to be able to!
Oh well, thanks for your kind offer of the download BTW but I'm in the UK. Fortunately we have ISDN-128 at work so I guess their phonebill will just have to take a small hammering
Who knows, it might encourage them to get ADSL installed!
--
The Obliterator
|
|
|
|
|
I want to display data from an Access file in a List Control .For example ,a table in access has 2 fields name & address .I want to display it usng a List Control.Any such example will do
Rudra
|
|
|
|
|
Hi !
I have created my own ActiveX control, but I can not insert it on Word, what can I do to make it available for MS-Word document ?
Thanks for all, bye !
Braulio
|
|
|
|
|
Hi
I'm using the WriteFile and ReadFile WINAPI to write/read from a COM port periodically.
The protocol is : first wirte to a port and then read the response from a port (=device). The write operation occures every 50 msec at least.
Every second attempt to call WriteFile fails and GetLastError returns ERROR_OPERATION_ABORTED. Then I use PurgeComm to clean a port after the failure. The next call to WriteFile succeedes, ReadFile succeedes, and the next try to write is cancelled and so on.
Does anybody know what can cause this error?
Thanks
Natalie
|
|
|
|
|
I don't have a direct answer as to the cause, but you might want to look into overlapped IO in a situation like this - creating a file with FILE_FLAG_OVERLAPPED allows simultaneous reads and writes, and gives you a more windows like async type of operation.
Takes a little more work to set up - there's good stuff on codeproject to help - (pj naughter's class may use this approach, or both - not sure) - but once you get it going its nice - polling is soooo passe...
And don't be scared by the docs - overlapped io is available for COM devices on win9x.
Just a thought.
|
|
|
|
|
<<< In the name of GOD >>>
Hi.
Q1.
What is the performance Buffer for reading a writing in file ?
For example CFile don't use of Buffer but CStdioFile and CArchive use Buffer !!!
Do Buffer mean that my file is Binary or text mode ?
Please explain to me.
Which is faster and better ?
Q2.
Can i use of typeBinary flag for reading and writing in file by CFile class ? Why ?
Thanks.
Hadi Rezaie
|
|
|
|
|
<<< In the name of GOD >>>
Hi.
I have EditBox(m_MainEdit, it is Editbox member variable) in CEditorDlg dialog.
I want to select text from m_MainEdit, when i have focus in COtherDlg.
The fact i want to accessibility to m_MainEdit without CEditorDlg.
I wrote some code but thease codes won't work:
#include "Editordlg.h"
.
.
.
void COtherDlg::OnFind()
{
CEdit Temp = CEditorDlg::m_MainEdit;
Temp.SetSel(0, -1);
}
Please help me ...
Hadi Rezaie
|
|
|
|
|
I'm programming a application with the new features of Win2000.I use the function SetLayeredWindowAttributes(...),but it does not work.The error displayed is "SetLayeredWindowAttributes' : undeclared identifier ".My OS is Windows 2000 professional with Visual C++6.0 Enterprise which I just updated to Service Pack 6.
What the problem may be? Thanks a lot.
|
|
|
|