View previous topic :: View next topic |
Author |
Message |
FreezingFire Admin Team
Joined: 23 Jun 2002 Posts: 3508
|
Posted: Tue Jul 29, 2003 5:28 pm Post subject: Handle Function |
|
|
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? _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
Back to top |
|
|
CodeScript Moderator Team
Joined: 08 Jun 2003 Posts: 1060 Location: India
|
Posted: Tue Jul 29, 2003 5:45 pm Post subject: |
|
|
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
Give your application a professional look with the VDSGUI Extension |
|
Back to top |
|
|
Serge Professional Member
Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Wed Jul 30, 2003 9:17 am Post subject: |
|
|
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 |
|
|
FreezingFire Admin Team
Joined: 23 Jun 2002 Posts: 3508
|
Posted: Wed Jul 30, 2003 1:25 pm Post subject: |
|
|
Oops, I forgot about that Serge 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. _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
Back to top |
|
|
vdsalchemist Admin Team
Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Wed Jul 30, 2003 4:25 pm Post subject: Re: Handle Function |
|
|
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? |
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 |
|
|
jules Professional Member
Joined: 14 Sep 2001 Posts: 1043 Location: Cumbria, UK
|
Posted: Thu Jul 31, 2003 3:29 pm Post subject: |
|
|
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 |
|
|
FreezingFire Admin Team
Joined: 23 Jun 2002 Posts: 3508
|
Posted: Thu Jul 31, 2003 8:27 pm Post subject: |
|
|
It's fine, but couldn't some output processing take place to fix this? _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
Back to top |
|
|
PGWARE Web Host
Joined: 29 Dec 2001 Posts: 1564
|
Posted: Thu Jul 31, 2003 8:29 pm Post subject: |
|
|
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 |
|
|
FreezingFire Admin Team
Joined: 23 Jun 2002 Posts: 3508
|
Posted: Thu Jul 31, 2003 8:32 pm Post subject: |
|
|
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. _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
Back to top |
|
|
Skit3000 Admin Team
Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
|
Back to top |
|
|
jules Professional Member
Joined: 14 Sep 2001 Posts: 1043 Location: Cumbria, UK
|
Posted: Fri Aug 01, 2003 9:18 am Post subject: |
|
|
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 |
|
|
FreezingFire Admin Team
Joined: 23 Jun 2002 Posts: 3508
|
Posted: Fri Aug 01, 2003 1:05 pm Post subject: |
|
|
Skit3000 wrote: | So you want to have some kind of parameter like A(PI) next to the ones who already exist ?
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 |
|
|
PGWARE Web Host
Joined: 29 Dec 2001 Posts: 1564
|
Posted: Fri Aug 01, 2003 1:55 pm Post subject: |
|
|
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 |
|
|
FreezingFire Admin Team
Joined: 23 Jun 2002 Posts: 3508
|
Posted: Fri Aug 01, 2003 1:59 pm Post subject: |
|
|
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 |
|
|
|