|
APahuchiy wrote: Rid.hwndTarget = 0;
How does the system know to send the message to your dialog?
Shouldn't you specify the dialog's HWND there?
I bet the control with focus is receiving the message fine
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
From MSDN
hwndTarget
Handle to the target window. If NULL it follows the keyboard focus.
No Mark, It doesn't work whether or not dialog in focus.
|
|
|
|
|
Right.
You're handling the message in the dialog, which
doesn't get keyboard focus.
Maybe use the dialog window's HWND...
Call the CCEREC_MCDlg::InitRawDevices function from OnInitDialog
(it won't work called from the constructor - you need a valid HWND!).
Then use:
Rid.hwndTarget = *this;
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Many Thanks Mark,
It works fine now!
|
|
|
|
|
Cool!
You're welcome!
Thanks for the update,
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi Mark,
Thanks for the tips on setting hwnd ... I have searched almost an hour to find this anwer ...
|
|
|
|
|
|
Hi !
I would like to create a simple application with C++ Builder which can play an SWF or WMV file (looping) full screen like dynamic desktop.
My problem in which I would like to ask your help :
- How can I set a Form1 to Desktop level ? I mean, how can I set the application form to stay like desktop the very most back of all other windows as well as desktop icons visible, etc ?
I already tried SenToBack() and ZORder(0) but none of the push the application below desktop icons.
Many thanks for your time and help,
Moore
|
|
|
|
|
You can't push the application behind the desktop icons but in front of the actual desktop because the desktop icons and desktop form one window.
If you have Vista, have you tried DreamScene? I believe it has the ability to play WMV files.
Regards,
--Perspx
"A refund for defective software might be nice, except it would bankrupt the entire software industry in the first year." -Andrew Tanenbaum
"Einstein argued that there must be simplified explanations of nature, because God is not capricious or arbitrary. No such faith comforts the software engineer." -Fred Brooks
|
|
|
|
|
Well, it is not entirely true. E.g visit this site : http://zmatrix.sourceforge.net , download and install it on an XP. you will see thats possible.
I just dont know, how...
Moore
|
|
|
|
|
Hello!
If you know some DirectX/DirectShow you could try creating an overlay for the screen, set the desktop to overlay-color and play the movie file you wish onto the overlay surface. That could work, but you would get ugly results with "shadow" effects like shadowed text under the icons on the desktop.
|
|
|
|
|
Hey everybody
I heard a while ago about an API using WMI that allow me to get notifications of any change of files in the system.
Anyone heard of such API? and if so, anyone can tell me what how it is called?
I looked for it for a while, without much success...
Thanks a lot!
|
|
|
|
|
Not WMI, but there's FindFirstChangeNotification/FindNextChangeNotification.
For WMI, Googling "wmi file event notification" yields a few results.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanks
|
|
|
|
|
|
You could use the api ReadDirectoryChangesW() as well. Check here[^] for code snippet.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Hi,
I am running a WinCE6.0 Stream interface Driver on a DTE device which will open a handle to Serial port which is
connected to a modem.WriteFile API returns non-zero Value, but NumberofbytesWritten parameters is coming as Zero.
The Windows CE 6.0 device is a DTE terminal and when connected to PC (Another DTE)) over NULL Modem cable with hyperterminal, all the data from the are seen on the hyperterminal, and WriteFile API fills the NumberofbytesWritten is exactly the same as the
bytestoWrite.
When the CE6.0 DTE device is connected to DCE Modemdevice using a Straight serial cable, WriteFile API
is succedding by returning Non-Zero Value, but NumberofbytesWritten parameters is coming as Zero.
The following is the DCB in the driver:
dcb.BaudRate = m_BaudRate;(115200)
dcb.fBinary = TRUE;
dcb.fParity = TRUE;
dcb.fOutxCtsFlow = TRUE;
dcb.fOutxDsrFlow = FALSE;
dcb.fDtrControl = DTR_CONTROL_ENABLE;
dcb.fDsrSensitivity = FALSE;
dcb.fTXContinueOnXoff = TRUE;
dcb.fOutX = FALSE;
dcb.fInX = FALSE;
dcb.fErrorChar = FALSE;
dcb.fNull = FALSE;
dcb.fRtsControl = RTS_CONTROL_HANDSHAKE;
dcb.fAbortOnError = FALSE;
dcb.ByteSize = 8;
dcb.Parity = NOPARITY;
dcb.StopBits = ONESTOPBIT;
Also, I am setting EscapeCommFunction(m_hCOMHandle,SETDTR);
On the hyperteminal I have the following setting:
baudrate = 115200
Data bit = 8
Parity=None
StopBit=1
FlowControl=None
Also, with the same hyperterminal setting with PC(Hyperterminal) connected to Modem over Straight SErial cable,
I am able to fire the AT Commands from the PC(hyperterminal) to the modem.
Also CommTimeout, I have set the following:
CT.ReadIntervalTimeout = MAXDWORD;
CT.ReadTotalTimeoutMultiplier = 0;
CT.ReadTotalTimeoutConstant = 0;
CT.WriteTotalTimeoutMultiplier = 0;
CT.WriteTotalTimeoutConstant = 100;
-Can a timeout issue cause WriteFile Still succeed and Numberof Bytes Written as zero?
- In hyperterminal Flow Control None, what are the Flow control affected in the DCB?
Can somebody give me some hints on the same.
Thanks..
|
|
|
|
|
My project is SDI project and I add some dialog in this project.
In this dialog I need to access some variable in CDocument class so I write this code
CTestDoc* pDoc = (CTestDoc*)GetDocument();
I got this error
"Error 3 error C3861: 'GetDocument': identifier not found"
Although I #include "TestDoc.h" at begining of file the error is same
Please advise me how to solve this problem.
|
|
|
|
|
You're trying to call a function called GetDocument() that doesn't exist
in the context of where you're calling it from.
If you're calling it from within your dialog class code then you need to
implement a method called GetDocument - CDialog doesn't have one.
A few ways to implement this:
Pass a reference to your document into the dialog.
Make the document globally accessible.
Use a CFormView instead of a CDialog. CForm view has a GetDocument().
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I'm working on a GSM application where i'm supposed to send a text msg using AT commands by detecting a com port, however before simulating the comp port i would like to know how we can detect the whether which com port is available.
|
|
|
|
|
|
Hi.
How can I create a working thread in a MFC regular dll and How can I load such a dll in a application?
Never Change My Goal!
|
|
|
|
|
First make sure you've covered the requirements for a regular DLL
that uses MFC (taken from the docs):
1) Compiled with _USRDLL defined, and if the DLL links to MFC dynamically,
_AFXDLL must be defined.
2) The DLL must instantiate a CWinApp-derived class.
3) The DLL uses the DllMain provided by MFC. Don't add your own.
Place all DLL-specific initialization code in the InitInstance
member function and termination code in ExitInstance as in a normal
MFC application.
In the dll you can use AfxBeginThread() to create worker threads.
If you don't know how to actually use a DLL, you may want to study:
DLLs[^]
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanks Mark.
But When I did it as you said,it does not seem to work at all!
can you give me some example code?
Never Change My Goal!
|
|
|
|
|
Not working how?
Please list any compiler errors, linker errors, runtime exceptions, etc.
To start with, are you able to successfully call a function in your DLL?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|