|
-
Jun 6th, 2000, 03:08 AM
#1
Thread Starter
transcendental analytic
Here's some unanswered qwestions:
I rightclick a file in explorer and a context menu shows up:
1. How do i create submenus in a context menu
2. How do i put an icon (bitmap) next to my menu item in a context menu
3. How can i make files can be drag and dropped on another file (not application) like winzip does with files dropped on zip files?
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jun 6th, 2000, 03:13 AM
#2
Member
sorry that i cant remember which one, but there is an API call to place icons by the text in menu/context bars
-
Jun 6th, 2000, 03:13 AM
#3
kedaman
Fanatic Member
Registered: Mar 2000
Posts: 1288
----------
Come on smart kedaman, your telling me you dunno how to do that? Visit http://www.planetsourcecode.com to know all the answers .
-
Jun 6th, 2000, 03:31 AM
#4
Thread Starter
transcendental analytic
Well, if the other gurus didn't know, why should i know? Smart and smart, where did you get that from? That doesn't mean i don't know the answers. Thanks anyway i thought this would be a typical 0 replies post. I'm not sure if ever could find it at planetsourcecode as i have already searched it before about filetypes
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jun 6th, 2000, 03:40 AM
#5
Thread Starter
transcendental analytic
Ok! i found the one with making bitmaps added to context menus, but yet there are two Q's:
Submenus in context menu and drag and drop files on another file type...
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jun 6th, 2000, 04:07 AM
#6
Would you mind posting a link to were you found out how to do that for other people that might be wondering the same thing
-
Jun 6th, 2000, 06:38 AM
#7
Thread Starter
transcendental analytic
Well i lost it, i don't remember what i searched for
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jun 6th, 2000, 07:05 AM
#8
-
Jun 6th, 2000, 07:32 AM
#9
Let me answer this. How do you think we're competing? Because our numbers are close? Well if that's the case, I can find many people with posts close to yours.
Look at the date i was registered. MARCH 1999. It seems pretty reasonable that I should be this high.
-
Jun 6th, 2000, 07:39 AM
#10
Ok...I know that there are posts close to mine. Didn't mean to offend you. Both your names I see the most. I see your names so much, when I sleep..I see a sign that has the words "Kedaman" and "Megatron". lol...be honored, hehe
-
Jun 6th, 2000, 07:41 AM
#11
Thread Starter
transcendental analytic
Matthew, Actually I could have been Guru, like those others if i just joined in a bit earlier, if I only had over 1000 posts at that time when Gurus where chosen. I know, Aaron Young most be the Vb-God of this site, And what about Serge? He is also great.
No, i'm not competing, i like posting things, go look at the evolution threads, you see millions of posts, and each of them took me ten to hundred times more to write than a simple answer here in Q and A. And i haven't got a single post counted of them, but still i'm posting there.
Kedaman, it seems like you and Megatron are competing. hehe . May I ask, do you feel smart when you answer a post? Especially when you exactly right? Does it make you feel good? lol. Tell me these things. I wanna know everything!
Heh, Matthew, where do you want to get me? You can't possibly be helping people for another reason!!!!!
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jun 6th, 2000, 07:46 AM
#12
[quote]Both your names I see the most. I see your names so much, when I sleep..I see a sign that has the words "Kedaman" and "Megatron". lol...be honored,[/code]
No offense taken. You see our names because we have knowledge. Something some people don't have. Hint. Hint.
-
Jun 6th, 2000, 02:52 PM
#13
Hyperactive Member
-
Jun 6th, 2000, 02:57 PM
#14
Hyperactive Member
-
Jun 6th, 2000, 03:32 PM
#15
Fanatic Member
dropping files on a ICON or program is easy. use the command$ command for grabbing the files names.
To test it, chuck a label on a form and have the form load or sub main write Label1.caption = command$. I think the system throws the " chr around the path and file name. then compile and drag a file onto it, it opens and displays the file name. haven't tried multiple files but probably just delimited, easy to test.
Isn't a context menu just displaying a popup menu which is not displayed as a normal menu?
For bitmaps on menus, take a shortcut and get the controls from vbaccellerator (pardon the spelling) they have controls with source for popup menus too.
I thought you knew all this? is this an old post or something????
maybe I'm not understanding your questions, please re-write!
Why aren't you a GURU yet? I've seen other Guru's with only 1200 posts!
[Edited by Paul282 on 06-07-2000 at 04:34 AM]
Paul Dwyer 
Network Engineer
Aussie In Tokyo
Using Powerbasic 6 & VB6 SP4 (Please also add your VB Version to your signature!)
-
Jun 6th, 2000, 05:17 PM
#16
Addicted Member
I'll just poke a stick in the hornet's nest and comment on Gurus
There are 4 or 5 members with guru status and they really are.
How many of Aaron's 2000+ postings are questions?
How many of Clunietp's 1400+ postings are?
How many are idle chit chat?
I'd have a guess tht the total of these 3 questions can be shown on the fingers on one hand!
-
Jun 6th, 2000, 09:08 PM
#17
[QUOTE]Originally posted by Megatron
No offense taken. You see our names because we have knowledge. Something some people don't have. Hint. Hint.
Hey hey!! I know all! I hear all! I see all! Everyones mind is different. You may know more than me on certain subjects, but not all of them.
-
Jun 6th, 2000, 09:16 PM
#18
New Member
-
Jun 7th, 2000, 12:42 AM
#19
Thread Starter
transcendental analytic
Judd, i that wasn't what i was searching for - Context menu is the menu that popups in explorer when you click a file.
Paul, Hehe, either i was too bad at explaining or you missed it:
You see the zip file: you drag another file over it, and it shows a plus on the cursor. When you drop, it will launch winzip. The problem is (yeah i know that command stuff and how to make my file launched from explorer) that i need to the exactly same thing. In registry, root classes, you will find those shellex keys, i tried to copy all that but nothing worked. If anyone know what i'm talking about, please reply
Guru: HEre's all gurus:
http://forums.vb-world.net/memberlis...ers&perpage=10
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jun 7th, 2000, 01:28 AM
#20
Addicted Member
You can also design a menu using the "Menu Editor" in VB and then on the proper event Form_MouseDown, Form_Click, etc. you can use the [b]PopupMenu[/p] statment to display your menu.
-
Jun 7th, 2000, 01:31 AM
#21
Thread Starter
transcendental analytic
CONTEXT MENU, Jason this must be done in registry
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jun 7th, 2000, 11:20 AM
#22
Try this for the Drag/Drop Operation:
In an ActiveX DLL Project:
In a Class Module:
Code:
Public sFilename As String
'Must be Implemented by Drag/Drop Handlers
Implements IPersistFile
Implements IDropTarget
Private Sub IPersistFile_Load(ByVal pszFileName As Long, ByVal dwMode As Long)
'Get the name of the File being Dropped on
sFilename = String(lstrlenW(ByVal pszFileName), 0)
MoveMemory ByVal StrPtr(sFilename), ByVal pszFileName, LenB(sFilename)
End Sub
Private Function IPersistFile_GetCurFile() As Long
'
End Function
Private Sub IPersistFile_IsDirty()
'
End Sub
Private Sub IPersistFile_Save(ByVal pszFileName As Long, ByVal fRemember As Long)
'
End Sub
Private Sub IPersistFile_SaveCompleted(ByVal pszFileName As Long)
'
End Sub
Private Function IDropTarget_DragEnter(ByVal pDataObj As shlext.IDataObject, ByVal grfKeyState As Long, ByVal ptX As Long, ByVal pyY As Long) As shlext.DROPEFFECTS
Dim tFORMAT As FORMATETC
Dim tMEDIUM As STGMEDIUM
Dim nIndex As Long
Dim nFileCount As Long
On Error Resume Next
' Erase the array
Erase sFiles()
' Set the Format of the Data to Retrieve
With tFORMAT
.cfFormat = CF_HDROP
.TYMED = TYMED_HGLOBAL
.dwAspect = DVASPECT_CONTENT
End With
' Get the Data
pDataObj.GetData tFORMAT, tMEDIUM
' Get No. of Files
nFileCount = DragQueryFile(tMEDIUM.Data, -1, vbNullString, 0) - 1
ReDim Preserve sFiles(nFileCount)
' Get the File Names
For nIndex = 0 To nFileCount
sFiles(nIndex) = String$(260, 0)
DragQueryFile tMEDIUM.Data, nIndex, sFiles(nIndex), Len(sFiles(nIndex))
If InStr(sFiles(nIndex), vbNullChar) > 0 Then sFiles(nIndex) = Left$(sFiles(nIndex), InStr(sFiles(nIndex), vbNullChar) - 1)
Next
IDropTarget_DragEnter = DROPEFFECT_MOVE
' Release memory used by the Medium Type
ReleaseStgMedium tMEDIUM
End Function
Private Sub IDropTarget_DragLeave()
Erase sFiles
End Sub
Private Function IDropTarget_DragOver(ByVal grfKeyState As Long, ByVal ptX As Long, ByVal ptY As Long) As shlext.DROPEFFECTS
IDropTarget_DragOver = DROPEFFECT_MOVE
End Function
Private Function IDropTarget_Drop(ByVal pDataObj As shlext.IDataObject, ByVal grfKeyState As Long, ByVal ptX As Long, ByVal ptY As Long) As shlext.DROPEFFECTS
Dim nIndex As Long
Dim sFileList As String
'Do Whatever with the Dropped File(s)
sFileList = "Drop Target File: " & sFilename & vbCrLf & vbCrLf
For nIndex = 0 To UBound(sFiles)
sFileList = sFileList & sFiles(nIndex) & vbCrLf
Next
MsgBox sFileList, vbOKOnly, "File(s)"
IDropTarget_Drop = DROPEFFECT_MOVE
End Function
In a standard Module:
Code:
Public sFiles() As String
Public Declare Sub MoveMemory Lib "kernel32" Alias "RtlMoveMemory" (Dest As Any, Src As Any, ByVal L As Long)
Public Declare Function lstrlenW Lib "kernel32" (lpString As Any) As Long
You'll need a reference to a Type Library that has these Interfaces, (Thanks to Eduardo Morcillo for this) you can download it from VBAccelerator.com, he also has a site, but it wasn't coming up when I tried it.
Compile the DLL and Register it.
To use, add a key under your Registry Entry for the Extension as follows:
Code:
.Ext ----> {Default} = "Extension App Name"
Extension App Name
'---> ShellEx
'---> DropHandler - {Default} = "{CLSID}"
Where "{CLSID}" is the CLSID of your ActiveX DLL.
I believe the same concept would be how you'd achieve the Icons on the context Menu too, but I haven't explored the Context Interface as yet.
If you couldn't get it to work from the code I posted, let me know and I'll send you the project files.
- Aaron.
-
Jun 7th, 2000, 03:00 PM
#23
Thread Starter
transcendental analytic
Aaron Young! I knew it! If there is anyone that can answer it it must be him. Thanks!
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jun 7th, 2000, 03:05 PM
#24
Addicted Member
Aaron Young! I knew it! If there is anyone that can answer it it must be him. Thanks!
That is exactly what I mean when commenting on Gurus!
-
Jun 7th, 2000, 03:24 PM
#25
Hyperactive Member
-
Jun 7th, 2000, 03:32 PM
#26
Thread Starter
transcendental analytic
That's right, I haven't still done that scroller, if anyone is interested and want to get credit, just ask me and i'll send you the sample
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jun 7th, 2000, 03:58 PM
#27
Hyperactive Member
-
Jun 7th, 2000, 08:02 PM
#28
Thread Starter
transcendental analytic
Judd
Nope, it's adding items to the menu, the context menu popups always. Well, i guess it's not that important to have a submenu, but the drag and drop is really needed.
AARON!
It highlights:
Private Function IPersistFile_GetCurFile() As Long
And says:
Procedure declaration does not match description of event or procedure having the same name
when i try to compile it.
What's wrong?!
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jun 7th, 2000, 08:23 PM
#29
Hmmmm, perhaps I pointed you to the wrong version of the Type Library, when I return from Work, I will Email you my copy of it.
- Aaron.
-
Jun 7th, 2000, 08:33 PM
#30
Thread Starter
transcendental analytic
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|