| View previous topic :: View next topic |
| Author |
Message |
Alexander Aliev Guest
|
Posted: Tue Apr 18, 2006 7:03 am Post subject: Win32 error |
|
|
Hi,
I have the following little problem: when my vcl-application
working and I lock the computer then after unlocking
a message box appears (header - my application):
Win32 Error. Code: 5
Access denied.
What can be the reason?
Thank you for any help.
Alexander |
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Tue Apr 18, 2006 10:03 am Post subject: Re: Win32 error |
|
|
"Alexander Aliev" <ali (AT) isa (DOT) ru> wrote in message
news:4444845f$1 (AT) newsgroups (DOT) borland.com...
| Quote: | Win32 Error. Code: 5
Access denied.
What can be the reason?
|
Your description is much too vague. You need to provide more details. What
is your application doing? At what point in the code does the error occur?
Gambit |
|
| Back to top |
|
 |
Alexander Aliev Guest
|
Posted: Tue Apr 18, 2006 10:03 am Post subject: Re: Win32 error |
|
|
| Quote: | ... At what point in the code does the error occur?
|
I have a handler for Application->OnIdle. There is a line in it:
TPoint p = Mouse->CursorPos;
which is highlighted when error and I click my handler in stack
window. Next called functions in stack are not mine. Here is
the upper part of stack window:
\WINDOWS\system32\kernel32.dll
Sysutils::RaiseLastWin32Error
Sysutils::Win32Check
Controls::TMouse::GetCursorPos
What's wrong? Or I can't take cursor position if PC is locked?
What is a way round then?
TIA,
Alexander |
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Tue Apr 18, 2006 7:03 pm Post subject: Re: Win32 error |
|
|
"Alexander Aliev" <ali (AT) isa (DOT) ru> wrote in message
news:4444b07f (AT) newsgroups (DOT) borland.com...
| Quote: | I have a handler for Application->OnIdle. There is a line in it:
TPoint p = Mouse->CursorPos;
which is highlighted when error
|
You are not allowed to access the desktop while the PC is locked. Your
OnIdle event handler is likely being triggered before the PC is fully
unlocked.
| Quote: | Or I can't take cursor position if PC is locked?
|
Nope.
| Quote: | What is a way round then?
|
Don't use the TMouse::CursorPos property. Call the Win32 API GetCursorPos()
function directly instead. Then you can do your own error checking in your
code and avoid the exception that the CursorPos property is throwing.
Gambit |
|
| Back to top |
|
 |
|