本文整理汇总了C++中MPFROM2SHORT函数的典型用法代码示例。如果您正苦于以下问题:C++ MPFROM2SHORT函数的具体用法?C++ MPFROM2SHORT怎么用?C++ MPFROM2SHORT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了MPFROM2SHORT函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: SetSysMenu
/*
*
* SetSysMenu
*
* DESCRIPTION:
*
* Set dialog box so only move and close are active.
*
*/
static VOID
SetSysMenu( HWND hDlg)
{
HWND hSysMenu;
MENUITEM Mi;
ULONG Pos;
MRESULT Id;
SHORT cItems;
/******************************************************************/
/* We only want Move and Close in the system menu. */
/******************************************************************/
hSysMenu = WinWindowFromID(hDlg, FID_SYSMENU);
WinSendMsg( hSysMenu, MM_QUERYITEM
, MPFROM2SHORT(SC_SYSMENU, FALSE), MPFROMP((PCH) & Mi));
Pos = 0L;
cItems = (SHORT)WinSendMsg( Mi.hwndSubMenu, MM_QUERYITEMCOUNT,
(MPARAM)NULL, (MPARAM)NULL);
while( cItems--){
Id = WinSendMsg( Mi.hwndSubMenu, MM_ITEMIDFROMPOSITION
, MPFROMLONG(Pos), (MPARAM)NULL);
switch (SHORT1FROMMR(Id))
{
case SC_MOVE:
case SC_CLOSE:
Pos++; /* Don't delete that one. */
break;
default:
WinSendMsg( Mi.hwndSubMenu, MM_DELETEITEM
, MPFROM2SHORT((USHORT)Id, TRUE), (MPARAM)NULL);
}
}
}
开发者ID:MbqIIB,项目名称:DEV-SAMPLES-IBM_Dev_Toolkit_Samples,代码行数:43,代码来源:pmbrowse.c
示例2: CheckHost
PMINIRECORDCORE
CheckHost(char *_Host)
{
PNAMEENTRY pRecord;
char locbuf[512];
sprintf(locbuf, "Checking Host for duplicate [%-100.100s]", _Host);
MsgLog(locbuf);
/* Get first item NAMES_CONTAINER Container */
pRecord=(PNAMEENTRY)WinSendDlgItemMsg(sHwnd, sID,
CM_QUERYRECORD,
MPFROMP(0), /* pointer to reference record */
MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
while (pRecord) {
if (pRecord->pszHost[0] == _Host[0] && strcmp(pRecord->pszHost, _Host) == 0)
return((PMINIRECORDCORE)pRecord);
sprintf(locbuf, "pRecord [%100.100s] Next->%x", pRecord->pszHost, pRecord->Record.preccNextRecord);
MsgLog(locbuf);
pRecord=(PNAMEENTRY)WinSendDlgItemMsg(sHwnd, sID,
CM_QUERYRECORD,
MPFROMP(pRecord), /* pointer to reference record */
MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER));
// pRecord = (PNAMEENTRY)pRecord->Record.preccNextRecord;
} /* endwhile */
return(0);
}
开发者ID:OS2World,项目名称:UTIL-NET-Sticky2,代码行数:32,代码来源:PMFUNCS.C
示例3: wpCTTrack
MRESULT EXPENTRY wpCTTrack(HWND hwnd,ULONG msg,MPARAM mp1,MPARAM mp2)
{
switch(msg)
{
case WM_CHAR:
{
SHORT fsflags = SHORT1FROMMP(mp1);
SHORT usvkey = SHORT2FROMMP(mp2);
if(fsflags & KC_KEYUP) break;
if((fsflags & KC_SHIFT) && (usvkey == VK_F10))
{
RECORDCORE *record;
record = searchRecords(hwnd, 0, (RECORDCORE *) CMA_FIRST, CRA_SELECTED);
processPopUp(WinQueryWindow(hwnd, QW_PARENT), WinQueryWindowUShort(hwnd,QWS_ID),
record, PUM_CDRECORD, PUM_CDCONTAINER, &sourceEmphasisInfo);
WinSendMsg(sourceEmphasisInfo.PUMHwnd, MM_SETITEMATTR,
MPFROM2SHORT(IDM_MINIICONS, FALSE),
MPFROM2SHORT(MIA_CHECKED, miniIcons ? MIA_CHECKED : 0));
return 0;
}
else if((fsflags & KC_SHIFT) && (usvkey == VK_F9))
{
CNREDITDATA editdata;
CNRINFO cnrInfo;
WinSendMsg(hwnd,CM_QUERYCNRINFO, MPFROMP(&cnrInfo),MPFROMLONG(sizeof(cnrInfo)));
editdata.cb = sizeof(editdata);
editdata.hwndCnr = hwnd;
editdata.pRecord = searchRecords(hwnd, 0, (RECORDCORE *) CMA_FIRST, CRA_CURSORED);
editdata.ppszText = NULL;
editdata.cbText = 0;
if(cnrInfo.flWindowAttr & CV_DETAIL)
{
editdata.pFieldInfo = (FIELDINFO*) WinSendMsg(hwnd, CM_QUERYDETAILFIELDINFO, MPFROMP(NULL), MPFROMSHORT(CMA_FIRST));
editdata.pFieldInfo = (FIELDINFO*) WinSendMsg(hwnd, CM_QUERYDETAILFIELDINFO, MPFROMP(editdata.pFieldInfo), MPFROMSHORT(CMA_NEXT));
editdata.id = CID_LEFTDVWND;
}
else
{
editdata.pFieldInfo = NULL;
editdata.id = WinQueryWindowUShort(hwnd,QWS_ID);
}
WinSendMsg(hwnd,CM_OPENEDIT,MPFROMP(&editdata),0);
return 0;
}
break;
}
}
return wpCT( hwnd, msg, mp1, mp2 );
}
开发者ID:OS2World,项目名称:MM-SOUND-CD2MP3PM,代码行数:60,代码来源:dlgcd.c
示例4: GetHMenuOf
void wxMenuItem::Enable(
bool bEnable
)
{
bool bOk;
if (m_isEnabled == bEnable)
return;
if (bEnable)
bOk = (bool)::WinSendMsg( GetHMenuOf(m_parentMenu)
,MM_SETITEMATTR
,MPFROM2SHORT(GetRealId(), TRUE)
,MPFROM2SHORT(MIA_DISABLED, FALSE)
);
else
bOk = (bool)::WinSendMsg( GetHMenuOf(m_parentMenu)
,MM_SETITEMATTR
,MPFROM2SHORT(GetRealId(), TRUE)
,MPFROM2SHORT(MIA_DISABLED, MIA_DISABLED)
);
if (!bOk)
{
wxLogLastError(wxT("EnableMenuItem"));
}
wxMenuItemBase::Enable(bEnable);
} // end of wxMenuItem::Enable
开发者ID:erwincoumans,项目名称:wxWidgets,代码行数:26,代码来源:menuitem.cpp
示例5: WinCheckButton
void NextBarDlg::setButtons()
{
ULONG usTemp;
for(usTemp=0; usTemp<=(sizeof(usSessionTypeRBs)/sizeof(ULONG)); usTemp++)
if(usSessionTypeIDs[usTemp] == event->session) {
WinCheckButton(hwnd, usSessionTypeRBs[usTemp], TRUE);
WinSendMsg(hwnd, WM_CONTROL, MPFROM2SHORT(usSessionTypeRBs[usTemp], BN_CLICKED), NULL); }
switch(event->session)
{
case PROG_WINDOW_REAL:
case PROG_WINDOW_PROT:
case PROG_31_ENH:
for(usTemp=0; usTemp<=(sizeof(usChild2WINOS2)/sizeof(ULONG)); usTemp++)
if(usWINOS2TypeIDs[usTemp] == event->session)
WinCheckButton(hwnd, usChild2WINOS2[usTemp], TRUE);
WinCheckButton(hwnd, NHX_SEAMLESS, TRUE);
WinSendMsg(hwnd, WM_CONTROL, MPFROM2SHORT(NHX_SEAMLESS, BN_CLICKED), NULL);
break;
default:
WinCheckButton(hwnd, NHX_WINSTD, TRUE);
break;
}
if(event->session == SSF_TYPE_WPSOBJECT) {
OCL::disableControls(hwnd, usChild2WINOS2, sizeof(usChild2WINOS2));
OCL::hideControls(hwnd, WPSOControls, sizeof(WPSOControls)); }
}
开发者ID:OS2World,项目名称:LIB-Cubus_OS2_Class_Library,代码行数:29,代码来源:NextBarDlg.cpp
示例6: MainSize
MRESULT MainSize(HWND hwnd, /* handle to the main client window */
SHORT sTotalMsgs,
MPARAM mp1, /* first parameter of WM_SIZE message */
MPARAM mp2) /* second parameter of WM_SIZE message */
{
cxClient = SHORT1FROMMP (mp2) ;
cyClient = SHORT2FROMMP (mp2) ;
sHscrollMax = max (0, cxTextTotal - cxClient) ;
sHscrollPos = min (sHscrollPos, sHscrollMax) ;
WinSendMsg (hwndHscroll, SBM_SETSCROLLBAR,
MPFROM2SHORT (sHscrollPos, 0),
MPFROM2SHORT (0, sHscrollMax)) ;
WinEnableWindow (hwndHscroll, (BOOL)((sHscrollMax != 0) ? TRUE : FALSE)) ;
sVscrollMax = max (0, sTotalMsgs - cyClient / cyChar) ;
sVscrollPos = min (sVscrollPos, sVscrollMax) ;
WinSendMsg (hwndVscroll, SBM_SETSCROLLBAR,
MPFROM2SHORT (sVscrollPos, 0),
MPFROM2SHORT (0, sVscrollMax)) ;
WinEnableWindow (hwndVscroll, (BOOL)((sVscrollMax != 0) ? TRUE : FALSE)) ;
return (MRFROMLONG(0));
}
开发者ID:MbqIIB,项目名称:DEV-SAMPLES-IBM_Dev_Toolkit_Samples,代码行数:29,代码来源:svrppnt.c
示例7: while
// given an item, move it up in the container
void Container::moveUp(UserData *ud)
{
PRECORDCORE parent,parents_parent;
array<PRECORDCORE> children;
int num_children=0;
parent = (PRECORDCORE)WinSendMsg(cont,CM_QUERYRECORD,MPFROMP(ud),MPFROM2SHORT(CMA_PREV,CMA_ITEMORDER));
if (parent)
{
// if there is any children associated with this record we must save them
children[0] = (PRECORDCORE)WinSendMsg(cont,CM_QUERYRECORD,MPFROMP(ud),MPFROM2SHORT(CMA_FIRSTCHILD,CMA_ITEMORDER));
if (children[0] != NULL)
{
num_children = 1;
PRECORDCORE next;
do
{
next = (PRECORDCORE)WinSendMsg(cont,CM_QUERYRECORD,MPFROMP(children[num_children-1]),MPFROM2SHORT(CMA_NEXT,CMA_ITEMORDER));
if (next != NULL)
{
children[num_children] = next;
num_children++;
}
} while (next != NULL);
}
parents_parent = (PRECORDCORE)WinSendMsg(cont,CM_QUERYRECORD,MPFROMP(parent),MPFROM2SHORT(CMA_PREV,CMA_ITEMORDER));
if (parents_parent == NULL)
parents_parent = (PRECORDCORE)CMA_FIRST;
// remove but don't delete
WinSendMsg(cont,CM_REMOVERECORD,MPFROMP(&ud),MPFROM2SHORT(1,0));
RECORDINSERT ri;
memset(&ri,0,sizeof(RECORDINSERT));
ri.cb = sizeof(RECORDINSERT);
if (!ud->getParent() || !ud->getParent()->getCollapsed())
ri.fInvalidateRecord = FALSE; // TRUE;
ri.pRecordParent = (PRECORDCORE)ud->getParent();
ri.pRecordOrder = (RECORDCORE*)parents_parent;
ri.cRecordsInsert = 1; // number of records to insert
// re-insert
WinSendMsg(cont,CM_INSERTRECORD,MPFROMP((PRECORDCORE)ud),MPFROMP(&ri));
if (num_children > 0)
{
ri.pRecordParent = (PRECORDCORE)ud;
ri.pRecordOrder = (RECORDCORE*)CMA_END;
for (int i=0; i<num_children; i++)
{
WinSendMsg(cont,CM_INSERTRECORD,MPFROMP(children[i]),MPFROMP(&ri));
}
}
setItemFocus(ud);
}
}
开发者ID:OS2World,项目名称:APP-INTERNET-News-Harvest,代码行数:60,代码来源:container.cpp
示例8: InitLineBits
APIRET InitLineBits(HWND hwnd)
{
APIRET rc;
ULONG DataPacketLen;
rc = DosDevIOCtl (HandleComm,
IOCTL_ASYNC,
ASYNC_GETLINECTRL,
NULL, //no parameter packet
0, // = 0
NULL, // length of parm packet
(PULONG) &DataPacket,
sizeof(DataPacket),
&DataPacketLen);
rc = DosDevIOCtl (HandleComm,
IOCTL_ASYNC,
ASYNC_GETLINECTRL,
NULL, //no parameter packet
0, // = 0
NULL, // length of parm packet
(PULONG) &DataPacket,
sizeof(DataPacket),
&DataPacketLen);
if (rc)
{
sprintf(PrintBuf,"RC=%u Line=%u\nFile: %s",rc,__LINE__,__FILE__);
WinDebugMsg(PrintBuf,hwnd);
}
WinSendDlgItemMsg(hwnd,
(ULONG) IDC_DATA_BIT5 + (DataPacket.bDataBits - 5),
(ULONG) BM_SETCHECK,
MPFROM2SHORT(TRUE,0),
NULL);
WinSendDlgItemMsg(hwnd,IDC_PARITY_NO + DataPacket.bParity,
BM_SETCHECK,
MPFROM2SHORT(TRUE,0),
NULL);
WinSendDlgItemMsg(hwnd,IDC_STOP_BIT1 + DataPacket.bStopBits,
BM_SETCHECK,
MPFROM2SHORT(TRUE,0),
NULL);
WinSetFocus (HWND_DESKTOP, WinWindowFromID(hwnd,DID_OK));
return 0;
}
开发者ID:OS2World,项目名称:UTIL-COMM-Slidcom,代码行数:59,代码来源:SLIDDLG.C
示例9: findSelectedRecord
void Container::setItemFocus(UserData *it)
{
UserData *ud = findSelectedRecord(NULL);
if (ud != NULL)
WinSendMsg(cont,CM_SETRECORDEMPHASIS,MPFROMP((RECORDCORE*)ud),MPFROM2SHORT(FALSE,CRA_SELECTED));
if (it != NULL)
WinSendMsg(cont,CM_SETRECORDEMPHASIS,MPFROMP((RECORDCORE*)it),MPFROM2SHORT(TRUE,CRA_SELECTED));
}
开发者ID:OS2World,项目名称:APP-INTERNET-News-Harvest,代码行数:8,代码来源:container.cpp
示例10: ComboBox_Processor
extern MRESULT EXPENTRY ComboBox_Processor ( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 ) {
static PWINDOWPROC DefaultProcessor = 0 ;
switch ( msg ) {
case WM_CREATE: {
CLASSINFO ClassInfo ;
WinQueryClassInfo ( WinQueryAnchorBlock(hwnd), WC_COMBOBOX, &ClassInfo ) ;
DefaultProcessor = ClassInfo.pfnWindowProc ;
MRESULT Result = DefaultProcessor ( hwnd, msg, mp1, mp2 ) ;
HWND Entryfield = WinWindowFromID ( hwnd, CBID_EDIT ) ;
ULONG Style = WinQueryWindowULong ( hwnd, QWL_STYLE ) ;
if ( Style & CBS_DROPDOWNLIST ) {
OldComboEntry_Processor1 = WinSubclassWindow ( Entryfield, ComboEntry_Processor1 ) ;
} else {
OldComboEntry_Processor2 = WinSubclassWindow ( Entryfield, ComboEntry_Processor2 ) ;
} /* endif */
return ( Result ) ; }
case WM_CONTROL: {
USHORT Id = WinQueryWindowUShort ( hwnd, QWS_ID ) ;
SHORT Control = SHORT1FROMMP ( mp1 ) ;
SHORT Message = SHORT2FROMMP ( mp1 ) ;
switch ( Control ) {
case CBID_EDIT: {
switch ( Message ) {
case EN_SETFOCUS: {
Sys_SendMessage( OWNER(hwnd), WM_CONTROL, MPFROM2SHORT(Id,CBN_SETFOCUS), 0 ) ;
break; }
case EN_KILLFOCUS: {
Sys_SendMessage( OWNER(hwnd), WM_CONTROL, MPFROM2SHORT(Id,CBN_KILLFOCUS), 0 ) ;
break; }
} /* endswitch */
break; }
case CBID_LIST: {
switch ( Message ) {
case LN_SETFOCUS: {
Sys_SendMessage( OWNER(hwnd), WM_CONTROL, MPFROM2SHORT(Id,CBN_SETFOCUS), 0 ) ;
break; }
case LN_KILLFOCUS: {
Sys_SendMessage( OWNER(hwnd), WM_CONTROL, MPFROM2SHORT(Id,CBN_KILLFOCUS), 0 ) ;
break; }
} /* endswitch */
break; }
} /* endswitch */
break; }
case WM_MEASUREITEM:
return ( Sys_SendMessage( OWNER(hwnd), msg, mp1, mp2 ) ) ;
case WM_DRAWITEM:
return ( Sys_SendMessage( OWNER(hwnd), msg, mp1, mp2 ) ) ;
} /* endswitch */
return ( DefaultProcessor ? DefaultProcessor ( hwnd, msg, mp1, mp2 ) : 0 ) ;
}
开发者ID:OS2World,项目名称:APP-PRODUCTIVITY-Escriba,代码行数:58,代码来源:CONTROLS.CPP
示例11: EnableMenuItem
/*---------------------------------------------
Helper subroutines to work over menu items.
---------------------------------------------*/
VOID EnableMenuItem (HWND hwnd, SHORT sMenuItem, BOOL fEnable)
{
HWND hwndParent = WinQueryWindow (hwnd, QW_PARENT, FALSE) ;
HWND hwndMenu = WinWindowFromID (hwndParent, FID_MENU) ;
WinSendMsg (hwndMenu, MM_SETITEMATTR,
MPFROM2SHORT (sMenuItem, TRUE),
MPFROM2SHORT (MIA_DISABLED, fEnable ? 0 : MIA_DISABLED)) ;
}
开发者ID:OS2World,项目名称:APP-GRAPHICS-FractINT,代码行数:12,代码来源:pmfruser.c
示例12: _NewWindow
/*
* _NewWindow - create a new window
*/
unsigned _NewWindow( char *name, ... )
{
LPWDATA w;
MENUITEM menus;
HWND hwnd,frame,temp;
char str[80];
int x1,x2,y1,y2;
ULONG style;
RECTL rcl;
va_list al;
_GetWindowNameAndCoords( name, str, &x1, &x2, &y1, &y2 );
style = FCF_TITLEBAR | FCF_SYSMENU | FCF_SIZEBORDER | FCF_MINMAX |
FCF_VERTSCROLL;
frame = WinCreateStdWindow( _MainWindow,
WS_VISIBLE | WS_CLIPSIBLINGS,
&style, _ClassName, str, 0, NULL, 0, &hwnd );
if( frame == 0 ) return( FALSE );
WinSetOwner( hwnd, _MainWindow );
va_start( al, name );
w = _AnotherWindowData( hwnd, al );
w->frame = frame;
w->text_color = CLR_WHITE;
w->background_color = CLR_BLACK;
WinSendMsg( frame, WM_SETICON,
MPFROMLONG( WinQuerySysPointer( HWND_DESKTOP, SPTR_APPICON, TRUE ) ), 0 );
WinSetWindowBits( WinWindowFromID( w->frame, FID_VERTSCROLL ), QWL_STYLE,
SBS_AUTOTRACK, SBS_AUTOTRACK );
_CreateFont( w );
_PositionScrollThumb( w );
WinQueryWindowRect( _MainWindow, &rcl );
WinSetWindowPos( frame, HWND_TOP,
x1*w->xchar,
(rcl.yTop - rcl.yBottom)-y1*w->ychar-y2*w->ychar,
x2*w->xchar,
y2*w->ychar,
SWP_SIZE | SWP_MOVE | SWP_ZORDER );
menus.iPosition = _MainWindowData->window_count - 1;
menus.afStyle = MIS_TEXT;
menus.afAttribute = 0;
menus.id = DID_WIND_STDIO + w->handles[0];
menus.hwndSubMenu = NULL;
menus.hItem = 0;
if ( MIT_ERROR == (BOOL)WinSendMsg( menuHandle, ( ULONG )MM_INSERTITEM, MPFROMP( &menus ), MPFROMP( str ) ) ) abort();
temp = WinWindowFromID( frame, FID_SYSMENU );
WinSendMsg( temp, MM_QUERYITEM, MPFROM2SHORT(SC_SYSMENU, TRUE),
MPFROMP((PSZ)&menus) );
WinSendMsg( menus.hwndSubMenu, MM_DELETEITEM, MPFROM2SHORT( SC_CLOSE, TRUE ), 0 );
WinUpdateWindow( hwnd );
WinSetFocus( HWND_DESKTOP, hwnd );
return( TRUE );
} /* _NewWindow */
开发者ID:ABratovic,项目名称:open-watcom-v2,代码行数:60,代码来源:pmnew.c
示例13: EnableMenu
VOID EnableMenu(ULONG id, BOOL fEnable)
{
WinSendMsg(hwndMenu, /* global main menu handle */
MM_SETITEMATTR, /* set menu attribute */
MPFROM2SHORT(id, TRUE), /* menu id */
MPFROM2SHORT(MIA_DISABLED, /* mask = disable bit */
fEnable ? ~MIA_DISABLED : MIA_DISABLED)); /* turn off/on */
} /* end EnableMenu() */
开发者ID:OS2World,项目名称:GAME-ACTION-MakMan,代码行数:9,代码来源:pmmain.cpp
示例14: ClearScreen
VOID ClearScreen(THREAD *pstThd)
{
VIOCELL Cell;
VIOPS *pVio = &pstThd->stVio;
BYTE byBackground;
BYTE byForeground;
byBackground = ClrTable[pVio->wBackground].PSClr;
byForeground = ClrTable[pVio->wForeground].PSClr;
/*
** Set foreground and background colors in ANSI, so that the
** VioWrtTTY function will pick up the correct colors.
*/
chAnsi[ANSI_FORE] = QueryAnsiClr(byForeground);
chAnsi[ANSI_BACK] = QueryAnsiClr(byBackground);
VioSetAnsi (ANSI_ON,pVio->hpsVio);
VioWrtTTY( (PCH)chAnsi,sizeof(chAnsi),pVio->hpsVio);
if (!pstThd->stCfg.bEnableAnsi)
VioSetAnsi (ANSI_OFF,pVio->hpsVio);
/*
** Set Presentation Space to a known state - full of spaces.
*/
Cell.vc = ' ';
Cell.ExtAttr = Cell.Spare = 0;
Cell.Attr = (byBackground << 4) | byForeground;
VioWrtNCell((PBYTE)&Cell,pVio->usPsWidth * pVio->usPsDepth,0,0,pVio->hpsVio);
VioSetOrg(0,0,pVio->hpsVio);
VioSetCurPos(0,0,pVio->hpsVio);
/*
** Zero the scroll bars.
*/
WinSendMsg(WinWindowFromID(pstThd->hwndFrame,FID_VERTSCROLL),
SBM_SETPOS,
MPFROMSHORT(0),
MPFROMSHORT(0));
WinSendMsg(WinWindowFromID(pstThd->hwndFrame,FID_HORZSCROLL),
SBM_SETPOS,
MPFROMSHORT(0),
MPFROMSHORT(0));
WinSendMsg(WinWindowFromID(pstThd->hwndFrame,FID_VERTSCROLL),
SBM_SETTHUMBSIZE,
MPFROM2SHORT(pVio->usWndWidth,pVio->usPsWidth),
(MPARAM)NULL);
WinSendMsg(WinWindowFromID(pstThd->hwndFrame,FID_HORZSCROLL),
SBM_SETTHUMBSIZE,
MPFROM2SHORT(pVio->usWndDepth,pVio->usPsDepth),
(MPARAM)NULL);
}
开发者ID:OS2World,项目名称:APP-COMM-ComScope,代码行数:57,代码来源:util.c
示例15: EnableMenuItem
/**************************************************************************
*
* Name : EnableMenuItem(hwndMenu, idItem, fEnable)
*
* Description: Enables or disables the menu item
*
* Concepts: Called whenever a menu item is to be enabled or
* disabled
*
* Sends a MM_SETITEMATTR to the menu with the
* given item id. Sets the MIA_DISABLED attribute
* flag if the item is to be disabled, clears the flag
* if enabling.
*
* API's : WinSendMsg
*
* Parameters : hwndmenu = menu window handle
* idItem = menu item i.d.
* fEnable = enable (yes) or disable (no)
*
* Return : [none]
*
*************************************************************************/
VOID EnableMenuItem(HWND hwndMenu, USHORT idItem, BOOL fEnable)
{ SHORT fsFlag;
if(fEnable) fsFlag = 0;
else fsFlag = MIA_DISABLED;
WinSendMsg(hwndMenu, MM_SETITEMATTR,
MPFROM2SHORT(idItem, TRUE),
MPFROM2SHORT(MIA_DISABLED, fsFlag));
} /* End of EnableMenuItem() */
开发者ID:OS2World,项目名称:GAME-ACTION-BallsBall,代码行数:32,代码来源:menu.c
示例16: lboxEndDrag
BOOL lboxEndDrag(PELBOX pelb, PMSEMSG pmmsg) {
LONG rc;
if (!(pelb->fl & ELBCS_ITEMDRAGGABLE) || !pelb->is.dragging)
return FALSE;
WinSetCapture(HWND_DESKTOP, NULLHANDLE);
WinStopTimer(pelb->hab, pelb->hlbx, DRAG_TIMERID);
pelb->is.dragging = 0;
if (pelb->is.where == ELBOX_DRAGIN) {
PVOID pitemdata;
PSZ psz;
ULONG cb;
SHORT dropitem = (SHORT)pelb->lbxwprc(pelb->hlbx, LM_QUERYTOPINDEX,
MPVOID, MPVOID) +
(pelb->rcltopitem.yTop - pmmsg->y + pelb->cyitem / 2) /
pelb->cyitem;
if (dropitem != pelb->dragitem && dropitem != (pelb->dragitem + 1)) {
rc = (LONG)WinSendMsg(WinQueryWindow(pelb->hwnd, QW_OWNER),
WM_CONTROL,
MPFROM2SHORT((USHORT)pelb->id, ELBXN_DROPITEM),
MPFROM2SHORT(pelb->dragitem, dropitem));
if (rc < 0) goto cancel;
if (rc > 0) return TRUE;
// ricava dati item draggato
cb = (ULONG)pelb->lbxwprc(pelb->hlbx, LM_QUERYITEMTEXTLENGTH,
(MPARAM)pelb->dragitem, MPVOID) + 1;
if (NULL != (psz = (PSZ)malloc(cb))) {
pelb->lbxwprc(pelb->hlbx, LM_QUERYITEMTEXT,
MPFROM2SHORT(pelb->dragitem, cb), (MPARAM)psz);
pitemdata = pelb->lbxwprc(pelb->hlbx, LM_QUERYITEMHANDLE,
(MPARAM)pelb->dragitem, MPVOID);
WinEnableWindowUpdate(pelb->hlbx, FALSE);
// lo copia nella nuova posizione
if (dropitem >= pelb->citems) dropitem = LIT_END;
dropitem = (SHORT)pelb->lbxwprc(pelb->hlbx, LM_INSERTITEM,
(MPARAM)dropitem, (MPARAM)psz);
pelb->lbxwprc(pelb->hlbx, LM_SETITEMHANDLE, (MPARAM)dropitem,
(MPARAM)pitemdata);
free(psz);
// se inserzione nuovo item precede vecchio aumenta indice
if (dropitem < pelb->dragitem) ++pelb->dragitem;
else --dropitem;
// cancella item da vecchia posizione
pelb->lbxwprc(pelb->hlbx, LM_DELETEITEM,
(MPARAM)pelb->dragitem, MPVOID);
// seleziona item riposizionato
pelb->lbxwprc(pelb->hlbx, LM_SELECTITEM,
(MPARAM)dropitem, (MPARAM)TRUE);
WinEnableWindowUpdate(pelb->hlbx, TRUE);
return TRUE;
} /* endif */
} /* endif */
} /* endif */
cancel:
WinAlarm(HWND_DESKTOP, WA_ERROR);
return TRUE;
} /* endif */
开发者ID:OS2World,项目名称:LIB-Cantatore_Libraries,代码行数:56,代码来源:elbxlbox.c
示例17: clbCommand
MRESULT clbCommand(PCLBOX pclb, ULONG id) {
HWND hOwner = WinQueryWindow(pclb->hwnd, QW_OWNER);
SHORT i = 0;
PSZ psz;
switch (id) {
case FID_ADD:
// alloca buffer per testo entryfield
if (!(psz = (PSZ)malloc(pclb->cchef + 1))) break;
WinQueryWindowText(pclb->hentry, pclb->cchef + 1, psz);
if (!WinSendMsg(hOwner, WM_CONTROL,
MPFROM2SHORT(pclb->id, CLBXN_ADD), (MPARAM)psz)) {
SHORT ins;
// controlla che la stringa non sia gi… presente
if (pclb->fl & CLBXS_NODUP &&
LIT_NONE != (SHORT)pclb->pflbx(pclb->hlbx, LM_SEARCHSTRING,
MPFROM2SHORT(0, LIT_FIRST),
(MPARAM)psz)) {
free(psz);
break;
} // end if
// se stile lo richiede converte stringa in uppercase
if (pclb->fl & CLBXS_INSUPPER) WinUpper(pclb->hab, 0, 0, psz);
// setta flag inserzione secondo stile
if (pclb->fl & CLBXS_INSSORTUP) i = LIT_SORTASCENDING;
else if (pclb->fl & CLBXS_INSSORTDN) i = LIT_SORTDESCENDING;
else if (pclb->fl & CLBXS_INSEND) i = LIT_END;
ins = (SHORT)pclb->pflbx(pclb->hlbx, LM_INSERTITEM,
(MPARAM)i, (MPARAM)psz);
WinSetWindowText(pclb->hentry, "");
WinSendMsg(hOwner, WM_CONTROL,
MPFROM2SHORT(pclb->id, CLBXN_ADDED), (MPARAM)ins);
} // end if
free(psz);
break;
case FID_REMOVE:
i = (SHORT)pclb->pflbx(pclb->hlbx, LM_QUERYSELECTION,
(MPARAM)LIT_FIRST, MPVOID);
if (!WinSendMsg(hOwner, WM_CONTROL, MPFROM2SHORT(pclb->id, CLBXN_REM),
(MPARAM)i)) {
while (i >= 0) {
pclb->pflbx(pclb->hlbx, LM_DELETEITEM, (MPARAM)i, MPVOID);
i = (SHORT)pclb->pflbx(pclb->hlbx, LM_QUERYSELECTION,
(MPARAM)LIT_FIRST, MPVOID);
} /* end while */
} /* end if */
pclb->is.remon = 0;
WinEnableWindow(pclb->hrem, FALSE);
break;
case FID_FIND:
WinSendMsg(hOwner, WM_CONTROL, MPFROM2SHORT(pclb->id, CLBXN_FIND),
(MPARAM)pclb->hwnd);
break;
} /* endswitch */
return (MRESULT)FALSE;
}
开发者ID:OS2World,项目名称:UTIL-WPS-Styler_2,代码行数:55,代码来源:clbx.c
示例18: defined
VOID CDialog::LVM_SelectItem (int id, int item)
{
#if defined(__OS2__)
int i = item;
LV_PLISTDATA pRecord;
if (item >= 0) {
if ((pRecord = (LV_PLISTDATA)WinSendDlgItemMsg (m_hWnd, id, CM_QUERYRECORD, 0L, MPFROM2SHORT (CMA_FIRST, CMA_ITEMORDER))) != NULL)
do {
if (i-- == 0)
break;
} while ((pRecord = (LV_PLISTDATA)WinSendDlgItemMsg (m_hWnd, id, CM_QUERYRECORD, MPFROMP (pRecord), MPFROM2SHORT (CMA_NEXT, CMA_ITEMORDER))) != NULL);
if (pRecord != NULL) {
WinSendDlgItemMsg (m_hWnd, id, CM_SETRECORDEMPHASIS, MPFROMP (pRecord), MPFROM2SHORT (TRUE, CRA_SELECTED|CRA_CURSORED));
if (item == 0)
WinSendDlgItemMsg (m_hWnd, id, WM_CHAR, MPFROM2SHORT (KC_VIRTUALKEY, 0), MPFROM2SHORT (0, VK_UP));
else if (item == (LVM_QueryItemCount (id) - 1))
WinSendDlgItemMsg (m_hWnd, id, WM_CHAR, MPFROM2SHORT (KC_VIRTUALKEY, 0), MPFROM2SHORT (0, VK_DOWN));
else {
WinSendDlgItemMsg (m_hWnd, id, WM_CHAR, MPFROM2SHORT (KC_VIRTUALKEY, 0), MPFROM2SHORT (0, VK_DOWN));
WinSendDlgItemMsg (m_hWnd, id, WM_CHAR, MPFROM2SHORT (KC_VIRTUALKEY, 0), MPFROM2SHORT (0, VK_UP));
}
}
}
#elif defined(__NT__)
ListView_SetItemState (GetDlgItem (m_hWnd, id), item, LVIS_FOCUSED|LVIS_SELECTED, LVIS_FOCUSED|LVIS_SELECTED);
ListView_EnsureVisible (GetDlgItem (m_hWnd, id), item, FALSE);
#endif
}
开发者ID:kenjreno,项目名称:lora3,代码行数:29,代码来源:cdialog.cpp
示例19: check_menu_item
/* change menu item checkmark */
void
check_menu_item(int menuid, int itemid, BOOL checked)
{
HWND hwndMenu;
MENUITEM mi;
hwndMenu = WinWindowFromID(hwnd_frame, FID_MENU);
WinSendMsg(hwndMenu, MM_QUERYITEM,
MPFROM2SHORT(menuid, TRUE), MPFROMP(&mi));
WinSendMsg(mi.hwndSubMenu, MM_SETITEMATTR, MPFROMLONG(itemid),
MPFROM2SHORT(MIA_CHECKED, checked ? MIA_CHECKED : 0));
}
开发者ID:131,项目名称:gsview,代码行数:12,代码来源:gvpmisc.c
示例20: get_menu_string
/* get text of menu item */
int
get_menu_string(int menuid, int itemid, char *str, int len)
{
HWND hwndMenu;
MENUITEM mi;
hwndMenu = WinWindowFromID(hwnd_frame, FID_MENU);
WinSendMsg(hwndMenu, MM_QUERYITEM,
MPFROM2SHORT(menuid, TRUE), MPFROMP(&mi));
return (int)WinSendMsg(mi.hwndSubMenu, MM_QUERYITEMTEXT,
MPFROM2SHORT(itemid, len), MPFROMP(str));
}
开发者ID:131,项目名称:gsview,代码行数:12,代码来源:gvpmisc.c
注:本文中的MPFROM2SHORT函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论