Solved

idle function and event in pb6.5

Posted on 2004-03-21
24
1,062 Views
Last Modified: 2013-12-26
hi friends,

I m facing very strange behaviour of pb.I m working with pb6.5 (build 444) on windows2000 (service pack 4 installed). I created one test application in which only one window object is there. And following scripts i have written in the application

OPEN EVENT:
open(w_idle_test)
idle(5)

IDLE EVENT:
halt close

now running the application it opens window w_idle_test and starts timer for the idle event to fire.so after 5 seconds it should close the application if the appln is idle.
But it's not happening !!!! B'coz my mouse is on the window. If i will remove my mouse from the window area to anywhere else, it will execute the idle event after 5 seconds idle time. It's really strange. It took 2 hours to find out the reason and accedently i come to know about the reason. Is It Bug ? OR any configuration settings in windows2000.
0
Comment
Question by:sandeep_patel
  • 9
  • 6
  • 4
  • +3
24 Comments
 
LVL 1

Expert Comment

by:sandhiyaa
ID: 10647696
Hi,
I have checked with my application ,it works fine.
check the followings,these may reset your time:

A mouse movement or mouse click in any window of the application
¨      Any keyboard activity when a window of the PowerBuilder application is current
¨      A mouse click or any mouse movement over the icon when a PowerBuilder application is minimized
¨      Any keyboard activity when the PowerBuilder application is minimized and is current (its name is highlighted)
¨      Any retrieval on a visible DataWindow that causes the edit control to be painted

0
 
LVL 14

Author Comment

by:sandeep_patel
ID: 10649638
hi sandhiyaa,
i checked all these things as it is given in the pb help. For the testing i have created a new appln and only window in that apln. no code anywhere else except application open event and idle event...but it's not working....if u want a test pbl i can send u and u can check...but remember i m working on pb6.5 (build 444) and windows2000. have u tested on the same ?

thanks for reply,
0
 
LVL 8

Expert Comment

by:Vikas_Dixit
ID: 10650009
Sandeep,

I have a small question.. will not the line
 idle(5)
be executed after you close your main window w_idle_test ??
And as soon as you close w_idle_test, you will be exited out of the App... so there's no chance that Idle event will be fired...
 Try calling Idle() before you open the window..

idle(5)
open(w_idle_test)

Regards,
VIkas
0
 
LVL 8

Expert Comment

by:Vikas_Dixit
ID: 10650054
Well,,
I was just confused, The Idle(5) will be executed in your case also..
--vikas
0
 
LVL 8

Expert Comment

by:Vikas_Dixit
ID: 10650222
I remember we used to work on PB version 6.5.1 .... May be there's some problem with pb6.5
-Vikas
0
 
LVL 15

Expert Comment

by:namasi_navaretnam
ID: 10653686
Hello Sandeep,

Could you not use Sleep WIN API. ?

Sleep( )
This function tells the OS to ignore the current thread for X number of milliseconds.  The screen will not be redrawn while this API call is active.   This is the same as running a for-next loop from within PowerBuilder.

Global External Function:
SUBROUTINE Sleep(ulong milli) LIBRARY "Kernel32.dll"

Script:
ulong l_delay
l_delay = 2000
Sleep(l_delay)

Regards-
0
 
LVL 8

Expert Comment

by:Vikas_Dixit
ID: 10654570
I guess Sleep will not work as required........
You can try puting some control like a groupbox on the window, and see if the problem persists.

Regards,
Vikas
0
 
LVL 1

Expert Comment

by:sandhiyaa
ID: 10655062
i too use PB6.5,but windows 98
send me the pble let, me check
0
 
LVL 5

Expert Comment

by:berXpert
ID: 10658195
Hi,

try this:

1. In your application OPEN even just open your window

OPEN EVENT:
open(w_idle_test)

IDLE EVENT:
halt close

2. In your window w_idle_test ACTIVATE event set idle function

ACTIVATE EVENT:
idle(5)



Hope it helps
berX
0
 
LVL 14

Author Comment

by:sandeep_patel
ID: 10731245
hello friends,
i did all the stuffs that all u told....

actually my requirement is that if the application is idle for the certain period, it should popup the login screen, so no one can do anything without entering the password of the currnet logged in user...it's like screen saver password....user don't want to use default lock computer facility of the windows2000 :)

so namasi i don't want to use sleep function here...

but i found that the problem is with windows2000 OS.
i done the same with pb6.5, pb7.0 and pb9.0...
same problem is still there...in my office i tested on two different computers having same windows2000 OS.

but at my home i have windows2000 with pb7.0..and there it's working fine....no any problem...

so is there any OS or system configuration required for this ????

it's urgent.....

thanks for any help that can solve my problem...

-sandeep

0
 
LVL 15

Expert Comment

by:namasi_navaretnam
ID: 10737176
I misunderstood the question initially. I tried the same under windows 2000 (service pack 3) using PB 8. Works irrespective where the mouse is.
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 8

Expert Comment

by:Vikas_Dixit
ID: 10738166
Don't rellay have an idea what may be the cause...
It may be something to do with some process/service running on you two servers..
Try stopping the services/processes one by one...
Or try putting code ( may be a messagebox or write something.. may be current time.. to a file) in the mouse related/Activate event and see if they are being fired continuously when the mouse pointer is over your app window.

