Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: onytoo
  Where is onytoo?
 Padang
 Indonesia
 onytoo
 To: Jijo Pappachan
  Where is Jijo Pappachan?
 Kerala
 India
 Jijo Pappachan
 Tags
Subject: RE: Visual Foxpro Professional 2011
Thread ID: 313901 Message ID: 313935 # Views: 154 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Other
Date: Friday, July 22, 2011 11:30:48 PM         
   


> >
> >
> > Yeah, I see it (.NET toolstrip), very good work Jijo.
> > I think you will need vfp2c32.fll for API stuff's, this is really good library.
> > Keep going!
> > I will follow this project :)
> >
> >
> > Regards,
> > Onytoo
>
> Hi Onytoo..
> Can you explain me how to check a menu bar item is ENABLED or not using GetMenuState()?
> I have made few changes in your example and stored return value from GETMENUSTATE() function.
> Always I am getting either 256 or 257. How to check menu item is enabled or not?
>
> Form MSDN
> ----------------------------
> http://msdn.microsoft.com/en-us/library/ms647982%28v=vs.85%29.aspx
>
> It is possible to test an item for a flag value of MF_ENABLED, MF_STRING, MF_UNCHECKED, or MF_UNHILITE. However, since these values equate to zero you must use an expression to test for them.
> Flag Expression to test for the flag
> MF_ENABLED ! (Flag&(MF_DISABLED | MF_GRAYED))
> MF_STRING ! (Flag&(MF_BITMAP | MF_OWNERDRAW))
> MF_UNCHECKED ! (Flag&MF_CHECKED)
> MF_UNHILITE ! (Flag&HILITE)
>
>

> But I am finding difficulties to test the bit values. Can you help me?
>
>
> 				*!* menu bar item
> 				If m.loMII.dwItemData != 0
> 					If m.loMII.fType != 0x800
> 						m.lcInfo = Sys(2600, m.loMII.dwItemData, 50)
> 						m.lnLen = CToBin(Substr(m.lcInfo, 5, 4), [4RS]) * 2
> 						m.lnAddr = CToBin(Substr(m.lcInfo, 9, 4), [4RS])
> 						m.lcCaption = Strconv(Sys(2600, m.lnAddr, m.lnLen), 6)
> *----------------MY CHANGES
> 						ln_state = GetMenuState(m.thMenu, m.lnIndex, MF_BYPOSITION)
> 						Insert Into csrMII Values (m.lcCaption, m.tnLevel, ln_state)
> 					Else
> 						Insert Into csrMII Values ("- - -", m.tnLevel, -1)
> 					Endif
> 				Else
> 					Insert Into csrMII Values ("- - -", m.tnLevel, -1)
> 				Endif
> 			Endif
> 
> 

>
> Jijo
> JUST THINK, THERE IS A WAY
> my blog:http://weblogs.foxite.com/jijo_pappachan/


You don't need GetMenuState function, just use MenuItemInfo.fState field

#define MFS_ENABLED         0x00000000
#define MFS_UNCHECKED       0x00000000
#define MFS_UNHILITE        0x00000000
#define MFS_DISABLED        0x00000003
#define MFS_CHECKED         0x00000008
#define MFS_HILITE          0x00000080

m.lnState   = m.loMII.fState
m.llEnabled = (BitAnd(m.lnState, MFS_DISABLED)  = 0)
m.llChecked = (BitAnd(m.lnState, MFS_CHECKED ) != 0)
m.llHilite  = (BitAnd(m.lnState, MFS_HILITE  ) != 0)


Regards,
Onytoo

ENTIRE THREAD

