03-22-2016 08:50 AM
Can I specified a new parent panel for a existing control ?
I want the ctrl show on a panel,but it is belong to another panel.
I try to do this by using winAPI function "HWND SetParent",so I must have the handle of the ctrl by the following functions.
HWND WINAPI GetDlgItem(HWND hDlg,int nIDDlgItem);
hDlg is the current panel handle contain the ctrl,the nIDDlgItem is contrlID
But the function always return NULL.
I use the return value of the function "NewCtrl"as the contrlID,is that wrong?
.
Can you give me some advice and help?Thank you very much!
03-22-2016 09:02 AM
Hi,
just out of curiosity: what is the reason to move a control from one panel to another one?
Provided that you are talking about a LabWindows/CVI user interface control a possibility could be using the function DuplicateCtrl () of the user interface library: it copies an existing control from the source panel to the destination panel.
After that, you could discard the original control using DiscardCtrl ();
03-22-2016 08:52 PM
because I want to put the oglctrl's operation in another thread,but all function about ogl must be called from the same thread that the parent paSonel on which the thread resides is created in.
So,if I don't want to refresh the ogltrl in the main thread , the ogltrl can't belong to the main panel.
However,I need the oglctrl Keep being seen on main panel.
I try to put the ctrl on a always floating panel,the panel will always float above the main panel.but it will Keep out other pop-up panels.
03-23-2016 12:20 AM
You could create a new OGL control programmatically using OGLNewCtrl, obtain all attributes of the 'old' control, set them for the new OGL control and delete the original one. Not very elegant but might work.
In any case you should be aware that you won't be able to build a 64 bit executable.