Page 1 of 2 12>
Topic Options
#140359 - 2005-05-26 07:31 PM Start Menu Query
Arkane Offline
Getting the hang of it

Registered: 2004-08-14
Posts: 50
Loc: Bath, UK
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.

Top
#140360 - 2005-05-27 08:10 PM Re: Start Menu Query
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
eh, so what you are actually wanting to do?
dublicate start menu?

if the person already has that folder in his start menu, wouldn't he use it instead of the form?
_________________________
!

download KiXnet

Top
#140361 - 2005-05-28 12:52 PM Re: Start Menu Query
Arkane Offline
Getting the hang of it

Registered: 2004-08-14
Posts: 50
Loc: Bath, UK
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.
Top
#140362 - 2005-05-28 08:16 PM Re: Start Menu Query
NTDOC Administrator Offline
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.

 

Top
#140363 - 2005-05-28 09:32 PM Re: Start Menu Query
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Just create a shortcut to the Accessories folder on the desktop.
_________________________
There are two types of vessels, submarines and targets.

Top
#140364 - 2005-05-29 12:51 PM Re: Start Menu Query
Arkane Offline
Getting the hang of it

Registered: 2004-08-14
Posts: 50
Loc: Bath, UK
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.
Top
#140365 - 2005-05-30 12:56 AM Re: Start Menu Query
NTDOC Administrator Offline
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.

 
 

 


 
 
Break On
$sAppVer = '1.0 5/15/2005'
$sKiXVer = SubStr(@KIX,1,4)
$sKiXMin = '4.23'
$sKFMin = '2.4.0.45'



If $sKiXVer < $sKiXMin
$sMsg = MessageBox('This Script requires at least KiXtart '+$skiXMin,'Version Check',4112)
Quit 1
EndIf



If @ERROR Or CheckKiXformsVersion($sKFMin) < $sKFMin
$sMsg = MessageBox('This Script requires at least KiXforms '+
$sKFMin+@CRLF+'Current version is: '+CheckKiXformsVersion(),'Version Check',4112)
Quit 1
EndIf



$System = CreateObject("Kixtart.System")



;************* Form **************
$Form = $System.Form()
$Form.Icon = 19
$Form.BorderStyle = 1
$Form.BackColor = 212,208,200
$Form.Height = 250
$Form.Center
$Form.Text = "Application Launcher"
$Form.Width = 350
;**************************************



;************* GroupBox_Selection **************
$GroupBox_Selection = $Form.Controls.GroupBox()
$GroupBox_Selection.BackColor = 212,208,200
$GroupBox_Selection.Height = 200
$GroupBox_Selection.Left = 0
$GroupBox_Selection.Text = "Select application"
$GroupBox_Selection.Top = 0
$GroupBox_Selection.Width = 340
;**************************************



;************* ComboBox2 **************
$ComboBox = $GroupBox_Selection.Controls.ComboBox()
$ComboBox.DropDownWidth = 125
$ComboBox.Height = 150
$ComboBox.Left = 15
$ComboBox.Sorted = "False"
$ComboBox.Text = "Select"
$ComboBox.Top = 25
$ComboBox.Width = 121
$ComboBox.onclick = 'SelectItem()'
;**************************************



;************* Label **************
$Label = $GroupBox_Selection.Controls.Label()
$Label.Bounds = 150,25,175,100
$Label.Text = ''
$Label.Visible = 0
;**************************************



;************* Button **************
$Button = $GroupBox_Selection.Controls.Button()
$Button.Bounds = 200,160,75,25
$Button.Text = 'E&xit'
$Button.Visible = 1
$Button.onclick = "ExitClick()"
;**************************************

;Start application additions here
$Excel = 'Excel',ReadValue('HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\excel.exe','')
$WinWord = 'Winword',ReadValue('HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\winword.exe','')


Select
Case InGroup('Group_A')
$ComboBox.AddItem($Excel[0])
$ComboBox.AddItem($WinWord[0])
Case 1
; User not found in any group
$ComboBox.AddItem('Error')
EndSelect


$Form.Show
While $Form.Visible
$=Execute($Form.DoEvents())
Loop
Exit 0


