本文整理汇总了C++中HandleMessage函数的典型用法代码示例。如果您正苦于以下问题:C++ HandleMessage函数的具体用法?C++ HandleMessage怎么用?C++ HandleMessage使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了HandleMessage函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: while
void Yodar_4028B::DoHandleWork()
{
if(m_nReadIndex == m_nWriteIndex)
{
return ;
}
if(m_nReadIndex > m_nWriteIndex)
{
while(m_nReadIndex < MAX_DATA_COUNT && m_bRun)
{
HandleMessage( & m_data[m_nReadIndex]);
memset((char *) m_data[m_nReadIndex].data, 0, MAX_DATA_LENGTH);
m_data[m_nReadIndex].len = 0;
m_nReadIndex++;
if(m_nReadIndex >= MAX_DATA_COUNT)
{
m_nReadIndex = 0;
break;
}
}
}
while(m_nReadIndex < m_nWriteIndex && m_bRun)
{
HandleMessage(&m_data[m_nReadIndex]);
memset((char *) m_data[m_nReadIndex].data, 0, MAX_DATA_LENGTH);
m_data[m_nReadIndex].len = 0;
m_nReadIndex++;
}
}
示例2: DefaultProcessing
//
/// Intercepts the WM_MDICREATE message sent when MDI child windows are created,
/// and, if the client's style includes MDIS_ALLCHILDSTYLES, and the child window's
/// specified style is 0, then changes the child window style attributes to
/// WS_VISIBLE, WS_CHILD, WS_CLIPSIBLINGS, WS_CLIPCHILDREN, WS_SYSMENU, WS_CAPTION,
/// WS_THICKFRAME, WS_MINIMIZEBOX, and WS_MAXIMIZEBOX.
//
TResult
TMDIClient::EvMDICreate(MDICREATESTRUCT & createStruct)
{
// Fill in default child window styles if they request style 0 since this
// client by default has set allchildstyles
//
if ((Attr.Style&MDIS_ALLCHILDSTYLES) && !createStruct.style)
createStruct.style =
WS_VISIBLE | WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN |
WS_SYSMENU | WS_CAPTION | WS_THICKFRAME |
WS_MINIMIZEBOX | WS_MAXIMIZEBOX;
// Work around a Windows MDI bug w/ bad menus if MDI child is created
// maximized, by hiding child now & maximizing later
//
uint32 origStyle = createStruct.style;
if (createStruct.style & WS_MAXIMIZE)
createStruct.style &= ~(WS_MAXIMIZE | WS_VISIBLE);
TResult result = DefaultProcessing();
// Finish up maximized MDI child workaround
//
if (THandle(result) && (origStyle & WS_MAXIMIZE)) {
HandleMessage(WM_MDIMAXIMIZE, TParam1(result));
HandleMessage(WM_MDIREFRESHMENU);
}
return result;
}
示例3: POPUPDlgProc
MRESULT EXPENTRY POPUPDlgProc(HWND hwndDlg, ULONG msg, MPARAM mp1, MPARAM mp2)
{
HWND hwndFrame = hwndDlg;
/* ##START Form.37 Top of window procedure */
/* ##END Top of window procedure */
switch (msg) {
/* Form event Opened WM_INITDLG */
case WM_INITDLG :
HandleMessage(hwndFrame, hwndDlg, msg, mp1, mp2);
WinAssociateHelpInstance(pMainFormInfo->hwndHelpInstance, hwndFrame);
/* ##START Form.1 */
/* ##END */
break;
/* Form event Closed WM_CLOSE */
case WM_CLOSE :
/* ##START Form.2 */
/* ##END */
HandleMessage(hwndFrame, hwndDlg, msg, mp1, mp2);
break;
/* Form event Destroyed WM_DESTROY */
case WM_DESTROY :
/* ##START Form.3 */
/* ##END */
/* Remove help instance */
WinAssociateHelpInstance((HWND) 0, hwndFrame);
HandleMessage(hwndFrame, hwndDlg, msg, mp1, mp2);
break;
case WM_COMMAND :
switch (SHORT1FROMMP(mp1)) {
} /* end switch */
break;
/* Initialize sub menus, if any */
case WM_INITMENU:
switch (SHORT1FROMMP(mp1)) {
} /* end switch */
break;
/* ##START Form.38 User defined messages */
/* ##END User defined messages */
default :
HandleMessage(hwndFrame, hwndDlg, msg, mp1, mp2);
return WinDefDlgProc(hwndDlg,msg,mp1,mp2);
} /* end switch for main msg dispatch */
return (MRESULT)FALSE;
} /* end dialog procedure */
示例4: establishConnection
void* establishConnection(void* arg)
{
//Мы работаем с конкретным соединением
int incomeSd = *((int*)arg);
int userID = FindCell();
MessageType *buf = (MessageType*) malloc (sizeof(MessageType));
int resultOfHandlingMessage = 1;
while (resultOfHandlingMessage)
{
if (server_enabled)
{
getMessage(incomeSd, buf);
resultOfHandlingMessage = HandleMessage(buf, incomeSd, userID);
}
else
{
char *str = "Server is turned off...";
MessageType m = composeMessage(text, strlen(str), str);
sendMessage(incomeSd, &m);
}
}
free(buf);
return NULL;
}
示例5: ProcessMessages
int ProcessMessages(bf_read&msgs)
{
int processed = 0;
while (true)
{
if (msgs.IsOverflowed())
{
return processed;
}
unsigned char type = msgs.ReadUBitLong(NETMSG_TYPE_BITS);
bool handled = HandleMessage(msgs, type);
if (!handled)
{
printf("Unhandled Message: %i\n", type);
return processed;
}
processed++;
if (msgs.GetNumBitsLeft() < NETMSG_TYPE_BITS)
{
return processed;
}
}
return processed;
}
示例6: HandleMessage
LRESULT CALLBACK AnimaMouseInteractor::MessageProcCallback(int nCode, WPARAM wParam, LPARAM lParam)
{
MSG* pMessageProcStruct = reinterpret_cast<MSG*>(lParam);
if (pMessageProcStruct == nullptr)
return 0;
auto pair = _installedInteractors.find((long)pMessageProcStruct->hwnd);
if (pair == _installedInteractors.end())
return 0;
AnimaMouseInteractor* pMouseInteractor = pair->second;
if (pMouseInteractor == nullptr)
return 0;
if (nCode == HC_ACTION)
{
HWND wndProcWnd = pMessageProcStruct->hwnd;
AUint wndProcMessage = pMessageProcStruct->message;
WPARAM wndProcWparam = pMessageProcStruct->wParam;
WPARAM wndProcLparam = pMessageProcStruct->lParam;
HandleMessage(wndProcWnd, wndProcMessage, wndProcWparam, wndProcLparam, pMouseInteractor);
}
return CallNextHookEx(pMouseInteractor->_windowsProcHook, nCode, wParam, lParam);
}
示例7: M0CORE_IRQHandler
void M0CORE_IRQHandler(void)
{
// Clear event flag
LPC_CREG->M0TXEVENT = 0x00000000;
// Handle message
HandleMessage();
}
示例8: THandle
//
/// Use the Windows message to get the active mdi child, and then down cast
/// to our MDI child derived class before returning it.
//
TMDIChild*
TMDIClient::GetActiveMDIChild()
{
THandle hWnd = THandle(HandleMessage(WM_MDIGETACTIVE));
return TYPESAFE_DOWNCAST(GetWindowPtr(hWnd), TMDIChild);
}
示例9: UpdateTrack
void CD3DScrollBar::SetScrollPos(int ScrollPos,bool SendMsg)
{
m_CurScrollPos=ScrollPos;
UpdateTrack();
if(SendMsg)
HandleMessage(this,WM_D3DGUI_SCROLL_BAR_SCROLL,(WPARAM)GetID(),m_CurScrollPos);
}
示例10: HandleMessage
bool Client::Peek(EventMessage &msg)
{
message_queue* const mq = (message_queue*)this->privateQueue;
// check local deque for message
if(!this->storedMessages.empty())
{
// get first queued element and pop it
msg = this->storedMessages.front();
this->storedMessages.pop_front();
return true;
}
std::stringbuf msgBuffer;
char buff[MAX_MSG_SIZE];
size_t recvd;
unsigned int priority;
if(mq->try_receive(buff, MAX_MSG_SIZE, recvd, priority))
{
msgBuffer.sputn(buff, recvd);
msg.deserialize(msgBuffer);
return HandleMessage(msg, priority);
}
else
return false;
return true;
}
示例11: HandleMessageThread
/** A worker thread that handles messages from JavaScript.
* @param[in] user_data Unused.
* @return unused. */
void* HandleMessageThread(void* user_data) {
while (1) {
char* message = DequeueMessage();
HandleMessage(message);
free(message);
}
}
示例12: GetMessageFilter
/*
* GetMessageFilter - hook for get message
*/
LRESULT CALLBACK GetMessageFilter( int ncode, WPARAM wparam, LPARAM lparam )
{
if( ncode >= 0 ) {
HandleMessage( (LPMSG)lparam );
}
return( CallNextHookEx( getHookHandle, ncode, wparam, lparam ) );
} /* GetMessageFilter */
示例13: OnReceiveMessage
static void OnReceiveMessage(ZL_WebSocketConnection_Impl* impl, int32_t result)
{
//ZL_LOG("NACLWSC", "ONRECEIVE - WS: %d - RESULT: %d - READYSTATE: %d - BUFFER: %d", impl->websocket, result, (int32_t)ppb_websocket_interface->GetReadyState(impl->websocket), (int32_t)ppb_websocket_interface->GetBufferedAmount(impl->websocket));
if (result < 0) { impl->Disconnect(PP_WEBSOCKETSTATUSCODE_ABNORMAL_CLOSURE, NULL, 0); return; }
HandleMessage(impl);
const PP_CompletionCallback cc = PP_MakeCompletionCallback((PP_CompletionCallback_Func)&OnReceiveMessage, (void*)impl);
while (ppb_websocket_interface->ReceiveMessage(impl->websocket, &impl->data, cc) == PP_OK) HandleMessage(impl);
}
示例14: ForEach
//
/// Intercepts the WM_MDIDESTROY message.
///
/// Destroy an MDI child window. Must temporarily unhide any hidden children,
/// and then rehide them after the destruction. Otherwise Window's MDI client
/// gets confused
//
void
TMDIClient::EvMDIDestroy(THandle THandle)
{
ForEach(sUnHide, (void*)THandle);
DefaultProcessing();
ForEach(sReHide);
HandleMessage(WM_MDIREFRESHMENU);
}
示例15: while
int _0xCC::WindowManager::DoMessageLoop(){
while (HandleMessage()) {
for (auto v : wins) {
v->RenderEvent();
}
}
return 0;
}