Thursday, April 11, 2013

Force opencv image window to always on top

Recently I needed to make an opencv(Open Source Computer Vision) image window always on top of any other windows. I followed the answers in Stackoverflow but couldn't make it really work. The solution proposed by it was to use setWindowPos API to make the image window TOPMOST.

I have to say today is my lucky day. I finally found if we set the parent of that image window to TOPMOST, then it works like a charm.
        HWND cvHwnd = (HWND )cvGetWindowHandle("window");
        HWND cvParent = ::GetParent(cvHwnd);
        ::ShowWindow(cvParent, SW_MINIMIZE);
        ::ShowWindow(cvParent, SW_RESTORE);
        ::SetWindowPos(cvParent, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);


Anonymous said...

Hi colleagues, pleasant article and good urging commented
at this place, I am truly enjoying by these.

My web blog - シャネル 時計

Anonymous said...

Hi there! Do you know if they make any plugins to protect against hackers?

I'm kinda paranoid about losing everything I've worked hard on.
Any tips?

Also visit my web page;

Anonymous said...

dating sites uk jennifer aniston dating again
enchanted evenings dating [url=]carbon dating scientist sujihara[/url] classmates dating site
dating for single [url=]national dating websites[/url] dating japan indians [url=]juliet4u28[/url] dating offenbach germany

Anonymous said...

best dating internet free hiv dating personals
dating site for cooks [url=]online dating website relationship[/url] columbian girl dating
aratron dating [url=]history of courting dating[/url] adult dating mobile [url=]dropdeadbeauty[/url] ideas for group dating

Anonymous said...

changes in dating over the years single ads dating online
singles sex dating santa clarita ca [url=]hemel hempstead dating[/url] dating tip sights
joanna hillman editor dating [url=]disabled singles dating clubs[/url] patent numbers for dating [url=]tideboy[/url] adult dating internet sites

Anonymous said...

chubby dating web sites are zack and vanessa dating
dating netherlands [url=]european farm dating[/url] online dating warnings
married dating agencies in uk [url=]juicy dating[/url] one good love dating site reviewd [url=]24012000[/url] anastacia russian dating