PDA

Click to See Complete Forum and Search --> : Microsoft does it.........why can't i?


noble
Dec 12th, 2000, 07:34 AM
Microsoft puts a textbox in a popup menu. Why can't I?
Does anyone know how this is done in MS Access? I would
like to imitate this same behavior w/o using a form to mimic the popup menu. There has got to be a way to do it
using the API!!!

Any and All help is greatly appreciated!!!!

PunK
Jan 9th, 2001, 06:15 PM
Well,,considering the fact that its, MICROSOFT!...and,,,they MADE IT!

JoshT
Jan 10th, 2001, 07:05 AM
Access doesn't seem to use the standard Windows menu. I think they're using something like the CoolBar control. I've never really used it, but I think you can put a textbox on it.

Josh

noble
Jan 10th, 2001, 09:09 AM
"Punk"...pointless post.


If you're not part of the solution,
you're part of the problem.


:P

noble
Jan 10th, 2001, 09:13 AM
Josh,
I used spy++ to watch Access do it's thing when I called the
menu. I don't remember exactly what it told me (because I
gave up on it) but I know it was something to the fact that
it was part of the appendMenu api or one of the similar API's.

I also emailed the maker of the "Genius" utility and he said
that's he's using delphi and the libraries he uses aren't
available to me as a vb programmer. I code in C++ also, so
I'm looking to maybe do this in C++.

PunK
Jan 10th, 2001, 03:05 PM
You mean PunK!

noble
Jan 11th, 2001, 12:06 PM
rofl!

Jan 11th, 2001, 02:40 PM
I agree with JoshT; they probably use a different class for the menu.

rippin
Jan 12th, 2001, 04:55 PM
Well, I can almost promise you that the AppendMenu function has nothing to do with it. I too believe that Microsoft is not playing fair here and using a popup window (of some sort) to simulate a menu, and thus can add just about anything they want to the "menu".

However, there is a API function GetWindowFromDC that, when used in conjunction with an owner-drawn menu (which most microsoft menus are), can give you a hwnd in exchange for a hdc. I have tested this and was able to add a textbox to a menu (by calling SetParent using the hwnd returned from GetWindowFromDC as the textbox's new parent), but the results were less than desirable. In order to do this though, you have to modify the menu item(s) to owner draw by using SetMenuItemInfo and the MF_OWNERDRAW flag, and then subclass the form for the WM_MEASUREITEM and WM_DRAWITEM window messages.

gwdash
Jan 12th, 2001, 08:03 PM
rippin, do you have some code to do this, or maybe you have made a DLL? If so, that would be great, i want to do this, but don't want to take the time to write this all out!

noble
Jan 16th, 2001, 06:21 AM
rippin,
thx a lot for the info. I figured that you gotta be able
to do it in some form. Go download a program called
Genius and check out some of the menus that it uses.....
You can find it on zdnet or any of those shareware sites.
The programmer told me he wrote it in delphi tho

later

crispin
Jan 16th, 2001, 08:49 AM
Guys
I was trying to do this, and got cheesed off so I spoke to Karl E Petersen and Bryan Stafford (Microsoft MVP's) about this, and they are pretty sure that MS (like Megatron said) have written a different class that behaves like a menu. Thats good enough for me...