Click here to Skip to main content
15,905,508 members
Please Sign up or sign in to vote.
2.40/5 (5 votes)
See more:
Hi,

I have a VB application that runs full screen. On the click of a button on the VB application, an applet is opened. On the click of a button on the applet, it calls a c++ dll (twain) and this dll has the code to create a pop up window and this window goes underneath the full screen VB application instead of being at the top.

Can someone let me know the way i can get this pop up window onto the top of full screen VB form and the applet?

Thanks in Advance,
Kris
Posted
Updated 24-Feb-11 17:48pm
v3
Comments
Hans Dietrich 24-Feb-11 23:05pm    
You're probably getting downvoted because you posted a VB question in the C++ forum. Choose the Visual Basic forum next time. :)
Nish Nishant 25-Feb-11 10:51am    
Hans, he tagged it as C++ but it's just a tag. Many people get the tags mixed up :-)
Hari-Adarapu 24-Feb-11 23:46pm    
I posted this question here because the applet internally calls a twain dll that is in c++ and this dll creates the window. So please revoke the downvote.

You can implement following into vc++ dll

C++
CWnd *pCalc = CWnd::FindWindow(NULL, _T("Applet Name"));
if(pCalc != NULL)
{
   pCalc->BringWindowToTop();
   pCalc->CenterWindow();
}

You can also use MoveWindow(); To move window at desried location with size.
 
Share this answer
 
v3
Comments
Emilio Garavaglia 26-Feb-11 15:08pm    
Reformatted and HTML-ized
Just make the window settings to OnTop while creating that window.
 
Share this answer
 
If possible you should pass your window handle to the called procedure as parent window. Otherwise you can install a hook to do that (SetWindowsHookEx(WH_SHELL,...)). Catch the HSHELL_WINDOWCREATED message and set yout window as parent (SetParentWindow, or SetWindowPos or SetForegroundWindow etc. pp.).
Regards.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900