|
If you want to capture Enter key or some other keys, you might want to use keyboard hook with SetWindowsHookEx. Do some searching and you may find many examples or articles about using hook.
|
|
|
|
|
can you give me a project of VS 2010 C++ to hook WM_CLOSE message on all process?
Thank you!
~Peter
|
|
|
|
|
Try the articles section, you will find samples on Windows Hooking in there.
Use the best guess
|
|
|
|
|
can u give me the link.
thank you very much!
|
|
|
|
|
|
Member 10066523 wrote: can u give me the link. Can you try and find it yourself? If you aspire to be a developer then you need to get familiar with the tools of the trade.
Use the best guess
|
|
|
|
|
So if you know about SetWindowsHookEx(), which I assume you do, since you know about hooking other apps, you cant actually write a hook dll, inject it into other processes, and intercept WM_CLOSE just from MSDN?
You are so lazy or inept that you actually want someone to give you source code on how to do it?
And no, this isnt a project, it is for work isnt it. You are up against it and you post here saying its a project hoping someone will give you the code.
Good god. What have SW engineers become these days.
==============================
Nothing to say.
|
|
|
|
|
Hello Everybody,
I have created one SDI Application with one dialog - having some controls. In that, if I click a button, I want to show a child window and with the following code, I am getting that fine.
CMainFrame *pMainFrm = ((CMainFrame*)(AfxGetApp()->m_pMainWnd));
CFrameWnd *pFrame = new CFrameWnd;
RECT rect;
pFrame->Create(NULL,_T("Solution"), WS_OVERLAPPEDWINDOW ,rect,this);
pFrame->ModifyStyle(WS_CAPTION + WS_OVERLAPPEDWINDOW , WS_BORDER,SWP_NOMOVE +SWP_NOZORDER );
pFrame->InitialUpdateFrame(pMainFrm->GetActiveDocument(),TRUE);
pFrame->SetWindowPos(&CWnd::wndTopMost,100,200,1000,400,SWP_SHOWWINDOW);
pFrame->ActivateFrame(SW_SHOWNORMAL);
Now, I would like to write some text on that child window. Any suggestions? I tried in google also.
Thanks in advance,
A. Gopinath.
|
|
|
|
|
Use one of the templates in Visual Studio, it contains all the framework code for the SDI client. You just need to add the actual display part, in the child window's OnPaint() [^] function.
Use the best guess
|
|
|
|
|
I have VisualC++ Ver 5. I have been using it for close to 20 years. I know it's old but so am I.
My problem is that my version of VC++ crashes frequently when used on a WinXP computer.
But on a Win2K computer it runs for hours before crashing.
Is there something I should know about running VC++ on a WinXP computer?
Bob Macklin
Seattle, Wa.
|
|
|
|
|
You can force App/UI compatibility back to Windows 95.
Create a shortcut to the VC 5 exe or IDE, and right click on the shortcut then click the compatibility tab.
I used to have problems with Photoshop 5.
|
|
|
|
|
Thanks,
I have done this to two computers running WinXP. I'll see if it works better.
Bob Macklin
Seattle, Wa
|
|
|
|
|
I know that we're all very reluctant to forego something we're really used to, but you have to upgrade to newer compilers and IDEs.
They have amazing features and you will be able to get much more out of it with relative ease.
Give it a shot!!!
|
|
|
|
|
I'm 80 years old and living on Social Security.
I was a member of the group the built the first PC (8080/Z80) running CP/M in 1974.
Bob Macklin
Seattle, Wa
|
|
|
|
|
macklinbob wrote: I was a member of the group the built the first PC (8080/Z80) running CP/M in
1974.
Wow!!! And I was born 1972.
macklinbob wrote: I'm 80 years old and living on Social Security.
I understand how the upgrades can be difficult, but the truth is that as you move to newer Windows OSs, certain softwares may be incompatible.
So you would either need to upgrade the software or use the older OS.
|
|
|
|
|
You could always use Windows 2000 running inside VirtualPC. And upgrade.
|
|
|
|
|
Sometimes we have no choice but to user older tools.
"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,
I am working on a project in which I am using DirectShow for Capturing and Displaying Videos.
It works fine for Windows XP and Windows 7, but when I try to play the same video on Windows 8, its output gets corrupted. It doesn't display the actual videos colors, instead the color turns into Grey for the whole video. I tried to update DirectShow for Windows 8, checked in the code also, but all in vein....Still the same issue.
I am trying to play a file of .wmv format. Issue persists for other formats also.
Do I need any missing codec in Windows 8 or any other solution for this problem.?
How it could be possible that a video displays fine for Windows XP, and 7 but not for Windows 8.
Anybody have any idea regarding this.?
Any help will be appreciated.
Regards,
Mbatra
modified 22-May-13 8:35am.
|
|
|
|
|
mbatra31 wrote: How it could be possible that a video displays fine for Windows XP, and 7 but not for Windows 8.
For a start they removed DVD playback capability. But the 'other' codecs maybe missing as well, so you might have to get the Media Center Pack which is $10. (was free for a while to upgraders of XP/Win 7)
|
|
|
|
|
I am building my first real DLL. I am using DirectShow “Base Classes” library to build a custom DirectShow filter based on sample code from DirectShow SDK.However, this is not DirectShow question.
I managed to build VC 6.0 DLL, however, the problem is that it builds “External Dependencies” - in this case basetsd.h taken from the original VC6.0 installation which is now hopelessly inadequate for this application.
My basic question to the gurus here – what exactly is “External Dependencies” as used in MFC DLL (VC6.0) wizard? Is is similar to “additional include / library links? So far I cannot see it in command line.
Any help would be greatly appreciated and if such thing exists in later MS IDE please let me know and I'll look for it there. But from my recent experience I am reluctant to download any VS after 6.0!
Cheers Vaclav
Addendum:
Here is MSDN 2001 definition:
Note The External Dependencies folder lists files that are not part of the project but that are needed to build the project. You can add a file to the project by simply dragging it from the External Dependencies folder to any of the project folders, or to any top-level project node.
So, it means that "standard" "include" path is used to load the OLD "basetsd.h".
I guess I'll modify the original basetsd.h to make things fly.
-- modified 19-May-13 13:49pm.
|
|
|
|
|
External dependencies in a project are normally header files that are not part of your project, but defined as part of the OS or some library.
This is different from external DLL dependencies.
For example, take the example of STL.
You could be using one of its header like algorithm .
This is an external dependency for your project.
The algorithm header internally includes several other headers recursively like xmemory , xutility , new , limits , cstdlib , exception etc.
So all these headers become external dependencies for the project.
Similarly, DirectX has its own dependencies.
Modifying an external dependency is not a good idea because one such file may be dependent on many others.
So you either upgrade to a later compiler or write all routines from scratch (Which is also not a good idea).
Also, VC 6.0 is outdated. Newer compilers are much better in terms of the error checking capabilities and the optimized output it generates.
|
|
|
|
|
OK. so it is somewhat related to preprocessor #include. Just noticed that VS 2010 expanded the External dependencies on the same project where VC 6.0 had only one “external dependencies “ header.
Great, but still would like to know here is it coming from – it cannot be “automatic”, perhaps derived from additional library references as you said?
For example I have been having a heck of a time finding which version of a header file is actually included due to several SDK's I am using. Now each included header in question has #pragma message identifying the file being compiled.
I just do not trust any “defaults” or “automatic” stuff when it comes to compiler.
When stuff like that goes wrong it is a bear to troubleshot when one does not have a clue where it is coming from.
Cheers
Vaclav
|
|
|
|
|
getting linking error for a class which implements IMPLEMENT_RUNTIMECLASS_T macro.
|
|
|
|
|
Well unfortunately, we cannot see your screen, so have no idea what the error or its solution might be.
Use the best guess
|
|
|
|
|
- I've created a CPngButton from CBitmapButton.
- It overrides DrawItem() and draws the given PNG image using GDI+.
- The wm_erasebkgnd and wm_ctlcolor is taken care.
- while displaing the CMainFrame its displaying properly.
- Later if we resize the window couple of times, the transparent portions of button becomes black.
- OS is Windows 7 with Aero enabled.
- Screenshot is here[^]
- Any idea what I'm missing here?
(Some more information: The buttons are hosted on a CWnd as container. This CWnd is placed over left of menubar to looks like a quick access toolbar, which is a requirement).
Best Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|