Regards,
VIkas
0
 
LVL 15

Expert Comment

by:namasi_navaretnam
ID: 10738196
Sandeep,
VIkas's suggestion is very good. Perhaps you want to run the pb trace and see if there any continuous activities. Your home PC, Work PC run same version of Windows right (inluding service pack). Have you tried with a simple app to test.?

regards-
0
 
LVL 14

Author Comment

by:sandeep_patel
ID: 10746809
hi vikas,
your suggestion is really fine...i wrote the code in the activate event and mousemove event of window to create log file with date and time in it.

integer li_FileNum

li_FileNum = FileOpen("C:\idle.txt", StreamMode!, Write!, LockWrite!, Append!)
filewrite(li_filenum,'~r~nmouse:'+String(today(),'dd/mm/yyyy hh:mm:ss'))
fileclose(li_filenum)

though my mouse is not moving this code is being executed continously...following is the content of file for the reference

activate:03/04/2004
mouse:03/04/2004 12:35:24
mouse:03/04/2004 12:35:25
mouse:03/04/2004 12:35:25
mouse:03/04/2004 12:35:25
mouse:03/04/2004 12:35:25
mouse:03/04/2004 12:35:25
mouse:03/04/2004 12:35:27
mouse:03/04/2004 12:35:27
mouse:03/04/2004 12:35:27
mouse:03/04/2004 12:35:27
mouse:03/04/2004 12:35:27
mouse:03/04/2004 12:35:27
mouse:03/04/2004 12:35:27
mouse:03/04/2004 12:35:27
mouse:03/04/2004 12:35:30
mouse:03/04/2004 12:35:30
mouse:03/04/2004 12:35:30
mouse:03/04/2004 12:35:30
mouse:03/04/2004 12:35:30

so it's sure that something is working in background...by the time if you or anyone found any hint u can post...thanks again to u all for then help. meanwhile i m checking the root cause...

-sandeep
0
 
LVL 8

Expert Comment

by:Vikas_Dixit
ID: 10746870
Hi sandeep,

Just also try printing the ypos, xpos and flag argument.. and see if they change at all..
Also go through the mouse setting and see if you find something strange there...
Try to make it same as what is there on your Home PC..

Regard,
Vikas D
0
 
LVL 14

Author Comment

by:sandeep_patel
ID: 10750922
thanks vikas,
atleast i got the root cause of the problem

yup, it is due to the service pccntmon.exe !!!!

if the service is running, in the background something is happening with mouse. Following is the output if the service is running....

activate:04/04/2004
mouse:04/04/2004 09:43:41  X-827  Y-320  flags-0
mouse:04/04/2004 09:43:41  X-827  Y-320  flags-0
mouse:04/04/2004 09:43:41  X-827  Y-320  flags-0
mouse:04/04/2004 09:43:43  X-827  Y-320  flags-0
mouse:04/04/2004 09:43:45  X-827  Y-320  flags-0
mouse:04/04/2004 09:43:48  X-827  Y-320  flags-0
mouse:04/04/2004 09:43:53  X-827  Y-320  flags-0
mouse:04/04/2004 09:43:58  X-827  Y-320  flags-0

time to fire idle event is 5 seconds and see mousemove event is fired without any change in x-pos,y-pos or flags !!!!

once i stop the service it's working fine...but i can't stop this service

what else we can try ?

0
 
LVL 8

Expert Comment

by:Vikas_Dixit
ID: 10751438
Great  !!!!!!!

You can submit a bug at trendmicro...... :).. Or try getting the latest version of it ......
May be this process is sending mouse events to all the active window ?? Whay would it do that ?
Else we may need to think of a work-around... to simulate the idle function.

-Vikas

0
 
LVL 15

Expert Comment

by:namasi_navaretnam
ID: 10753216
Wow, Learnt something new today.

See this link. There is a removal utility.
http://www.2-spyware.com/file-pccntmon-exe.html


0
 
LVL 8

Expert Comment

by:Vikas_Dixit
ID: 11135402
Hi sandeep,

Just being curious, did you find any fix for this...?

Vikas
0
 
LVL 14

Author Comment

by:sandeep_patel
ID: 11161176
Hi Vikas,

I reported the bug to sybase...also i send them the sample application....but they r not giving quick response....they have not assigned the higher priority for the bug....so i m waiting for the solution from them....

Right now i had cancelled to give such facility to user :(

Wait and Watch

0
 
LVL 8

Expert Comment

by:Vikas_Dixit
ID: 11166678
Thanks sandeep !

Have u also tried putting it up with trendmicro... It seems to be their app that is creating the problem...

--Vikas
0
 
LVL 14

Author Comment

by:sandeep_patel
ID: 12482842
hi,
still the problem is not solved...and i don't think sybase will give any solution so u can do whatever u like....

-sandeep
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 12520222
PAQed with points refunded (100)

Computer101
EE Admin
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

In our object-oriented world the class is a minimal unit, a brick for constructing our applications. It is an abstraction and we know well how to use it. In well-designed software we are not usually interested in knowing how objects look in memory. …
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org (http://seleniumhq.org) Go to that link and select download selenium in the right hand columnThat will then direct you to their downlo…
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now