TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: ..Anybody..
from: Gautam Lad
date: 1996-06-20 10:03:32
subject: WinEnableMenuItem();

Hi,
Here's the piece of code I need assistance on:

MRESULT EXPENTRY wind_proc (HWND handle, ULONG mess,                           
  MPARAM parm1, MPARAM parm2)
{
.
.
.

        case WM_COMMAND: switch (SHORT1FROMMP (parm1))
                {
                case IDM_START:
                DosGetDateTime(&DateTime);
                sprintf(timeon,"%d : %d .
%d",DateTime.hours,DateTime.minutes, 
                       DateTime.seconds);
                GpiCharStringAt(hps,&timeon_coord1,sizeof(timeon),timeon);
                hwnd_menu = WinWindowFromID(handle,IDM_TIMER);
                rc = WinEnableMenuItem(hwnd_menu,IDM_START,TRUE);
                break;

What I have is a menu called Timer (IDM_TIMER), and in the Timer menu, I have 
an item called Start (IDM_START).  Now, when the user selects the Start item, 
I want the Start item to be disabled, right after it has performed what it's 
supposed to. I tried TRUE & FALSE as the flag in the WinEnableMenuItem();
but nothing happens.  

Can somebody help me solve this little problem?  I can't see where I'm going 
wrong (should I disable the menu, then perform the rest?)

Thanks!


--- Maximus/2 3.00
* Origin: One Less Car * TorontOS/2 * (416) 480-0147 * (1:250/238)
SEEN-BY: 50/99 270/101 620/243 625/100 711/401 409 410 413 430 808 809 934
SEEN-BY: 711/955 712/407 515 517 628 713/888 800/1
@PATH: 250/238 2424/11 24 270/101 712/515 711/808 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.