|
Write an application that catches the WM_QUERYENDSESSION message.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
|
Have a look here[^] for info about the message.
When you receive the message you can act on it by doing what is supposed to be done when the system shuts down or the user logs off.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
I want to run exe when I select Shutdown in start menu
|
|
|
|
|
Hi everybody,
how to overwrite part of an existing file without loosing the remaining information???
ex: file contains info about employees loke empId, salary,Company etc. Now if i want to change company name of a specific employee Id how to achieve it??
|
|
|
|
|
What is the format of the file ?
Me think you will need to load the file in memory, modify the structure internally and write back to the file.
|
|
|
|
|
Hi all,
I have successfully created a notify icon, but how can I create a balloon pop up, when it is created, and let it time out after x amount of time ??
Many Thanks
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
See Here[^]
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Thank you for the help _AnShUmAn_
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
HI
I want to get two keys from the keyboard simultaneously , I mean when you press and hold two keys the kbhit() and getch() functions return only the first pressed key .
thanks
|
|
|
|
|
V_shr wrote: I want to get two keys from the keyboard simultaneously
This is impossible since the link from the keyboard is serial.
The only way to detect if two keys are pressed simultaniously is if one of them is a shift-key or similar since that would have an impact on the scan code.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
That is incorrect. The GetAsyncKeyState() function will return the status of any key on the keyboard, up or down.
You can use this macro:
#define KEYDOWN(vk_code) ((GetAsyncKeyState(vk_code) & 0x8000) ? 1 : 0)
to determine if a key is currently being pressed. This will check key state even if your application does not have focus. If you are actually wanting to capture the key presses, you would actually have loop through all of the key codes and check individual status with this method.
Dustin
|
|
|
|
|
Dustin Henry wrote: That is incorrect.
What is incorrect?
Whether the link to the keyboard is serial or not isn't a matter of opinion.
I guess I misinterpreted the OP's problem and what he meant with "simultaneously".
If the question is "how can I determine what keys are being held down", then the answer is "poll the keys with ::GetAsyncKeyState() ", like you suggested.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Hello,
I use a template class where I would like to overload the operator [ ].
My intention is that not only the instances of the class will call the operator but also the types of the instances.
I have tried the following code. It works but never the operator [] is called.
Please could tell me if is there a solution to use my own overloaded operator with any type like int, float, long etc..
Thanks for your kind answers.
//ClassTest.h
template <class type>
class ClassTest
{
public:
ClassTest(){};
virtual ~ClassTest(){};
type* Date;
inline type& operator[](UINT i_index){return (at(i_index));};
};
main()
{
// test 1
ClassTest <int> theInt;
theInt.Date = new int[10];
theInt.Date[0] =5; //Does not call type& operator[]
//test2
int array[] = {1996,1997,1998}
ClassTest <int> figure;
figure.Date = array;
int xx = figure.Date[1]; //Does not call type& operator[]
}
|
|
|
|
|
You haven't called the [] operator for the template class in either of your examples.
Instead of
theInt.Date[0] =5; // This is using default [] operator to index into the "Date" member.
it should be
theInt[0] = 5;
This will call your operator but it won't compile since you have no "at()" method defined.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Hi
I am making an application using VC++ now i want to run a bunner
i use the dialog based application .
Can any one tell me how we can do this
mailing me
Yogi
|
|
|
|
|
banner ? what is a banner for you ?
|
|
|
|
|
Banner like
" you are most welcome in to ......................"
mailing me
Yogi
|
|
|
|
|
WTF are you talking about ?
can't you explain clearly you need and what you have ?
|
|
|
|
|
I guess he wants to print a banner from a dialog based application
|
|
|
|
|
|
something like this ?
http://www.codeproject.com/staticctrl/bannerstatic2.asp
or like this ?
http://www.codeproject.com/miscctrl/kcsidebannerwnd.asp
|
|
|
|
|
i don't know if it's what the OP was asking for, but CKCSideBannerWnd rocks
|
|
|
|
|
|
if ( youdontspam )
{
youarewelcomehere
}
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|