Function SelectItem()
Dim $Msg
Select
Case $ComboBox.Text='Excel'
Run $Excel[1]
Case $ComboBox.Text='Winword'
Run $Winword[1]
EndSelect
If $ComboBox.Text='Error'
$Label.Text = 'Your group membership was unable to be determined ' + @CRLF +
'Please contact the Helpdesk for assistance'
Else
$Label.Text = 'The system will now launch ' + $ComboBox.Text
EndIf
$Label.Visible = 1
EndFunction



Function CheckKiXformsVersion(optional $KFMin)
Dim $KFDll,$KFVer,$objSystem,$Main
If Not $KFMin $KFMin="2.3.0.45" EndIf
$KFDll=ReadValue('HKCR\CLSID\{F89DF848-618A-46F9-8A1C-396EA442BDD3}\InprocServer32','')
If @ERROR
$CheckKiXformsVersion=@ERROR
Exit $CheckKiXformsVersion
EndIf
$KFVer=GetFileVersion($KFDll,'BinFileVersion')+GetFileVersion($KFDll,'SpecialBuild')
If @ERROR
$CheckKiXformsVersion=@ERROR
Exit $CheckKiXformsVersion
EndIf
If $KFVer < $KFMin
Exit 13
EndIf
$objSystem = CreateObject("Kixtart.System")
$Main=$objSystem.Form()
If @ERROR
$CheckKiXformsVersion=@ERROR
Exit $CheckKiXformsVersion
EndIf
$CheckKiXformsVersion=$KFVer
EndFunction

Function ExitClick()
Quit()
EndFunction


 


Edited by NTDOC (2005-05-30 01:15 AM)

Top
#140366 - 2005-05-30 12:28 PM Re: Start Menu Query
Arkane Offline
Getting the hang of it

Registered: 2004-08-14
Posts: 50
Loc: Bath, UK
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)
Top
#140367 - 2005-05-30 12:55 PM Re: Start Menu Query
iffy Offline
Starting to like KiXtart

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


Edited by iffy (2005-05-30 12:59 PM)

Top
#140368 - 2005-05-31 02:37 AM Re: Start Menu Query
NTDOC Administrator Offline
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.

 

Top
#140369 - 2005-05-31 02:40 AM Re: Start Menu Query
NTDOC Administrator Offline
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?

 

Top
#140370 - 2005-05-31 11:29 AM Re: Start Menu Query
Arkane Offline
Getting the hang of it

Registered: 2004-08-14
Posts: 50
Loc: Bath, UK
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.

Top
#140371 - 2005-05-31 01:39 PM Re: Start Menu Query
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Can you not get away with opening the folder in explorer during login?
Code:
Run '"'+%COMSPEC%+'" /c explorer /root,"'+%USERPROFILE%+'\Start Menu\Programs\Maths"'


Top
#140372 - 2005-05-31 03:32 PM Re: Start Menu Query
Arkane Offline
Getting the hang of it

Registered: 2004-08-14
Posts: 50
Loc: Bath, UK
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.
Top
#140373 - 2005-05-31 04:25 PM Re: Start Menu Query
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
You could get really funky and use IE in "explorer / kiosk" mode:
Code:
Run '"'+%COMSPEC%+'" /c "c:\program files\internet explorer\iexplore.exe" -e -k "'+%USERPROFILE%+'\Start Menu\Programs\Maths"'


Top
#140374 - 2005-05-31 06:01 PM Re: Start Menu Query
iffy Offline
Starting to like KiXtart

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
Top
#140375 - 2005-05-31 06:43 PM Re: Start Menu Query
Arkane Offline
Getting the hang of it

Registered: 2004-08-14
Posts: 50
Loc: Bath, UK
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.
Top
#140376 - 2005-05-31 07:15 PM Re: Start Menu Query
Arkane Offline
Getting the hang of it

Registered: 2004-08-14
Posts: 50
Loc: Bath, UK
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?)
Top
#140377 - 2005-05-31 11:24 PM Re: Start Menu Query
iffy Offline
Starting to like KiXtart

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.
Top
#140378 - 2005-06-01 12:07 AM Re: Start Menu Query
Arkane Offline
Getting the hang of it

Registered: 2004-08-14
Posts: 50
Loc: Bath, UK
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.

Top
Page 1 of 2 12>


Moderator:  Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 778 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.101 seconds in which 0.063 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org