I'm wondering how I can use KIX/KixForms to create a form which has a single 'folder' within which is the same part of the start menu. E.g. if the folder is called 'Accessories', then the contents of that folder would point to the 'Accessories' group in start menu, double-clicking on an item in that box would either expand it (if a folder) or run it (if a shortcut). Is this possible to do with KiX and KiXForms? If so, would anyone be so kind enough as to give me a starter for 10 as I'm really unsure how to start this.
Not quite - I'm looking to take a pre-determined section of the start menu and present it as icons in a desktop window. So for example under Start\Programs\Accessories - things under there would be available in a program window on the desktop so if you double-clicked an icon, it would run the .lnk (or program associated with it), if you double-clicked a folder, it would open it in the window.
NTDOCNTDOC Administrator
Registered: 2000-07-28
Posts: 11629
Loc: CA
I think I'm with Lonkero on this one. Don't understand the purpose of re-creating a menu that is already there.
Now if you were taking and placing say half a dozen or whatever of heavily used or main business critical applications and placing them in there maybe, but even then the overhead of managing KF vs creating a specific Business Apps folder is also seemingly counter productive.
Are you wanting to do this to help learn to program KiXforms or ?????
If you just want shortcuts then there are a few UDFs designed to create shortcuts already.
The reason I need this is two-fold, 1) I like to use these little 'projects' that management throw at me to learn KiX and KiXforms better. 2) As we are in a school, the desktop and start menus must be as simple as possible. As we have various different suites of IT systems for different tasks, the start menu must contain everything in it, which makes it huge. Therefore we developed a HTML-based background that creates a window and houses specific icons in it. For example in a Maths' suite of PCs, it houses the specific Maths icons that would be found in the start menu. As Admins it means we don't have to spend countless hours customising desktops for each suite when the program we have does it for us - however management decided that this application (background) is too slow and increases 'start' time (the time when you can actually USE the computer) and in a new 'give them faster logons' idea, they decided to find a faster alternative. I decided to look at KiX as I've used it for various other projects and it works wonderfully. KiXforms to me is a new thing, I've only created 1 thing with it which is a 'change password' tool so teachers can change a student password from the desktop without having to grant them the MMC (which is good). As the start menu is huge (and we don't want to copy chunks of start menu at logon), we wanted something that would display a subset of icons in a predefined window (not traditional desktop icons). Is that any clearer? I know it sounds like an odd thing to want to build but my boss does like to throw challenges at me and I'd rather have a go at it than admit defeat. I could do it in VB but it's been years since I looked at VB and I'd rather not go back there.
NTDOCNTDOC Administrator
Registered: 2000-07-28
Posts: 11629
Loc: CA
Okay, well here then is an example using KiXforms. This is not an optimized piece of code and should really probably be controlled using a .INI file for flexibility. You might also want to use a different object depending on how you want the form to look. In this example the user MUST be located as a member of the 'Group_A' group. Modify this to the correct group for your usage.
Thanks for that NTDOC, I'll take a closer at it but it doesn't look like what I'm after. The biggest problem is that the app paths are hard coded - this is why I wanted a subset of the start menu, so all it had to do was enumerate the items somehow and then display them as icons in a window. So when you double-click one of them, it would be the same as using the start menu. I can enumerate the start menu but I have no idea how to take what I get (the .lnk files) and turn them into the same icons that I see on the start menu and make the icons it creates the same as the start menu ones - otherwise I'd have to create 2 sets of icons and that's really a no-go. (The start menu is in the same place for the whole domain though, so at least that's one plus)
Registered: 2005-05-29
Posts: 149
Loc: The Netherlands
Quote:
I can enumerate the start menu but I have no idea how to take what I get (the .lnk files) and turn them into the same icons that I see on the start menu and make the icons it creates the same as the start menu ones
I'm probably missing something entirely but if you can enumerate the start menu why can't you simply copy the shortcut to the desktop folder of the user?
Like this:
Code:
for each startmenu_entry if startmenu_entry = "app_I_want_on_desktop" copy startmenu_entry userprofile\desktop\startmenu_entry endif ... next
Edit: you might considering using a select/case instead of if/then
Edit2: nevermind me, I read desktop instead of desktop window so the above doesn't actually answer you question
NTDOCNTDOC Administrator
Registered: 2000-07-28
Posts: 11629
Loc: CA
You can grab what is already available by enumeration, but you said you didn't want to do a lot of copying etc...
Okay, different approach.
Move ALL the menus to a special folder such as C:\PRIVATE\Start Menu
Then setup the folders how you want. Then depending on which group a user is a member of, have a script copy the correct folders to the real locations, or to this new special folder you want.
I.e... create a MATH folder, a SCIENCE folder etc... then have the shortcuts you want already in there and copy/move them around depending on group membership.
Like I said above this was just an example and would probably not LOOK exactly what you were thinking of, but if you don't have the programming skills to complete it then that might be a rather difficult task to do as well.
Bottom line answer is YES it can be done, but you will need to do some of it and get the ball rolling.
I also don't typically advocate hard coding anything, but in your case I don't see what you really want for sure either. Every user will have all the same icons from the Accessories group, so why are you copying it? If there is no method to your madness with EXACT specifics then I'm not sure how any of us is going to be able to help you.
I'm willing to give you a hand, but so far you have not laid out enough exact specific information..
1. How many groups with different NEW SHORTCUTS are we talking about? 2. How many DIFFERENT SHORTCUT MENUS are we talking about? etc. etc. etc....
Please layout and define EXACTLY what it is you want, because so far I'm in the dark about your request.
NTDOCNTDOC Administrator
Registered: 2000-07-28
Posts: 11629
Loc: CA
Are you wanting to take and create a SINGLE FOLDER with all the available current SHORTCUTS from each menu and sub-menu and place them ALL into a SINGLE FOLDER without any menus.
Sort of like a Macintosh user's desktop looks like after they've had their system for a short while?
Okay, at current all user start menus are pointed to on the network. Each subject has it's own folder under the 'start menu\programs' part, within them are various icons and other folders. In short, a beast of a start menu. (Mentioning copying was just me getting confused)
The location of EVERY user points to this start menu on the network, however what I'd like is to create a small app that lives on the desktop and all that does is take a subset of the start menu (MATHS for example) and displays those items and folders in the program window. Reason for this is when a user logs in, if they're in a maths suite, they get maths icons right in front of them in a predefined window, so they don't need to surf around the start menu to find them (it's a very big start menu, but it's a very big school too). All the program window contains would be the subset of the start menu (MATHS, ENGLISH, etc..) and it's icons and folders within that root folder. Kinda like if you didn't have 'Start Menu\Programs' as the root folder of your start menu but had 'Start Menu\Programs\Maths' instead.
Not really, while that would be a very quick and painless way to do it, the reason we want a window is one without title bars, i.e. not your average explorer window. Just a frame with the icons in it would do wonders except it seems not as easy as it looks at first glance.
Registered: 2005-05-29
Posts: 149
Loc: The Netherlands
Now that is slowly becomes more clear what you want I am thinking that a kixforms listview in 'large icon' mode would probably provide what you want. I'd say get going with kixforms as almost anything is possible with kixforms + kixtart although it might get into the intermediate to advance level, but hey, that's what we are here for I guess
Richard: Thanks for the suggestion but we tried this one, the whole reason we can't use that is that the window must be statically sized (cannot be resized or messed with). I've written a recursive dir (I know there are UDFs for it but I wanted to try it myself), it seeks out the .lnk files (so crudely enumerates them), it would be easy to make it run these directly but it's the whole 'creating the window' and 'populating it with icons'... trick. I will have a blast with KixForms myself but I'm still learning KiX in my spare time (am getting on well with it tho, am already converting login scripts and solving other problems we have with it... it's great!). If anyone wants to be nice and give me a starter for 10 on how I could just get the icons in the window (in an icon sort of way) then it'd be great.
After a few minutes with Kixforms and Kix I've now got my window, it's ugly as sin and it doesn't do anything but the icons are there (well the text discriptions are). My next problem is how to get the actual icons out of the .lnk files and display them or would I need to use custom icons for this? (I assume to run the item that I have selected I just write an 'onClick' event for it, so it runs it using the pre-coded 'runner' that I wrote?)
Registered: 2005-05-29
Posts: 149
Loc: The Netherlands
Extracting the icon with KiX might be a challenge, perhaps best to search for a simple external utility to do that? The other stuff like target, startup dir etc seems to be accessable from a .lnk. See the UDF's EditShortCut and Unlink for a few hints. Together with some digging in the MSDN Library and Google you'll be getting somewhere Not for the faint of heart tho but perhaps the real guru's here see it as a 'project'... I'm unfortionately too short of time to do actual test coding.
Faint of heart hasn't ever bothered me - I have to work in a school full of kids who think the school network is a plaything for their amusement - it's just my small corner of the universe to dominate and control like any mis-guided network admin I will however check the UDFs you gave me, I've now managed to put icons in the FileView combo box, I can now also run the .lnk files directly, I just need to fix in a 'back' button, a 'home' button and redesign the form so it actually looks smooth rather than the evil thing it is. I should note that I'm using my own recursive-DIR function for this, all it does differently is that it detects directories and files and gives them different icons. Hopefully the UDFs you gave me will let me put the final pieces together. I posted a Q on MS's VB scripting forums regarding shortcut icons and targets, so hopefully they may have something, even if it's not in pure KiX or needs VBS/WMI then I'd rather do an 'all in' rather than shell out to an external tool to do some of the work. I'm sure in VB it's doable - but I don't know VB all that well, besides, I've started with KiX/KiXforms now - so I'll continue.