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

Post Reply
User avatar
AlexSchaft
Posts: 172
Joined: Fri Oct 07, 2005 1:29 pm
Location: Edenvale, Gauteng, South Africa

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

Post 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
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

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

Post 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
User avatar
AlexSchaft
Posts: 172
Joined: Fri Oct 07, 2005 1:29 pm
Location: Edenvale, Gauteng, South Africa

Icon

Post by AlexSchaft »

Thanks, that worked
Post Reply