Visual Foxpro Professional 2011 Posted by Jijo Pappachan @ 7/22/2011 8:04:57 PM
RE: Visual Foxpro Professional 2011 Posted by Samir H. @ 7/22/2011 8:46:41 PM
RE: Visual Foxpro Professional 2011 Posted by Jijo Pappachan @ 7/22/2011 9:00:35 PM
RE: Visual Foxpro Professional 2011 Posted by Mike Yearwood @ 7/22/2011 9:17:38 PM
RE: Visual Foxpro Professional 2011 Posted by Jijo Pappachan @ 7/22/2011 9:35:44 PM
RE: Visual Foxpro Professional 2011 Posted by Mike Yearwood @ 7/23/2011 4:26:39 PM
RE: Visual Foxpro Professional 2011 Posted by Mike Yearwood @ 7/24/2011 12:03:53 AM
RE: Visual Foxpro Professional 2011 Posted by Jijo Pappachan @ 7/24/2011 6:30:10 AM
RE: Visual Foxpro Professional 2011 Posted by Tony Vignone @ 7/22/2011 9:09:28 PM
RE: Visual Foxpro Professional 2011 Posted by Jijo Pappachan @ 7/22/2011 9:19:54 PM
RE: Visual Foxpro Professional 2011 Posted by onytoo @ 7/22/2011 9:55:13 PM
RE: Visual Foxpro Professional 2011 Posted by Jijo Pappachan @ 7/22/2011 9:58:40 PM
RE: Visual Foxpro Professional 2011 Posted by onytoo @ 7/22/2011 10:08:29 PM
RE: Visual Foxpro Professional 2011 Posted by Jijo Pappachan @ 7/22/2011 10:15:59 PM
RE: Visual Foxpro Professional 2011 Posted by Jijo Pappachan @ 7/22/2011 11:06:36 PM
RE: Visual Foxpro Professional 2011 Posted by onytoo @ 7/22/2011 11:30:48 PM
RE: Visual Foxpro Professional 2011 Posted by claude fox @ 7/22/2011 11:09:47 PM
RE: Visual Foxpro Professional 2011 Posted by Jijo Pappachan @ 7/23/2011 9:24:57 AM
RE: Visual Foxpro Professional 2011 Posted by claude fox @ 7/26/2011 11:42:50 AM
RE: Visual Foxpro Professional 2011 Posted by Glenn Gevero @ 7/23/2011 9:28:17 AM
RE: Visual Foxpro Professional 2011 Posted by Jijo Pappachan @ 7/23/2011 10:02:55 AM
RE: Visual Foxpro Professional 2011 Posted by anand kulkarni @ 7/24/2011 4:52:00 AM
RE: Visual Foxpro Professional 2011 Posted by Jijo Pappachan @ 7/24/2011 8:59:16 AM
RE: Visual Foxpro Professional 2011 Posted by Graham Trott @ 7/25/2011 2:40:43 AM
RE: Visual Foxpro Professional 2011 Posted by Jijo Pappachan @ 7/25/2011 6:54:41 AM
RE: Visual Foxpro Professional 2011 Posted by Bhushan Sahni @ 7/25/2011 10:08:52 AM
RE: Visual Foxpro Professional 2011 Posted by Jijo Pappachan @ 7/25/2011 10:38:02 AM
RE: Visual Foxpro Professional 2011 Posted by Jim Nelson @ 7/25/2011 3:54:20 PM
RE: Visual Foxpro Professional 2011 Posted by Jijo Pappachan @ 3/29/2012 6:57:00 AM
RE: Visual Foxpro Professional 2011 Posted by Cesar @ 7/25/2011 12:39:34 PM
RE: Visual Foxpro Professional 2011 Posted by Jijo Pappachan @ 7/25/2011 2:45:26 PM
RE: Visual Foxpro Professional 2011 Posted by Cetin Basoz @ 7/25/2011 1:35:21 PM
RE: Visual Foxpro Professional 2011 Posted by Cesar @ 7/25/2011 1:53:43 PM
RE: Visual Foxpro Professional 2011 Posted by Jijo Pappachan @ 7/25/2011 2:37:42 PM
RE: Visual Foxpro Professional 2011 Posted by Cetin Basoz @ 7/25/2011 3:21:43 PM
RE: Visual Foxpro Professional 2011 Posted by Jijo Pappachan @ 7/25/2011 3:38:18 PM
RE: Visual Foxpro Professional 2011 Posted by Cesar @ 7/25/2011 3:44:56 PM
RE: Visual Foxpro Professional 2011 Posted by Cesar @ 7/25/2011 3:58:42 PM
RE: Visual Foxpro Professional 2011 Posted by Jijo Pappachan @ 7/25/2011 4:32:29 PM
RE: Visual Foxpro Professional 2011 Posted by Greg Green @ 7/25/2011 5:52:46 PM
RE: Visual Foxpro Professional 2011 Posted by Luis @ 7/25/2011 10:46:44 PM
RE: Visual Foxpro Professional 2011 Posted by onytoo @ 7/25/2011 3:45:42 PM
RE: Visual Foxpro Professional 2011 Posted by Glenn Gevero @ 7/26/2011 3:43:34 AM
RE: Visual Foxpro Professional 2011 Posted by Jim Nelson @ 7/26/2011 4:00:02 AM
RE: Visual Foxpro Professional 2011 Posted by Cetin Basoz @ 7/27/2011 10:49:43 PM
RE: Visual Foxpro Professional 2011 Posted by Boudewijn Lutgerink @ 3/25/2012 9:30:14 AM
RE: Visual Foxpro Professional 2011 Posted by Dilip Kumar @ 7/25/2011 1:40:25 PM
RE: Visual Foxpro Professional 2011 Posted by Jijo Pappachan @ 7/25/2011 2:38:38 PM
RE: Visual Foxpro Professional 2011 Posted by Jijo Pappachan @ 7/25/2011 2:30:04 PM
RE: Visual Foxpro Professional 2011 Posted by Greg Green @ 7/25/2011 3:41:44 PM
RE: Visual Foxpro Professional 2011 Posted by Greg Green @ 7/25/2011 3:44:58 PM
RE: Visual Foxpro Professional 2011 Posted by Jijo Pappachan @ 7/25/2011 3:56:25 PM
RE: Visual Foxpro Professional 2011 Posted by Mike Yearwood @ 7/25/2011 5:00:49 PM
RE: Visual Foxpro Professional 2011 Posted by Greg Green @ 7/25/2011 5:41:27 PM
RE: Visual Foxpro Professional 2011 Posted by Mike Yearwood @ 7/25/2011 6:23:09 PM
RE: Visual Foxpro Professional 2011 Posted by Luis @ 7/28/2011 5:49:59 AM
RE: Visual Foxpro Professional 2011 Posted by Greg Green @ 7/25/2011 3:23:17 PM
RE: Visual Foxpro Professional 2011 Posted by khubaib khalid @ 7/27/2011 8:13:38 PM
RE: Visual Foxpro Professional 2011 Posted by Jim Nelson @ 7/27/2011 9:12:06 PM
RE: Visual Foxpro Professional 2011 Posted by Jijo Pappachan @ 7/28/2011 7:07:27 AM
RE: Visual Foxpro Professional 2011 Posted by Samir H. @ 7/28/2011 7:41:03 AM
RE: Visual Foxpro Professional 2011 Posted by Jijo Pappachan @ 7/28/2011 10:40:55 AM
RE: Visual Foxpro Professional 2011 Posted by Neeraj Charne @ 7/28/2011 9:57:09 AM
RE: Visual Foxpro Professional 2011 Posted by Jijo Pappachan @ 7/28/2011 10:41:24 AM
RE: Visual Foxpro Professional 2011 Posted by Jim Nelson @ 7/28/2011 4:22:24 PM
RE: Visual Foxpro Professional 2011 Posted by Jijo Pappachan @ 7/28/2011 4:49:19 PM
RE: Visual Foxpro Professional 2011 Posted by Jim Nelson @ 7/28/2011 7:25:43 PM
RE: Visual Foxpro Professional 2011 Posted by Jim Nelson @ 7/28/2011 7:25:45 PM
RE: Visual Foxpro Professional 2011 Posted by Sajan Jacob @ 7/28/2011 7:45:15 AM
RE: Visual Foxpro Professional 2011 Posted by Jijo Pappachan @ 7/28/2011 10:41:54 AM
RE: Visual Foxpro Professional 2011 Posted by onytoo @ 7/28/2011 11:31:53 AM
RE: Visual Foxpro Professional 2011 Posted by Jijo Pappachan @ 7/28/2011 4:57:54 PM
RE: Visual Foxpro Professional 2011 Posted by onytoo @ 7/29/2011 5:58:17 AM
RE: Visual Foxpro Professional 2011 Posted by Greg Green @ 7/30/2011 8:32:07 PM
RE: Visual Foxpro Professional 2011 Posted by Jijo Pappachan @ 7/31/2011 5:54:44 AM
RE: Visual Foxpro Professional 2011 Posted by Vicos Vicos @ 3/10/2012 5:06:47 PM
RE: Visual Foxpro Professional 2011 Posted by James Frye @ 3/10/2012 7:53:46 PM
RE: Visual Foxpro Professional 2011 Posted by Jijo Pappachan @ 3/12/2012 6:41:19 AM
RE: Visual Foxpro Professional 2011 Posted by Vicos Vicos @ 3/12/2012 8:13:40 AM
RE: Visual Foxpro Professional 2011 Posted by Martin Krivka @ 3/12/2012 9:33:19 AM
RE: Visual Foxpro Professional 2011 Posted by Jijo Pappachan @ 3/12/2012 11:24:27 AM
RE: Visual Foxpro Professional 2011 Posted by Vicos Vicos @ 3/13/2012 7:17:56 PM
RE: Visual Foxpro Professional 2011 Posted by Jijo Pappachan @ 3/14/2012 6:10:58 AM
RE: Visual Foxpro Professional 2011 Posted by Vicos Vicos @ 3/14/2012 7:16:31 AM
RE: Visual Foxpro Professional 2011 Posted by Vicos Vicos @ 3/19/2012 11:46:42 AM
RE: Visual Foxpro Professional 2011 Posted by Vicos Vicos @ 3/23/2012 7:26:34 PM
RE: Visual Foxpro Professional 2011 Posted by Boudewijn Lutgerink @ 3/27/2012 3:41:34 PM
RE: Visual Foxpro Professional 2011 Posted by Vicos Vicos @ 3/28/2012 11:46:30 PM
RE: Visual Foxpro Professional 2011 Posted by Kulwant Singh @ 3/29/2012 6:04:45 AM
RE: Visual Foxpro Professional 2011 Posted by Jijo Pappachan @ 3/29/2012 6:51:54 AM
RE: Visual Foxpro Professional 2011 Posted by Kulwant Singh @ 3/29/2012 9:14:22 AM
RE: Visual Foxpro Professional 2011 Posted by Jijo Pappachan @ 3/29/2012 6:54:18 AM
RE: Visual Foxpro Professional 2011 Posted by Jijo Pappachan @ 3/29/2012 6:58:28 AM
RE: Visual Foxpro Professional 2011 Posted by Martin Krivka @ 3/29/2012 8:09:31 AM
RE: Visual Foxpro Professional 2011 Posted by EJ Perez @ 3/30/2012 9:21:38 AM
RE: Visual Foxpro Professional 2011 Posted by Jijo Pappachan @ 4/18/2012 1:25:02 PM
RE: Visual Foxpro Professional 2011 Posted by Vicos Vicos @ 4/19/2012 12:54:18 PM
RE: Visual Foxpro Professional 2011 Posted by Jijo Pappachan @ 4/19/2012 1:47:31 PM