Page 1 of 1

Set Windows (Alt-Tab) icon when app only has a dialog

Posted: Tue May 30, 2006 7:52 am
by AlexSchaft
Hi,

When defining an application with only a dialog and the dialog has an icon, the windows alt-tab icon stays the default. How do I change this

Thanks,
Alex

Re: Set Windows (Alt-Tab) icon when app only has a dialog

Posted: Tue May 30, 2006 10:23 am
by Enrico Maria Giordano
Try

Code: Select all

ACTIVATE DIALOG oDlg;
         ON INIT SETCLASSLONG( oDlg:hWnd, GCL_HICON, LOADICON( GETINSTANCE(), "ICONNAMEINRESOURCE" ) );

Code: Select all

#pragma BEGINDUMP

#include "windows.h"
#include "hbapi.h"


HB_FUNC( SETCLASSLONG )
{
    hb_retnl( ( LONG ) SetClassLong( ( HWND ) hb_parnl( 1 ), hb_parni( 2 ), hb_parnl( 3 ) ) );
}

#pragma ENDDUMP
EMG

Icon

Posted: Tue May 30, 2006 10:28 am
by AlexSchaft
Thanks, that worked