04-26-2006 04:47 AM
04-26-2006 10:53 AM - edited 04-26-2006 10:53 AM
Hi Wim, I'm afraid you cannot get such an information on the CVI side. Instead, you need to process some Windows message in a specifica callback installed via InstallWinMsgCallback function in the Programmer's Toolbox. I made some test with this code:
1. In the main function install the callback for processing WM_SIZING Windows event:
err = InstallWinMsgCallback (panelHandle, WM_SIZING, sizingCbk, VAL_MODE_INTERCEPT, NULL, &WHandle);
2. Here a skeleton of the callback that is called during windows sizing:
int CVICALLBACK sizingCbk (int panelHandle, int message, unsigned int* wParam,
unsigned int* lParam, void* callbackData)
// Function to process sizing of the window
{
switch (*(int*)wParam) {
case WMSZ_RIGHT: DebugPrintf ("Sized on the right\n"); break;
case WMSZ_LEFT: DebugPrintf ("Sized on the left\n"); break;
}
return 1; // According to SDK documentation function must return TRUE
}
With the same method you can process other events such as WM_MOVING. The same callback can be installed for several messages since it receives messageID in its secon parameters. I don't know how often the function is called, but it is *very* often: you may need to process lParam values (which points to a structure that holds window boundaries) to determine when to adjust controls position, otherwise you may suffer a significant overhead on the system.
I hope this helps
Roberto
Message Edited by Roberto Bozzolo on 04-26-2006 05:56 PM
04-26-2006 10:59 AM
Hello Roberto,
thanks a lot for the information, I'll let you know if I can implement this successfully
04-27-2006 03:04 PM