|
WM_QUERYENDSESSION
led mike
|
|
|
|
|
okk thnx.. but i want to notify when user Click on Shut Down Windows option in Start Menu in Win XP ... and wnt to disable the Shut down Options dialog and want to show my own custom dialog.
Thnx.
|
|
|
|
|
Hi,
How can i make a console application listen to a pressed key?
For example i want my application listen to ctrl+q keys.
Anyone got a suggestion please?
Thanks in advance!
|
|
|
|
|
Look into RegisterHotKey . I suggest you read on hooks and the SetWindowsHookEx function.
Nobody can give you wiser advice than yourself. - Cicero
ப்ரம்மா
|
|
|
|
|
Hi,
Thanks for your reply!
I'll look in to them!
|
|
|
|
|
I don't think SetWindowsHookEx will be of much help in a console a application.
Steve
|
|
|
|
|
here is the thing
i am using PostMessage() to post several messages to a dialog box from several location
this works just fine but when i am holding the dialog - e.g. dragging it - the dialog doesn't feel that a message is being sent
i am using PreTranslateMessage() method to filter message
so what is wrong with posting message to a dialog that is being hold - dragged -
or if there is anything wrong, what is the solution for that
thanks alot u guys
|
|
|
|
|
The system has probably entered a modal loop, eating all messages except mouse-related ones
until the drag operation is complete.
You may need to handle the drag yourself - WM_NCLBUTTONDOWN, WM_NCLBUTTONUP, MoveWindow(), etc.
That way you can enter your own message loop and check for posted incoming custom messages.
Mark
"Great job, team. Head back to base for debriefing and cocktails."
(Spottswoode "Team America")
|
|
|
|
|
Try SendMessage(...)
led mike
|
|
|
|
|
How can i create my own namespace?
|
|
|
|
|
Like this:
namespace MyNamespace
{
}
|
|
|
|
|
I'm creating IE instance using this code:
m_lpBrowser.CreateInstance(CLSID_InternetExplorer);
m_lpBrowser->put_StatusBar(VARIANT_TRUE);
m_lpBrowser->put_ToolBar(VARIANT_TRUE);
m_lpBrowser->put_MenuBar(VARIANT_TRUE);
m_lpBrowser->put_Visible(VARIANT_TRUE);
IOleObjectPtr pOleObject;
pOleObject = (IUnknownPtr)m_lpBrowser;
the instance is created but problem is that I cannot get it's IOleObject
interface to set it's client site (QI returns 0x80004002 - no interface
although successfully I query for IUnknown first).
I need to navigate new instance to some url and provide login&password for
HTTP authentication.
What can be the problem with QI for IOleObject?
Thank you!
rrrado
|
|
|
|
|
rrrado wrote: the instance is created but problem is that I cannot get it's IOleObject
You'll never get that IOleObject because four years in CP and you still don't use the <pre> </pre> tags to post code.
Nobody can give you wiser advice than yourself. - Cicero
ப்ரம்மா
|
|
|
|
|
oops ... but in this case I have no < nor > in my code so it is displayed correctly
rrrado
|
|
|
|
|
|
ODBC API
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Thanx David
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
Hello again,
This time my code works, it's this:
#include <iostream>
int main() {
int get;
get = 10;
std::cout << "Type number here:";
std::cin >> get;
if (get > 10) {
std::cout << "You typed correct!";
std::cin >> get;
}
if (get < 10) {
std::cout << "Ops, wrong!";
std::cin >> get;
}
if (get == 10) {
std::cout << "Yes, correct!";
std::cin >> get;
}
else {
std::cout << "Why, it's always wrong?";
std::cin >> get;
}
}
but, when i type characters in 2 times it's ok, but when i type in 3 time, program autocloses. IS there possible to make it that it makes circles without exiting program, and without adding extra if lines?
|
|
|
|
|
Hi reyyy,
What about putting your code in a loop until a certain condition is reached ....
#include
int main()
{
int get;
int x = 0;
get = 10;
std::cout << "Type number here:";
std::cin >> get;
while (x < get)
{
if (get > 10)
{
std::cout << "You typed correct!";
std::cin >> get;
}
else
{
if (get < 10)
{
std::cout << "Ops, wrong!";
std::cin >> get;
}
else
{
if (get == 10)
{
std::cout << "Yes, correct!";
std::cin >> get;
}
else
{
std::cout << "Why, it's always wrong?";
std::cin >> get;
}
}
}
x++;
}
}
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
Can you give me a code example?
|
|
|
|
|
Programm3r wrote: while (x < get) {
x++;
}
that can end in an infinite loop.
|
|
|
|
|
I was aiming for a very simple concept .....
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
i repeat : don't do successive if s like this. use else if instead
|
|
|
|
|
Your logic is still wrong, however.
The get variable can only be greater than, less than, or equal to 10, so there is no need to check for all three conditions.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
what means x++ ?
And is int x = 0 better then int x;
x = 0;
?
with code while (x < get) loop continues 10 times
|
|
|
|