|
Is there a way to trap certain keystrokes from an application, even though its window does not have the focus?
My goal is to make an application almost totally invisible (except in Windows Task Manager), i.e. the main window is hidden, task bar button removed, Alt-Tab does not show it - but somehow I have to activate it from time to time, i.e. I need a kind of shortcut.
|
|
|
|
|
Let i take your goal one by one.
Vancouver wrote:
My goal is to make an application almost totally invisible (except in Windows Task Manager)i.e. the main window is hidden, task bar button removed, Alt-Tab does not show it
Make a Dialog Box application with WS_EX_TOOLWINDOW Style (that remove button from taskbar and doesn't respond to ALT+tab message)
and Start your window in hidden mode.
Vancouver wrote:
but somehow I have to activate it from time to time, i.e. I need a kind of shortcut.
u can use HOTKEY for that when ever a special key combination occur activate the window (look for RegisterHotKey api in MSDN)
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Making the window invisible was not a problem, but thanks anyway. Btw, you don't need WS_EX_TOOLWINDOW while the window is hidden, for the task bar button disappears, and the application does not come up with Alt-Tab (even the task manager does not show it as an application, only as a process). However, you need WS_EX_TOOLWINDOW if you want the task bar button disappear, etc. even while the window has the focus.
Re HOTKEY: this gave me the hint, and I looked for it (earlier I was looking for "shortcut" and did not find anything useful).
I found an alternative solution too: WM_SETHOTKEY. I will evaluate, which way is better for the particular situation.
Thanks, Alok.
|
|
|
|
|
Yeah , may be interpreted your problem Wrong.
Sorry and Thanks
By the Way the Name is 'ALOK' not Alek
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
I created a Windows Form, and would like to use it as a template. How can I do this. If I save it under a new name funny thing happen. I am using Visual Studio 6. I setup a project using C++ and Windows Forms.
|
|
|
|
|
Hi,
I have implemented a game that adds nodes to a list; in essense it is creating a tree. When I add a node to the tree, I use malloc to create memory for the node and push it onto a stack. I then pop it from the stack and do a check. If the check passes I push it back onto the stack, if it fails, I want to delete the node so I use free() to free the memory that was created for it. What is happening when you look at the Task Manger in Windows (XP), it shows the memory being allocated and freed for the application, but when you look at the field called "Commit Charge" within Task Manager, it shows a constant rise in the amount of virtual memeory being used. This continues to grow until the program ends with a memory allocation error. My question relates to resources/links/recommendations on how to better handle memory within a C++ program. I am using Microsoft VC++, version 6.0. I've looked through the code for memory leaks, but it it appears to do as it should; allocating and releasing memory in the proper order. Since it appears that memory leaks is the cause, I am looking for links or recommendations on how to find these leaks.
Any recommendations or resources would be greatly appreciated.
Thanks in advance.
Martin
|
|
|
|
|
My first question would be why are you not using the new and delete operators?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Well the first thing you should do is get a memory validator program that checks for resource leaks. There are several out there, I use Bounds Checker but I sure one of the others would work just as well. It has been a while since I visited any of thier sites, but they usualy offer a 30 day free trial that you can download, so it is well worth trying.
If the nodes of the tree are actualy class that allocate memory, you could be leaking it there. Since malloc and free no nothing about destructors and therefor will not call them, use new and delete instead.
You could also try using the memory validation functions in the SDK, they require adding additional code to your program inorder to use them, but I understand they work quite well. I beleive there is at least one article at CP some where, on this subject.
Good Luck!
INTP
|
|
|
|
|
i want to .....
Firstly,first sound(sound1.wav) is play until finished this sound,next secound sound(sound2.wav) is play.
my problems is sound1.wav and sound2.wav are both play.
i don't want two sound double play..
how to play one by one sound play.
how to know ???first sound finished time for secound sound start to play.
|
|
|
|
|
How about:
sndPlaySound(sound1.wav, SND_SYNC);
sndPlaySound(sound2.wav, SND_SYNC);
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I have a USB disk and know its Vendor ID(VID) and Product ID(PID). Perhaps this USB disk has several partitions. Here is my question which puzzled me so long: How to get the volume letters through the known VID&PID?
Thanks a million.
|
|
|
|
|
|
|
hello i just migrated from msvc6.0 to .net now im trying to work on an mfc project i had however i am not able to find anything like the mfc class wizard, i figured out how to add new vars but as far as events and viewing and modifying old variables via the class wizard i dont know what to do is there a central wizard type or have they completely removed that feature?
|
|
|
|
|
i found how to add a new class to a dialog but as far as modifying the current one im lost
thanks
|
|
|
|
|
The classwizard has been radically modified for VS7/7.1. Most of the events and handlers can now be accessed via the properties controlbar.
see this
for more details.
I Dream of Absolute Zero
|
|
|
|
|
I want to use the colorful tree structure icon in my app. But its index is
84 in shell32.dll on win2k and 78 on win98. So what's the CSIDL for it?
Sing when we're programming.
|
|
|
|
|
In the Dialog view window the tool window with the button and Edit boxes etc.
I closed it and now I cannot get it back even if I start a new project
Im using Visual Studio 6 VC++
Donald
|
|
|
|
|
Here IS Solution Buddy,
open your Project,then go to resource view and then right click on Menubar and select Controls option , your tool will be back
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
I'm trying to use the windiff feature to compare two source code files. I'm not sure where this gets invoked though.
If I just enter it in a Windows command window I get "windiff is not recognized as an internal or external command, operable program, or batch file".
If I bring up a command window in Visual Studio via the View->Other Windows->Command Window menu option and then type windiff in there I get "Command windiff is not valid"
If I run the MSDN Library program and try to find a command window there to invoke windiff, I can't seem to find any way to bring up a command window.
What am I missing here?
Robert
|
|
|
|
|
I gave up on windiff. We swapped to Winmerge on my last project, it's is a hell of a lot simpler to use and to get started with, plus the interface makes much more sense. [Edit: Fixed Link]
Winmerge on Sourceforge
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts your aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
Hello all.
How can I retrive the name of all files that are in a specified directory?
If the soulition could be done with standard C/C++, it would be better than using Windows API or other. But any idea will help.
Thanks a lot.
Kith.
"...and Kith Kahnan went to the west, where he founded the city of Qualinost and named the country Qualinesty: The Freedom Land". Kynslayer Wars, by Astinus of Palanthas.
|
|
|
|
|
Under windows you can use the FindFirstFile and FindNext functions to do this. If you need a platform independant system you might want to look at boost::filesystem.
MSDN Example
boost::filesystem
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts your aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
Hi,
I have an MFC SDI application and in the view I have a CListCtrl.
Based on the size of the list, I need to enable/ disable some menu options. For example, if the list has no elements, then the option in Edit> Remove should be disabled. How do I do that?
I don't seem to have handles to the menu items I want to disable in <application>View.cpp.
Thanks in advance.
Help wanted!
|
|
|
|
|
Handle the event ON_UPDATE_COMMAND_UI and pCmdUI->Enable(false);
|
|
|
|