| View previous topic :: View next topic |
| Author |
Message |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
Posted: Fri Oct 04, 2002 8:57 am Post subject: |
|
|
Well, there nothing wrong, as far as I can see...
The only thing is that if you've pressed the Address edit that will be the selection till you selected something else a few times... |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Fri Oct 04, 2002 9:06 am Post subject: |
|
|
That's the point, it's kinda flaky. I'm sure it can
be fixed, but it doesn't really impress folks when
ya post buggy code then brag how fast ya did it...
Cheers, Mac  _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
 |
|
| Back to top |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
Posted: Fri Oct 04, 2002 9:16 am Post subject: |
|
|
Oops, sorry Mac...
I didn't see that little bug when I posted that code, so I tought that it was an easy prblem to solve...
Next time I will test it before posting... |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Fri Oct 04, 2002 9:25 am Post subject: |
|
|
No problem.  _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
 |
|
| Back to top |
|
 |
VDSuser Contributor


Joined: 21 Mar 2002 Posts: 58 Location: Somewhere in time
|
Posted: Fri Oct 04, 2002 2:53 pm Post subject: |
|
|
Hey, I'm back. Looks like you guys have been busy. Gotcha thinkin', didn't I?
Anywho, here's a snippet of my code. I can't see any reason why this shouldn't work. Whenever I click TrayIcon, though, I get an "Invalid parameter to command" error on my WINDOW statement, be it ACTIVATE or SEND. Oddly, I do not get the error when I step thru the code.
| Code: |
%t = MyProg
title %t
:evloop
repeat
wait .01
%e = @event()
if @not(@equal(@winactive(),%t))
%x = @winactive()
end
until %e
goto %e
:TrayIconCLick
if @equal(@click(b),LEFT)
window activate,%x
window send,%x,@ctrl(c)
list create,1
list paste,1
list copy,1
list close,1
else
dialog popup, Exit MyProg
end
goto evloop
:Exit MyProgMENU
:Close
stop
|
Why doesn't it work? Am I just being stupid again? |
|
| Back to top |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
Posted: Fri Oct 04, 2002 5:28 pm Post subject: |
|
|
Maybe you should make the wait a little longer, like 1 or something...
Btw. You don't have to use window activate,%x, cause the next line will past it into the given window... |
|
| Back to top |
|
 |
VDSuser Contributor


Joined: 21 Mar 2002 Posts: 58 Location: Somewhere in time
|
Posted: Fri Oct 04, 2002 6:12 pm Post subject: |
|
|
All that happens when I extend the WAIT is that the error takes longer to pop up.
I put the WINDOW ACTIVATE in as a "couldn't hurt" line. In or out, the error remains.
*sigh* |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Fri Oct 04, 2002 6:52 pm Post subject: |
|
|
When ya click on a task icon (and it's program window
remains hidden), it causes @winactive() to be NULL.
That's prolly what's causing your error.
I'd make the program with a tiny window and only one
button (hilight text then click the button)...
| Code: |
rem -- Run only one instance --
if @winexists("Copy")
EXIT
end
OPTION SCALE, 96
OPTION DECIMALSEP, "."
TITLE By Mac
DIALOG CREATE,"Copy",0,0,45,15,SMALLCAPS,ONTOP,CLICK
DIALOG ADD,BUTTON,B1,0,0,45,15," "
DIALOG SHOW
LIST CREATE, 1
:EVLOOP
REPEAT
WAIT ".01"
if @both(@winactive(), @not(@equal(@winactive(), "Copy")))
%w = @winactive()
end
%e = @event()
UNTIL %e
goto %e
:B1BUTTON
if %w
WINDOW SEND, %w, @ctrl(C)
LIST PASTE, 1
LIST COPY, 1
end
goto EVLOOP
:CLOSE
EXIT
|
EDIT - Changed to use Skit's approach. Also, this must be
compiled to work properly.
Cheers, Mac  _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
 |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Fri Oct 04, 2002 7:57 pm Post subject: |
|
|
Modified the code above to use Skit's approach.
Couldn't get it to work on a task icon alone though.
Also, it MUST be compiled to work properly.
Cheers, Mac  _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
 |
|
| Back to top |
|
 |
VDSuser Contributor


Joined: 21 Mar 2002 Posts: 58 Location: Somewhere in time
|
Posted: Mon Oct 07, 2002 6:43 pm Post subject: |
|
|
Well, gollygeewowbob, it works! (Not that I ever doubted you, Mac. )
I'll play and tweak for a while and if my final code doesn't embarrass me, I'll post it here.
Thanks everyone. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|