|
DavidCrow wrote: I usually open a dozen or so browser windows with various CP threads.
How do you do that? Can you email the code?
led mike
|
|
|
|
|
Is it urgent?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: Is it urgent?
If you have to ask you don't understand anything about the codes
led mike
|
|
|
|
|
OMFG[^]
Fishing season is OPEN!
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
|
Mark Salsbery wrote: Fishing season is OPEN!
Didn't you get the memo? The season opens on January 1st at 00:00:00 and closes on December 31st at 24:59:59
Here's another[^]
led mike
|
|
|
|
|
Good one, thanks!
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
AbortSystemShutdown()
http://msdn2.microsoft.com/en-us/library/aa376630(VS.85).aspx[^]
Sample Usage:
BOOL AbortShutdown(LPTSTR lpMachineName)
{
HANDLE hToken;
TOKEN_PRIVILEGES tkp;
BOOL fResult;
if (!OpenProcessToken(GetCurrentProcess(),
TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken))
{
TRACE("OpenProcessToken failed.\n");
return false;
}
LookupPrivilegeValue(lpMachineName, SE_SHUTDOWN_NAME,
&tkp.Privileges[0].Luid);
tkp.PrivilegeCount = 1;
tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
AdjustTokenPrivileges(hToken, FALSE, &tkp, 0,
(PTOKEN_PRIVILEGES)NULL, 0);
if (GetLastError() != ERROR_SUCCESS)
{
TRACE("AdjustTokenPrivileges(setting) enable failed.\n");
return false;
}
fResult = AbortSystemShutdown(lpMachineName);
if (!fResult)
{
TRACE("AbortSystemShutdown failed.\n");
return false;
}
else
m_bIsShuttingDown = false;
tkp.Privileges[0].Attributes = 0;
AdjustTokenPrivileges(hToken, FALSE, &tkp, 0,
(PTOKEN_PRIVILEGES) NULL, 0);
if (GetLastError() != ERROR_SUCCESS)
{
TRACE("AdjustTokenPrivileges(re-setting) disable failed.\n");
return false;
}
return true;
}
|
|
|
|
|
|
Mark Salsbery wrote: Service Control Handler Function[^]
Sounds more like a candidate for the Buzzword hall of shame forum.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Rajesh R Subramanian wrote: Mark Salsbery wrote:
Service Control Handler Function[^]
Sounds more like a candidate for the Buzzword hall of shame forum.
Nope , it's actually a very concise description of the subject at hand - the specifics of the function which handles control messages for a service. MS surprisingly actually titled the page with meaningful text.
Judy
|
|
|
|
|
Thanks everyone for the help. The AbortShutdown() is what I was looking for. I know about the WM_QUERYENDSESSION message and how to handle it. Originally, I was looking for a way to get around the hidden window in my service, but because I have to interact with my user, I must use it.
|
|
|
|
|
If anyone can please write a simple function using the low-level keyboard hook WH_KEYBOARD_LL i would greatly appreciate it, although i use boralnd builder 6 instead of visual the concepts are still the same, i would apprciate a function that sets/unsets the hook and just a simple hook declaration, i've read the post/topics about it but i just cant seem to get it to work. help please
|
|
|
|
|
There's an article here[^] which demonstrates the same.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
codinelogic wrote: i've read the post/topics about it but i just cant seem to get it to work.
Show us what you've tried.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
defines and includes included [hehe]
<br />
#define WIN32_LEAN_AND_MEAN<br />
<br />
#define STRICT<br />
<br />
#include <windows.h><br />
<br />
HHOOK hKeyboardHook;<br />
HINSTANCE hInst;
and than the hook along with the on off function..
LRESULT CALLBACK LowLevelKeyboardProc(int nCode, WPARAM wParam, LPARAM lParam) <br />
{<br />
PKBDLLHOOKSTRUCT k;<br />
<br />
if (nCode == HC_ACTION) <br />
{<br />
k = (PKBDLLHOOKSTRUCT) lParam;<br />
<br />
if (
here is where i will choose to disable keys
return 1;<br />
}<br />
<br />
return CallNextHookEx(hKeyboardHook, nCode, wParam, lParam);<br />
}
the turn on...
hKeyboardHook = SetWindowsHookEx(WH_KEYBOARD_LL,<br />
LowLevelKeyboardProc,<br />
hInst,<br />
0);
the turn off..
UnhookWindowsHookEx(hKeyboardHook);<br />
hKeyboardHook = NULL;<br />
a note: without define strict i receive an error in the lpfn parameter.
also it will compile without win23_lean_and_mean but while reading
other's articles it seemed recomended.
|
|
|
|
|
If you are receiving a compiler error, what is it, and what line is it on?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Editor VS6
Language:VC++
my task is to run the DOS cmd from my application (ie on button click)and redirect the output in my applications Edit box without showing the console window
how to do it ...........
Code is preffered
AbidBhat
|
|
|
|
|
abid wrote: Code is preffered
I bet, but around here we prefer people write their own code. Read the first post in forum titled "How to get an answer to your question".
led mike
|
|
|
|
|
abid wrote: how to do it ...........
See here and here.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I have problem in SDK/ MFC.
I have to assign/map 'Down' or 'Up' arrow key to a specific character suppose letter 'D' or 'U' or any other character. So that when i press 'D' or 'U', it acts or function like a Up or Down arrow key..
How can i do this, please help me.
Thanks in advance..
|
|
|
|
|
You want such functionality within your application or system-wide? If it is just your application, overriding PreTranslateMessage() may help you.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Handle the 'D' or 'U' and call the same code that you call when handling the 'up' or 'down' keys.
|
|
|
|
|
Maximilien wrote: call the same code that you call when handling the 'up' or 'down' keys.
He may not have any code to be called while the up or down arrow keys are pressed. I understand that his requirement was to just simulate an up arrow key press while 'U' is pressed and down arrow key press if 'D' is pressed.
Also, how do you handle 'D' or 'U'? Say, if there are multiple child controls in the application window, those child controls may be having the keyboard focus!
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Hi,
How can I change the background color of CToolBar ?
Regards,
Paresh.
modified on Monday, February 18, 2008 1:17 AM
|
|
|
|