From: Franz Bachler on 5 Nov 2009 11:35 Hello, I've created a program with OpenCV which show a JPG-Image in a Window: strcpy(szTemp, TEXT("Name of the Window")); (IplImage*) img = cvLoadImage(szTemp, 1); cvNamedWindow(szText, 0); cvShowImage(szText, img); cvWaitKey(0); cvDestroyWindow(szText); The Window has only a standard "Empty Window Icon" in the upper left corner. How can I put my own icon there? Greetings, Franz -- Franz Bachler, A-3250 Wieselburg E-Mail: fraba (at) gmx.at Homepage: http://members.aon.at/fraba oder http://home.pages.at/fraba
From: Snorik on 5 Nov 2009 11:43 On 5 Nov., 17:35, "Franz Bachler" <fraba.nos...(a)gmx.at> wrote: > Hello, > > I've created a program with OpenCV which show a JPG-Image in a Window: > > strcpy(szTemp, TEXT("Name of the Window")); > (IplImage*) img = cvLoadImage(szTemp, 1); > cvNamedWindow(szText, 0); > cvShowImage(szText, img); > cvWaitKey(0); > cvDestroyWindow(szText); > > The Window has only a standard "Empty Window Icon" in the upper left corner. > How can I put my own icon there? > Dont you need an actual icon in 16x16 px for that?
From: Franz Bachler on 5 Nov 2009 14:26 >> The Window has only a standard "Empty Window Icon" in the upper left >> corner. >> How can I put my own icon there? > Dont you need an actual icon in 16x16 px for that? Yes. To add an icon in a dialogbox this works - but not with the OpenCV-Window SetClassLong( hWnd, GCL_HICON, (LONG) LoadIcon( GetModuleHandle(NULL), MAKEINTRESOURCE(ICO_NAMEICON) ) ); The HWND-Handle from the OpenCV-Window is from hWnd=(HWND) cvGetWindowHandle(szNameofWindow); Greetings, Franz
From: Leslie Milburn on 5 Nov 2009 18:44 "Franz Bachler" <fraba.nospam(a)gmx.at> wrote in message news:4af326d4$0$1550$91cee783(a)newsreader03.highway.telekom.at... >>> The Window has only a standard "Empty Window Icon" in the upper left >>> corner. >>> How can I put my own icon there? >> Dont you need an actual icon in 16x16 px for that? > > Yes. To add an icon in a dialogbox this works > - but not with the OpenCV-Window > > SetClassLong( hWnd, GCL_HICON, > (LONG) LoadIcon( GetModuleHandle(NULL), > MAKEINTRESOURCE(ICO_NAMEICON) ) ); > > The HWND-Handle from the OpenCV-Window is from > > hWnd=(HWND) cvGetWindowHandle(szNameofWindow); > > Greetings, > Franz Use WM_SETICON message hth Leslie.
From: Franz Bachler on 6 Nov 2009 00:21
>> SetClassLong( hWnd, GCL_HICON, >> (LONG) LoadIcon( GetModuleHandle(NULL), >> MAKEINTRESOURCE(ICO_NAMEICON) ) ); >> >> The HWND-Handle from the OpenCV-Window is from >> >> hWnd=(HWND) cvGetWindowHandle(szNameofWindow); > > Use WM_SETICON message > hth > Leslie. Hello, sorry but SendMessage(hWnd, WM_SETICON, (WPARAM) FALSE, (LONG) LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(ICO_NAME))); doesn't work. Greetings, Franz |