View previous topic :: View next topic |
Author |
Message |
Serge Professional Member
Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Fri Sep 23, 2005 2:42 am Post subject: Better Group Syntax |
|
|
i would like a way of being able to specify which elements belong to which group as the current set up is very frustrating when you have groups of the same size on top of each other, groups i show and hide depending on what the user wants to do ... in doing so, i can't get the right elements displayed in the right group because any element found within the boundaries of a group are automatically associated with that group ... ggrr!!!
can i suggest something like:
DIALOG ADD, BUTTON,BUTTON1,10,10,40,30,Quit,,GROUP1
with GROUP1 being an optional tag?
serge _________________
|
|
Back to top |
|
|
vdsalchemist Admin Team
Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Tue Sep 27, 2005 12:02 am Post subject: |
|
|
Serge,
Take a look at using the SetParent Win32 API function and Set the parent of the elements you want to the group window you want them on _________________ Home of
Give VDS a new purpose!
|
|
Back to top |
|
|
Serge Professional Member
Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Tue Sep 27, 2005 12:10 am Post subject: |
|
|
thanks for the tip but i have no idea how to do what you suggest ... i never looked into Win32 API and the bits i have seen posted seem very confusing to me
thanks for the tip though
serge _________________
|
|
Back to top |
|
|
vdsalchemist Admin Team
Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Tue Sep 27, 2005 12:23 am Post subject: |
|
|
Sorry Serge,
Heres some code that might help...
Code: | LoadLib user32.dll
DIALOG CREATE,New Dialog,-1,0,458,289
REM *** Modified by Dialog Designer on 9/26/2005 - 20:15 ***
DIALOG ADD,GROUP,GROUP1,27,41,368,214,GROUP1
DIALOG ADD,BUTTON,BUTTON1,91,104,,,BUTTON1
DIALOG ADD,EDIT,EDIT1,95,185,180,19,EDIT1
DIALOG ADD,GROUP,GROUP2,96,107,235,108,GROUP2
DIALOG ADD,BUTTON,BUTTON2,141,125,,,BUTTON2
DIALOG ADD,EDIT,EDIT2,143,215,,,EDIT2
DIALOG SHOW
Wait 5
%%group1hwnd = @Strdel(@winexists(~GROUP1),1)
%%group2hwnd = @Strdel(@winexists(~GROUP2),1)
%%button1hwnd = @Strdel(@winexists(~BUTTON1),1)
%%BUTTON2hwnd = @Strdel(@winexists(~BUTTON2),1)
%A = @lib(user32,SetParent,DWORD:,%%button1hwnd,%%group2hwnd)
%A = @lib(user32,SetParent,DWORD:,%%button2hwnd,%%group1hwnd)
:evloop
wait event
%E = @event()
If %E
goto %E
End
goto evloop
:CLOSE
FreeLib user32
Exit
|
Notice how Button2 moved to group1 and Button1 moved to group2 even though the order of creation would have normally placed button1 on group1 and button2 on group2 _________________ Home of
Give VDS a new purpose!
|
|
Back to top |
|
|
vdsalchemist Admin Team
Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Tue Sep 27, 2005 12:28 am Post subject: |
|
|
Serge,
I added a Wait after the dialog show so you could actually see the buttons move to their new parent group. Also this will not work with the VDS text element since it has no window handle. _________________ Home of
Give VDS a new purpose!
Last edited by vdsalchemist on Tue Sep 27, 2005 12:29 am; edited 1 time in total |
|
Back to top |
|
|
Serge Professional Member
Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Tue Sep 27, 2005 12:28 am Post subject: |
|
|
that is excellent, dragonsphere
i have downloaded the script and will add it to my script, it would be nice to have something like this native to VDS though
thanks again
serge _________________
|
|
Back to top |
|
|
vdsalchemist Admin Team
Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Tue Sep 27, 2005 12:32 am Post subject: |
|
|
Actually I agree with you. All of the VDS elements should have a way to tell them which dialog or element you would like to add the element too.
Then there would be no need for the Dialog Select command. _________________ Home of
Give VDS a new purpose!
|
|
Back to top |
|
|
Serge Professional Member
Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Tue Sep 27, 2005 12:39 am Post subject: |
|
|
can i ask you a question about your new gadget?
i need to be able to set a folder permission so that an exe file can be run from within it and for the exe file to be able to write to a data file within it but users cannot access that folder, does your gadget thingy have a thingy that will enable me to do that?
serge _________________
|
|
Back to top |
|
|
vdsalchemist Admin Team
Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Tue Sep 27, 2005 1:01 am Post subject: |
|
|
Serge,
I think what you are asking is if it would be possible to execute your program using different user credentials than the user that is currently using the PC. I think I could look up some code to do this. Actually I think that CodeScript posted some code that would allow you to do that but I think it was pretty complicating to understand how to use it.
Let me see if I can write a simple wrapper for this and get back with you on it when I have it working.
Serge, here is a link to CodeScripts Run As DSU http://www.vdsworld.com/search.php?view_mode=filelist&author_id=313&sid=8fcc936481109eb58c0d2d9b2c5e6550
From the discription he says it is possible to use a admin userid and passoword to give your program Admin rights. I have not used it so I really don't know how it works but I have seen other similar code in Visual Basic, C/C++, and Delphi. They seem to work great. _________________ Home of
Give VDS a new purpose!
Last edited by vdsalchemist on Tue Sep 27, 2005 1:06 am; edited 1 time in total |
|
Back to top |
|
|
Aslan Valued Contributor
Joined: 31 May 2001 Posts: 589 Location: Memphis, TN USA
|
Posted: Tue Sep 27, 2005 1:03 am Post subject: |
|
|
I have found that if you put an element into a part of the group you want it to be associated with where its not anywhere in another group during creation, you can then immediately move it to the position you actually want it to be and it will still remain attached to that group. |
|
Back to top |
|
|
vdsalchemist Admin Team
Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Tue Sep 27, 2005 1:09 am Post subject: |
|
|
Aslan wrote: | I have found that if you put an element into a part of the group you want it to be associated with where its not anywhere in another group during creation, you can then immediately move it to the position you actually want it to be and it will still remain attached to that group. |
Aslan,
You are correct but when you are hiding and showing groups and elements over and over again in a large project it can get confusing which element goes to which group and since VDS uses the default processing for the group element the child elements don't always go where you think they logically should.
Also try moving around elements, groups, and Tabs in Dialog Designer and you will see the confussion and issues involved in dealing with nesting elements inside of other elements. _________________ Home of
Give VDS a new purpose!
|
|
Back to top |
|
|
Serge Professional Member
Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Tue Sep 27, 2005 1:23 am Post subject: |
|
|
marty,
i need to be able to set permissions to the folder and not to the program itself ... i have read the windows help file on how to do it and can't get it right
what i want is for the administrator to set the permissions and then no user can access the contents of the folder although the program can happily run
this is for my Canary program that monitors computer use and Internet access ... i want the parents and teachers to access the folder but not the kids while the program runs from within the folder unrestricted
i had a quick look at codescript's thingy and it associates administrator rights to a program, not what i need
thanks in advance
serge _________________
|
|
Back to top |
|
|
vdsalchemist Admin Team
Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Tue Sep 27, 2005 1:26 am Post subject: |
|
|
Serge wrote: | Does your gadget thingy have a thingy that will enable me to do that? |
Serge,
Can I use the Quote above as a FAQ for my Gadget Thingy?
The short answer is "Yes!".
The long answer is "My Gadget Thingy 'not to sound obsene here ' is a DLL that acts as a gateway between VDS and the Windows OS". It does not really have a specific single command or function to perform such a specific job. Rather it gives you the programmer the tools to build what you want. Sort of like you can't build a house with just a single hammer but if you combine a toolchest full of tools then with the correct knowledge of how to use those tools you can build virtually anything you want. My GadgetX.dll is the ToolChest but you must have the knowledge or know where to get the knowledge to use the tools that it has. This is why it is taking me so long to finish it. I want to pass on the knowledge "i.e. ... instructions to the tools in the toolchest". The first version of my DLL was just too complex so I have done a lot of work to change this. _________________ Home of
Give VDS a new purpose!
|
|
Back to top |
|
|
Serge Professional Member
Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Tue Sep 27, 2005 1:39 am Post subject: |
|
|
Quote: | Serge,
Can I use the Quote above as a FAQ for my Gadget Thingy? |
not a problem!
i will now look forward to your new gadget.dll to see if i can work with it to do what i need
you are right about the first version being too complicated ... i downloaded it and had a look at it and then thought 'there is no way i am going to learn how to use this' ... so i hope the new version will be easier to use
any idea on the release date?
sorry for calling you marty, got confused with another post i made at the same time
serge _________________
|
|
Back to top |
|
|
vdsalchemist Admin Team
Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Tue Sep 27, 2005 1:43 am Post subject: |
|
|
Serge wrote: | marty,
i need to be able to set permissions to the folder and not to the program itself ... i have read the windows help file on how to do it and can't get it right
what i want is for the administrator to set the permissions and then no user can access the contents of the folder although the program can happily run
this is for my Canary program that monitors computer use and Internet access ... i want the parents and teachers to access the folder but not the kids while the program runs from within the folder unrestricted
i had a quick look at codescript's thingy and it associates administrator rights to a program, not what i need
thanks in advance
serge |
Serge,
Ok now I get what you are trying to do BTW my name is Johnny and it might be a sin ... hehehehe
Anyway if your program logs in with administrator credentials then when that program creates a folder and assigns rights to that folder then it is like you loging in as the administrator user and creating the folder and assigning rights to that folder.
When a program takes on the credentials of a user rather it be the Administrator or a general user the program inherits all the same previleges as the user it is impersonating. The issue is if the program has to call another process that does not inherit the calling processes rights then the sub-process will not be able to do the administrator's wishes. _________________ Home of
Give VDS a new purpose!
|
|
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
|
|