-
I am creating a program that will run in the systray and when the user clicks the icon a menu of files will appear.
When the user selects a file the file will open in it's respective app (like Word or Excel).
I want to be able to give the user the option to add files to the list so they will be available next time he starts the app.
I'm betting that this will require some type of data file for the app to read and write to, but I don't have any experience with this...Any suggestions? :confused:
Also, I would like to allow the user to customize the layout of the menu so that he can arrange frequently used files at the bottom and even add spaces between groups of file items ...Any suggestions here? :confused:
Thanks guys and girls!!! :)
-
Do u mean u want to make something similar to "Documents" from the start menu?
if so u could use an ini file to store the names and paths of the files, which would also add the customizability you want(as long as the users know how to edit ini files).
-
No, I want the process of adding and moving list items to be as transparent and user friendly as possible. Adding files will be done through user interaction with dialog boxes and customizing appearance and layout through drag and drop.
Imagine an icon in the systray, when it is right clicked I want a popup menu to provide options like 'Add File', 'Organize File List', 'Launch File(s)', and 'Exit'. When the icon is double clicked, I want a popup menu containing a list of files and sub-groups of multiple files to appear. The user can then select a file or group of files to open.
This program will do about the same thing as the MS Office shortcut bar but will run from the system tray. The MS shortcut bar uses a folder full of shortcuts and allows the user to customize the name and layout of the shortcuts on the shortcut bar. Does anyone know how to do something like this?
All help will be very much appreciated. :)
-
well i think when u dbl click you should make a form come up with a listbox and the form is resize to the size of the listbox ...
when u load the form you will input data from a data file to the list box ...
u should look at sequential files in vb so u learn about inputing n outputing info
-
A form with only a listbox would be just like a popup menu right? How would you go about sizing the listbox to its contents and then the form to the listbox? Or allow the user to rearrange the list items and/or create file subgroups?
I'll play around with this and the sequential file stuff. :cool:
Any other input will be gladly accepted...
Thanks MAN :)
-
To be honest, I have no idea what this code does. MSDN says:
The CreateMenu function creates a menu. Play around, see what you get. Someone correct me if this does something else
Code:
Public Type MENUITEMINFO
cbSize As Long
fMask As Long
fType As Long
fState As Long
wID As Long
hSubMenu As Long
hbmpChecked As Long
hbmpUnchecked As Long
dwItemData As Long
dwTypeData As String
cch As Long
End Type
Public Declare Function CreateMenu Lib "user32" Alias "CreateMenu" () As Long
Public Declare Function InsertMenuItem Lib "user32" Alias "InsertMenuItemA" (ByVal hMenu As Long, ByVal un As Long, ByVal bool As Boolean, ByRef lpcMenuItemInfo As MENUITEMINFO) As Long
Public Declare Function AppendMenu Lib "user32" Alias "AppendMenuA" (ByVal hMenu As Long, ByVal wFlags As Long, ByVal wIDNewItem As Long, ByVal lpNewItem As Any) As Long
-
with following code you can open the associated program (like doubleclicking on the file in the explorer)
Code:
'function to start file with associated program
Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Dim lngResult As Long
Dim sFile As String
sFile = "c:\temp\test.xls"
'this will open excel
lngResult = ShellExecute(hwnd, "Open", sFile, "", "", vbNormalFocus)
-
Thanks C@lle, That works great and easy! :)
Do you, or anyone, know of any good book to check out for explanations of .dll functions?
Like what each .dll can do for you and how???
That would be cool! :cool:
Thanks again,
:)