Exemple #1
0
static void onCommand( HWND hwnd, int id, HWND hwndCtl, UINT codeNotify ) {

    switch ( id ) {
    case ID_MAXIMIZE:
        FORWARD_WM_LBUTTONDOWN( hwnd, TRUE, 0, 0, 0, SNDMSG );
        break;
    }
}
Exemple #2
0
LOCAL void ListBox_DoSpecialSelect(HWND hWindow, BOOL fDoubleClick, int x, int y, UINT keyFlags)
/***********************************************************************/
{
// get the listbox data pointer
LPLISTBOXDATA lpData = ListBox_GetData(hWindow);
if (!lpData)
	{
	FORWARD_WM_LBUTTONDOWN(hWindow, fDoubleClick, x, y, keyFlags, ListBox_CallWindowProc);
	return;
	}

// give us focus on a mouse down
SetFocus(hWindow);

// initialize the dragging
SelectBegin(hWindow, x, y);

// start as if we had a mouse move
Select_OnMouseMove(hWindow, x, y, keyFlags);

// dragging loop                      
while (lpData->fCapture)
	{  
	MSG msg;
	// Look for mouse, keyboard, and timer messages. 
	// keystroke messages are retrieved to avoid the message
	// queue from getting full
	while ( !PeekMessage(&msg, NULL, WM_MOUSEFIRST, WM_MOUSELAST, PM_REMOVE) &&
			!PeekMessage(&msg, NULL, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE) &&
       		!PeekMessage(&msg, NULL, WM_TIMER, WM_TIMER, PM_REMOVE)) 
	   	WaitMessage();
	switch(msg.message)
 		{
    	case WM_MOUSEMOVE:
			HANDLE_WM_MOUSEMOVE(msg.hwnd, msg.wParam, msg.lParam, Select_OnMouseMove);
		break;
		case WM_TIMER:
			HANDLE_WM_TIMER(msg.hwnd, msg.wParam, msg.lParam, Select_OnTimer);
		break;
	 	case WM_LBUTTONUP: 
			HANDLE_WM_LBUTTONUP(msg.hwnd, msg.wParam, msg.lParam, Select_OnLButtonUp);
		break;
	 	default:
    		// Process messages we don't handle
	   		TranslateMessage(&msg);
	   		DispatchMessage(&msg);
		break;      
		}
	}

// process the drag and cleanup
SelectEnd(hWindow);
}
Exemple #3
0
LOCAL void ListBox_DoDrag(HWND hWindow, BOOL fDoubleClick, int x, int y, UINT keyFlags)
/***********************************************************************/
{
// Let the listbox control handle the mouse down so a selection can happen
FORWARD_WM_LBUTTONDOWN(hWindow, fDoubleClick, x, y, keyFlags, ListBox_CallWindowProc);

// see if it's cool for us to try to drag
LPLISTBOXDATA lpData = DragOK(hWindow);
if (!lpData)
	return;

// make the listbox think it got a mouse up so we can take over 
FORWARD_WM_LBUTTONUP(hWindow, x, y, keyFlags, ListBox_CallWindowProc);

// initialize the dragging
DragBegin(hWindow, x, y);

// dragging loop                      
while (lpData->fCapture)
	{  
	MSG msg;
	// Look for mouse, keyboard, and timer messages. 
	// keystroke messages are retrieved to avoid the message
	// queue from getting full
	while ( !PeekMessage(&msg, NULL, WM_MOUSEFIRST, WM_MOUSELAST, PM_REMOVE) &&
			!PeekMessage(&msg, NULL, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE) &&
       		!PeekMessage(&msg, NULL, WM_TIMER, WM_TIMER, PM_REMOVE)) 
	   	WaitMessage();
	switch(msg.message)
 		{
    	case WM_MOUSEMOVE:
			HANDLE_WM_MOUSEMOVE(msg.hwnd, msg.wParam, msg.lParam, Drag_OnMouseMove);
		break;
		case WM_TIMER:
			HANDLE_WM_TIMER(msg.hwnd, msg.wParam, msg.lParam, Drag_OnTimer);
		break;
	 	case WM_LBUTTONUP: 
			HANDLE_WM_LBUTTONUP(msg.hwnd, msg.wParam, msg.lParam, Drag_OnLButtonUp);
		break;
	 	default:
    		// Process messages we don't handle
	   		TranslateMessage(&msg);
	   		DispatchMessage(&msg);
		break;      
		}
	}

// process the drag and cleanup
DragEnd(hWindow);
}
Exemple #4
0
LOCAL void ListBox_OnLButtonDown(HWND hWindow, BOOL fDoubleClick, int x, int y, UINT keyFlags)
/***********************************************************************/
{
// get the listbox data pointer
LPLISTBOXDATA lpData = ListBox_GetData(hWindow);
if (!lpData)
	{
	FORWARD_WM_LBUTTONDOWN(hWindow, fDoubleClick, x, y, keyFlags, ListBox_CallWindowProc);
	return;
	}

if (lpData->fEnableMove)
	ListBox_DoDrag(hWindow, fDoubleClick, x, y, keyFlags);
else
if (lpData->iSelectDir)
	ListBox_DoSpecialSelect(hWindow, fDoubleClick, x, y, keyFlags);
}