Re: Win API question
- Posted by "Derek Parnell" <ddparnell at bigpond.com> Dec 09, 2003
- 518 views
----- 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