Re: Win API question

new topic     » goto parent     » topic index » view thread      » older message » newer message

----- Original Message ----- 
From: "Philip D." <philip1987 at hotmail.com>
To: <EUforum at topica.com>
Subject: Win API question


> 
> 
> Can someone tell me why this won't work?
> 
> It should put a notepad icon on the window.  Make sure you make a file 
> "C:\myfile.txt" before you run the program.
> 
> --begin code
> 
> include win32lib.ew
> without warning
> 
> constant win = create( Window, "win", 0, Default, Default, 500, 500, 0 )
> 
> constant xExtractAssociatedIcon =
>     registerw32Function(shell32, "ExtractAssociatedIconA", {C_INT, 
> C_POINTER, C_INT}, C_INT),
>     icon = addIcon( w32Func( xExtractAssociatedIcon, { 0, "C:\\myfile.txt", 
> 0 } ) )
> 
> 
> procedure paintWin( integer self, integer event, sequence parms )
> 
>           copyBlt( win, 10, 10, icon )
> 
> end procedure
> setHandler( win, w32HPaint, routine_id( "paintWin" ) )
> 
> WinMain( win, Normal )
> 

copyBlt and the other blitting routines are designed to work with bitmaps and
not icons.

Brian's example using an Icon control is probably the easiest alternative.
-- 
Derek

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu