After a session has started up, I can press the Button under CPU views to record method statistics.
Is there a way to make method statistics recording start automatically after starting up the session, and not need to press that Button manually?
Using a trigger could achieve this requirement.
Setting a trigger
Related
If I go to JProfiler->CPU views->Call tree and press on Record CPU, I can detect easily which methods are called when I do a specific action in my application.
If I am doing a different action, I'd like to clear the previous results from the view. Does JProfiles has such a feature?
Just stop and start CPU recording, the results will then be cleared.
I'm building an application using vb.net that should record some specific user actions, one of these actions is the screen shutdown, is there a way to do that? Maybe a system event or something that i can check periodically to know if the screen is active or not.
I've already found some code to check if the screensaver is running but i want to know if there's a way to detect if the screen is phisically turned off.
I have an issue with WindowsHookEx in vb.net. If my pc is overloaded especially from 3D rendering, windows automatically disconnects my keyboard hook and my hotkeys stop working. I searched around and it seems that there is no way to detect whether a hook is active or disconnected. So I tried this method presented by "moodforaday"
Is it possible to detect when a low-level keyboard hook has been automatically disconnected by Windows?
hook-has-been-automatically-d
He states that using GetLastInputInfo periodically and store GetLastInputInfo to another variable when a key is used and compare the results. If the tick is much newer than your older variable then its likely that its disconnected. Its a great method but the ticks can go up from other things like the mouse. In my Hook class there is no Mouse hook therefore I cannot store a variable of the tick count when the mouse is moved. So now I ended up having it create a new instance of the hook class and hook again. It checks every second if the stored tick is older than new tick by 10000 ticks.
Is it alright to keep creating new instances of Hooks? It will keep Hooking/Unhooking constantly and I'm wondering if that is going to be a problem for Windows.
Also if anyone has another method to detect if a hook is disconnected please let me know would fix this whole hassle.
Do your 3D rendering in a background thread. Use Control.Invoke only for code where you directly access UI controls.
Alternately, you could split the rendering into very small pieces and post them to yourself as messages, to be handled on the main thread. This way you will be able to handle both internal and external messages.
In both cases, your application will be responding in a timely fashion, Windows will have no reason to consider it non-responding, and your keyboard shortcuts will stay in place.
How to trigger close event for Rebol Console to execute some custom handler before one quit the console ?
Well, I don't understand why you need this. If you're running a script from the console, then surely your script "knows" when it is about to quit.
Maybe you're after a system shutdown or similar? In that case you need to look at the system ports.
See http://www.rebol.org/ml-display-thread.r?m=rmlNFFJ
for an example of trapping the shutdown event for different OSes.
AFAIK REBOL doesn't offer a hook for that. And if you wanted to do it with a system port hook, you would have to have an event loop running.
If you have behavior you want to trigger, the first thing I would do is add a simple SHUTDOWN mezzanine, to replace QUIT, and do your work there. You could view that as a feature or a limitation, meaning the user can avoid your logic by using the close button if they want.
I am trying to display wait cursor (spinning rainbow wheel) by using "QDDisplayWaitCursor" function, but I get a warning that "QDDisplayWaitCursor" is deprecated, however everything runs fine but I would like to replace it with proper alternative of this function but I didnt find any google result and also in apple docs.
The best thing to do is to use something else1:
The spinning wait cursor is displayed automatically by
the window server when an application
cannot handle all of the events it
receives. If an application does not
respond for about 2 to 4 seconds, the
spinning wait cursor appears. You
should try to avoid situations in your
application in which the spinning wait
cursor will be displayed.
Instead use progress indicators, in a window- or application-modal way if neccessary.