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 


Handle Function

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Advanced Wish List
View previous topic :: View next topic  
Author Message
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Tue Jul 29, 2003 5:28 pm    Post subject: Handle Function Reply with quote

I get tired of typing "@strdel(@winexists(#MyWin),1,1)" every time I want
to use my window with an API. Could @winexists() just return the handle
without the percent (%) sign? Smile

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1054
Location: India

PostPosted: Tue Jul 29, 2003 5:45 pm    Post subject: Reply with quote

I think
Me.hwnd
Me.hdc like VB would be nice.

there a some other things too that need to be added to make calling Non VDS dlls and API easier.

Also the way bitmap element is drawn You cannot get its DC - device context. So many things related to that is not possible.
Also it seems that cursors/bitmaps from resources cannot be loaded into memory using API for unkown reasons. Hiword/loword/hibit/lobit. Some more I cannot remember right now. I think these need be added.

_________________
Regards
- CodeScript
Arrow Give your application a professional look with the VDSGUI Extension
Back to top
View user's profile Send private message Visit poster's website
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Wed Jul 30, 2003 9:17 am    Post subject: Reply with quote

hi ff,

why don't you use the CODE TEMPLATE section of vds which you can access from the ide using ctrl+J...very handy utility!

serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Wed Jul 30, 2003 1:25 pm    Post subject: Reply with quote

Oops, I forgot about that Serge Very Happy I will try that. But still it would be nice
to just have @winexists() return it without the % sign, and have an optional
parameter to have it return with the % sign. Most advanced programming
is done with handles that don't have the percent sign. Smile

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Wed Jul 30, 2003 4:25 pm    Post subject: Re: Handle Function Reply with quote

FreezingFire wrote:
I get tired of typing "@strdel(@winexists(#MyWin),1,1)" every time I want
to use my window with an API. Could @winexists() just return the handle
without the percent (%) sign? Smile


You can also just make a function to do this for you...
Code:

#DEFINE FUNCTION,WINEXISTSEX

DIALOG CREATE,My Dialog,-1,0,200,100
DIALOG SHOW

Info This is the dialog's Window Handle @WinExistsEx(My Dialog)
Stop

:WINEXISTSEX
  %%Return = @strdel(@winexists(%1),1)
Exit %%Return

_________________
Home of

Give VDS a new purpose!
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
jules
Professional Member
Professional Member


Joined: 14 Sep 2001
Posts: 1043
Location: Cumbria, UK

PostPosted: Thu Jul 31, 2003 3:29 pm    Post subject: Reply with quote

The reason for this is VDS variables are all one type. You can call the window functions with a window title, a class or a handle as the argument. VDS needs the % to know that the number that follows is a handle, and a # to know that what follows is a class. Everything else is treated as a title.
_________________
The Tech Pro
www.tech-pro.net
Back to top
View user's profile Send private message Visit poster's website
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Thu Jul 31, 2003 8:27 pm    Post subject: Reply with quote

It's fine, but couldn't some output processing take place to fix this? Smile
_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
PGWARE
Web Host


Joined: 29 Dec 2001
Posts: 1537

PostPosted: Thu Jul 31, 2003 8:29 pm    Post subject: Reply with quote

I'm not sure what you mean by fixing it. It's not a bug, Julian explained why the % is required. When you use several vds functions that require an external window to be defined you can either pass a Title, Class or a Handle, to distinguish between the three you use a % for handles and # for window classes, anything else is considered a title.
Back to top
View user's profile Send private message
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Thu Jul 31, 2003 8:32 pm    Post subject: Reply with quote

No I don't think it's a bug, but I mean could the output be processed for
the return value? Perhaps I am misunderstanding something. This is
a function for the developer, not VDS itself. I am confused now. Confused

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
Skit3000
Admin Team


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

PostPosted: Fri Aug 01, 2003 8:43 am    Post subject: Reply with quote

So you want to have some kind of parameter like A(PI) next to the ones who already exist ? Smile

Example:
@winexists(#MyWin,A)

_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
jules
Professional Member
Professional Member


Joined: 14 Sep 2001
Posts: 1043
Location: Cumbria, UK

PostPosted: Fri Aug 01, 2003 9:18 am    Post subject: Reply with quote

I think what needs to be borne in mind here is that making API calls is something only a minority of people will do. For VDS internal window functions, what it does makes sense. It doesn't make sense to complicate VDS functions for everyone just to save a line of code for people using APIs. You could write a VDS function to return the window handle in API format, and then call that every time instead of the standard one...
_________________
The Tech Pro
www.tech-pro.net
Back to top
View user's profile Send private message Visit poster's website
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Fri Aug 01, 2003 1:05 pm    Post subject: Reply with quote

Skit3000 wrote:
So you want to have some kind of parameter like A(PI) next to the ones who already exist ? Smile

Example:
@winexists(#MyWin,A)


Yes that's exactly what I'm talking about. Thanks for seeing that. I don't
see what the big problem is and this is my wish. If so many people are
going to be closed-minded about this I guess I just won't wish for it anymore.

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
PGWARE
Web Host


Joined: 29 Dec 2001
Posts: 1537

PostPosted: Fri Aug 01, 2003 1:55 pm    Post subject: Reply with quote

I don't think we are trying to be close-minded but isn't this a very simple thing to achieve with currently. I could understand if it took a few lines of code but it's really simple as it is now:

Code:
@strdel(@winexists(#WindowName), 1)



Sure not as 'pretty' as Skits' code but it does exactly what your looking for all on one line.
Back to top
View user's profile Send private message
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Fri Aug 01, 2003 1:59 pm    Post subject: Reply with quote

OK Please forgive me, I just feel that I'm just being told that it will never
happen. I really don't think it's a majorly needed feature. Sorry Jules and
PGWARE for saying people were closed-minded I was just feeling kind of
bad about this whole thing.

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Advanced Wish List All times are GMT
Page 1 of 1

 
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