forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Copy Selection - Is it possible?
Goto page Previous  1, 2
 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Fri Oct 04, 2002 8:57 am    Post subject: Reply with quote

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
View user's profile Send private message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Fri Oct 04, 2002 9:06 am    Post subject: Reply with quote

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 Smile

_________________
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
View user's profile Send private message Send e-mail
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Fri Oct 04, 2002 9:16 am    Post subject: Reply with quote

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
View user's profile Send private message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Fri Oct 04, 2002 9:25 am    Post subject: Reply with quote

No problem. Wink
_________________
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
View user's profile Send private message Send e-mail
VDSuser
Contributor
Contributor


Joined: 21 Mar 2002
Posts: 58
Location: Somewhere in time

PostPosted: Fri Oct 04, 2002 2:53 pm    Post subject: Reply with quote

Hey, I'm back. Looks like you guys have been busy. Gotcha thinkin', didn't I? Smile

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
View user's profile Send private message
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Fri Oct 04, 2002 5:28 pm    Post subject: Reply with quote

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
View user's profile Send private message
VDSuser
Contributor
Contributor


Joined: 21 Mar 2002
Posts: 58
Location: Somewhere in time

PostPosted: Fri Oct 04, 2002 6:12 pm    Post subject: Reply with quote

All that happens when I extend the WAIT is that the error takes longer to pop up. Laughing

I put the WINDOW ACTIVATE in as a "couldn't hurt" line. In or out, the error remains.

*sigh*
Back to top
View user's profile Send private message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Fri Oct 04, 2002 6:52 pm    Post subject: Reply with quote

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. Wink

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 Smile

_________________
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
View user's profile Send private message Send e-mail
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Fri Oct 04, 2002 7:57 pm    Post subject: Reply with quote

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 Smile

_________________
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
View user's profile Send private message Send e-mail
VDSuser
Contributor
Contributor


Joined: 21 Mar 2002
Posts: 58
Location: Somewhere in time

PostPosted: Mon Oct 07, 2002 6:43 pm    Post subject: Reply with quote

Well, gollygeewowbob, it works! (Not that I ever doubted you, Mac. Wink )

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
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

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group