Win API question

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

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 )

--end code

Thanks,

Phil

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

Search



Quick Links

User menu

Not signed in.

Misc Menu