iconize window
- Detlef Hoefner
- Posts: 312
- Joined: Sat Oct 08, 2005 9:12 am
- Location: Germany
- Contact:
iconize window
Hi all,
I want to activate a timer in the moment a window is iconized to the taskbar.
Since there is no ON ICONIZE clause, i don't know what event i can use.
Thanks for any hint,
Detlef
I want to activate a timer in the moment a window is iconized to the taskbar.
Since there is no ON ICONIZE clause, i don't know what event i can use.
Thanks for any hint,
Detlef
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
>Or use ON RESIZE.
A good idea, but the timer would be triggered for any resize not just iconizeng.
Detlef, I do wonder what you are attempting to do? What if they don't iconize it but merely switch to another application? I rarely iconize an app, but just switch to another using the taskbar.
If you are trying to find out if the app is inactive, then I think you are going to have to monitor the event handler or something.
James
A good idea, but the timer would be triggered for any resize not just iconizeng.
Detlef, I do wonder what you are attempting to do? What if they don't iconize it but merely switch to another application? I rarely iconize an app, but just switch to another using the taskbar.
If you are trying to find out if the app is inactive, then I think you are going to have to monitor the event handler or something.
James
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
I have this working code in my programs:
........ ON RESIZE WinResize(oWnd) .......
I use this not for starting timer but for other purposes. this works for starting a timer also
........ ON RESIZE WinResize(oWnd) .......
Code: Select all
STATIC FUNCTION WinResize( oWnd )
IF IsIconic( oWnd:nWnd )
// my code what to do when first iconized
ELSE
// do what is needed here
ENDIF
RETURN .T.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- Detlef Hoefner
- Posts: 312
- Joined: Sat Oct 08, 2005 9:12 am
- Location: Germany
- Contact:
Enrico and James,
thank you for jumping in.
As James said, "on resize" would trigger the timer start every time a user resizes the window of my app.
The intention is the following:
In our company there are 5 workstations which create invoices.
If a new invoice has been created a popup window with a browse should open to show the most recent invoices which not yet have been printed.
My timer looks in 5 different dbf files for new invoices. If he found one i do deactivate the timer.
So the user can start all printing and optical storage routines.
When he is finished he will collapse the app window into the task bar.
For the moment i have a extra button to iconize.
But our users are usesd to click on the iconize symbol.
That's my problem.
Regards,
Detlef
thank you for jumping in.
As James said, "on resize" would trigger the timer start every time a user resizes the window of my app.
The intention is the following:
In our company there are 5 workstations which create invoices.
If a new invoice has been created a popup window with a browse should open to show the most recent invoices which not yet have been printed.
My timer looks in 5 different dbf files for new invoices. If he found one i do deactivate the timer.
So the user can start all printing and optical storage routines.
When he is finished he will collapse the app window into the task bar.
For the moment i have a extra button to iconize.
But our users are usesd to click on the iconize symbol.
That's my problem.
Regards,
Detlef
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
- Detlef Hoefner
- Posts: 312
- Joined: Sat Oct 08, 2005 9:12 am
- Location: Germany
- Contact:
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
This is not true. ON RESIZE automatically provides nSizeType that can be any of the following values:James Bott wrote:>Or use ON RESIZE.
A good idea, but the timer would be triggered for any resize not just iconizeng.
Code: Select all
#define SIZE_RESTORED 0
#define SIZE_MINIMIZED 1
#define SIZE_MAXIMIZED 2
#define SIZE_MAXSHOW 3
#define SIZE_MAXHIDE 4
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
Detlef,
>If a new invoice has been created a popup window with a browse should open to show the most recent invoices which not yet have been printed.
I assume you mean that the app is iconized (or better, not in focus) when this window pops up? Is this so they know there is a new invoice to handle? Wouldn't you really want a popup notice of a new invoice even if the app isn't iconized and they were working in it?
Is this happening on all 5 workstations? Are any one of the five people supposed to handle the new invoice? Can't the invoices just be printed automatically without user intervention?
>My timer looks in 5 different dbf files for new invoices.
Hmm. You have a different DBF for each workstation? Why? Can't you put them all in the same DBF?
>If he found one i do deactivate the timer. So the user can start all printing and optical storage routines. When he is finished he will collapse the app window into the task bar.
I don't see why you would need to deactivate the timer. After the timer routine finds a new invoice it pops up the window, then ignores that new invoice and starts looking for another. If the timer isn't checking too often (say once a minute), it isn't going to affect the performance of the program while the user is working. That way while they are working it would still notify them of a new invioce.
>For the moment i have a extra button to iconize.
>But our users are usesd to click on the iconize symbol.
As I mentioned in my previous message, lots of users are just going to click on another task on the taskbar or open another task on the menu--this is one less click than iconizing then clicking on another task. There is no need to iconize an app.
I think there are better ways to handle your problem.
James
>If a new invoice has been created a popup window with a browse should open to show the most recent invoices which not yet have been printed.
I assume you mean that the app is iconized (or better, not in focus) when this window pops up? Is this so they know there is a new invoice to handle? Wouldn't you really want a popup notice of a new invoice even if the app isn't iconized and they were working in it?
Is this happening on all 5 workstations? Are any one of the five people supposed to handle the new invoice? Can't the invoices just be printed automatically without user intervention?
>My timer looks in 5 different dbf files for new invoices.
Hmm. You have a different DBF for each workstation? Why? Can't you put them all in the same DBF?
>If he found one i do deactivate the timer. So the user can start all printing and optical storage routines. When he is finished he will collapse the app window into the task bar.
I don't see why you would need to deactivate the timer. After the timer routine finds a new invoice it pops up the window, then ignores that new invoice and starts looking for another. If the timer isn't checking too often (say once a minute), it isn't going to affect the performance of the program while the user is working. That way while they are working it would still notify them of a new invioce.
>For the moment i have a extra button to iconize.
>But our users are usesd to click on the iconize symbol.
As I mentioned in my previous message, lots of users are just going to click on another task on the taskbar or open another task on the menu--this is one less click than iconizing then clicking on another task. There is no need to iconize an app.
I think there are better ways to handle your problem.
James
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
- Detlef Hoefner
- Posts: 312
- Joined: Sat Oct 08, 2005 9:12 am
- Location: Germany
- Contact:
James,
thanks for your thorough thoughts about my problem.
I know that there are better ways to handle this task.
But this would end in a deep redesign of our invoicing system.
Unfortunatelly my boss would only accept such work if it would be done in a week
So i must must find a quick ( and dirty ) solution for my problem.
Enrico helped me with his information about nSizeType which i didn't know before.
Thanks Enrico and James,
Detlef
thanks for your thorough thoughts about my problem.
I know that there are better ways to handle this task.
But this would end in a deep redesign of our invoicing system.
Unfortunatelly my boss would only accept such work if it would be done in a week
So i must must find a quick ( and dirty ) solution for my problem.
Enrico helped me with his information about nSizeType which i didn't know before.
Thanks Enrico and James,
Detlef
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
Detlef,
>So i must must find a quick ( and dirty ) solution for my problem.
>Enrico helped me with his information about nSizeType which i didn't know before.
OK, I understand. However, checking for iconized is not going to tell you if they just switched to another app (without iconizing), so the bLostFocus/bGotFocus system would be a better solution and doesn't require any more work.
However, I still think you should just run the timer all the time. I don't see any problem with that. This should require even less work.
You should be able to do either one in an hour or less.
James
>So i must must find a quick ( and dirty ) solution for my problem.
>Enrico helped me with his information about nSizeType which i didn't know before.
OK, I understand. However, checking for iconized is not going to tell you if they just switched to another app (without iconizing), so the bLostFocus/bGotFocus system would be a better solution and doesn't require any more work.
However, I still think you should just run the timer all the time. I don't see any problem with that. This should require even less work.
You should be able to do either one in an hour or less.
James
-
- Posts: 824
- Joined: Thu Oct 13, 2005 7:39 am
- Location: Germany
Detlef,
try the following
It should work
try the following
Code: Select all
ACTIVATE WINDOW ::oWnd ;
;//ON INIT ;
ON RESIZE If( nSizeType == SIZE_MINIMIZED, <StartTimer>, <EndTimer> ) ;
VALID ::End()
kind regards
Stefan
Stefan