|
I have a MFC application with a CDialog that has some fields and then a Submit button. I want to have a seperate thread monitoring an IO signal and if I see that signal I want to simulate a Submit button click. I want to be able to also click the button to have the event happen. How does one simulate a button press?
Barton
|
|
|
|
|
Make sure your thread "knows" the HWND of your dialog and then it can do the following:
::PostMessage(m_hWndDialog, WM_COMMAND, IDOK, 0L);
Dirty, but it should work.
|
|
|
|
|
|
Hi,
I want to send asynchronous messages from my VC++ DLL to VB front end. I use SendMessage, it works but since it does not return till the processing is complete, the application becomes very slow. I know that I should use SendMessageCallback instead, but somehow my WndProc, which I have written in VB app does not receive the messages sent through SendMessageCallback. The messages are being sent at a very fast rate, so I need the fastest procedure to communicate. Also, while VB is doing is processing I want my VC application to keep working, but with SendMessage it just waits for the processing on VB side to get completed.
Is there any other way I can do the communication with less overheads.
Thanks, Ratna
|
|
|
|
|
|
Try using PostMessage .
Steve
|
|
|
|
|
See PostMessage instead of SendMessage
|
|
|
|
|
i want to save a file ,which in MHTML ,as a BMP file.How can i do it ?
Thanks in advance
|
|
|
|
|
What's MHTML? Microsoft HTML?
Or are you talking about the "MHT"-format (Microsofts "Web Archive" -Format)?
Anyway, you will have to render the file and then save the resulting image as a BMP.
Cheers,
Sebastian
--
Contra vim mortem non est medicamen in hortem.
|
|
|
|
|
MSHTML is the "guts" of IE - A COM object which does all the HTML parsing and such.
Steve
|
|
|
|
|
|
Can anyone tell me how to capture the WM_DROPFILES message to explorer and override the default implementation for specific cases?
Thanks and Regards,
Anil
|
|
|
|
|
Well, you could install a hook, and handle WM_DROPFILES, and so on....
But Explorer exposes a lot of functionality for you to hook into. You could write a drop handler for the cases you are interested in, and so on.
A good place to start is the excellent shell programming series by Michale Dunn: http://www.codeproject.com/shell/[^]
Good luck,
Iain.
|
|
|
|
|
There's a shell extension called a copy hook that is called when the user does file operations (not just drag/drop) in Explorer. My shell extension series doesn't cover copy hooks, so check out MSDN (search for "IShellCopyHook", which is the interface name).
--Mike--
Visual C++ MVP
LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
There is a saying in statistics that a million monkeys pounding on typewriters would eventually create a work of Shakespeare. Thanks to the Internet, we now know that this is not true.
|
|
|
|
|
Actually what I need to have is the path of the folder where the drop event took place. Is there a way to find this out? In that case I wouldnt need to override the default handling of WM_DROPFILES message.
Thanks and Regards,
Anil
|
|
|
|
|
Anil_vvs wrote: Actually what I need to have is the path of the folder where the drop event took place.
A copy hook extension gets this info.
--Mike--
|
|
|
|
|
|
I'm sorry but it was my first time and I didn't know the rules
Astatira
|
|
|
|
|
|
hello
I have many questions
1-how a program can run just from cd-rom
2-how a program can have one instance running
3-how can get list of programs instaled in system
4-how can uninstall a program
5-how can set a program in startup list
6-how can search a file in entire system
7-PowerPoint OLE commands
I use c++ Builder but I can use visual c++ 6
Thank You
Astatira
|
|
|
|
|
1- Yes. ( must be certain that you don't write temporary files in the same path as the executable )
2- Yes. ( search this site for examples )
3- Yes. ( don't know the API, but google or MSDN can help you with that )
4- By Clicking on the Uninstall menu item ( or button in the add/remove program control panel.
5- ??? you mean by adding a shortcut of your application to the Startup folder.
6- have a look at FindFirstFile and FindNextFile
7- don't have a clue.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
From the previous answer you can see that what you are asking is possible, as I assume you are aware.
But to ask those here to do this much work for you is unreasonable.
Look around, try to do these things yourself, and when you are unable to figure something out (after trying it yourself) then ask specific questions and show what you have done, code snippets for example.
|
|
|
|
|
rezvan wrote: 7-PowerPoint OLE commands
See MSDN artcle Q169505.
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
Hi, I made an uninstaller, and I need to delete the uninstaller exe, and the folder where it is.
So I used
MoveFileEx((m_installDir + "UAdmPass.exe"),NULL, MOVEFILE_DELAY_UNTIL_REBOOT);
MoveFileEx, is returning OK but, I rebbot the machine and the file still there...
Any suggestions?
Thanks
|
|
|
|
|
Are you the administrator?
Have a nice code day
|
|
|
|