1. Win API question
- Posted by "Philip Deets" <philip1987 at hotmail.com> Dec 09, 2003
- 501 views
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
2. Re: Win API question
- Posted by "Derek Parnell" <ddparnell at bigpond.com> Dec 09, 2003
- 519 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
3. Re: Win API question
- Posted by "Derek Parnell" <ddparnell at bigpond.com> Dec 10, 2003
- 501 views
Mircoangelo is one of the better ones, but it costs. ----- Original Message ----- From: "Philip D." <philip1987 at hotmail.com> To: <EUforum at topica.com> Subject: RE: Win API question > > > I just tried every number from 1 to 10, none of them look any different, > they all look crammed. > > Also, where can I find an icon editor? I don't have one. > > Phil > > > ------ > > Bernie Ryan wrote: > > >Yes, but how do I get it to display the 16x16 version of the icon > >instead of the crammed 32x32 version? > > Philip: > > I look at the ICON used on NotePad and it contains 8 icons. > first, forth, and eight icons are the smallest icons. > > icon = addIcon( w32Func( xExtractAssociatedIcon, > { 0, "C:\\myfile.txt", 0 } ) ) > > In the last parameter you used index zero which will try to use a default > because you didn't use a specific index. > > Try using 1, 4, or 8 in the last parameter. > > Bernie > > > > TOPICA - Start your own email discussion group. FREE! > >