1. Still cant position Desktop icons (Win)

Hello again,


A while back i was talking about how to position desktop icons on
the desktop in case a virus or other reason the icons were moved
around or replaced by another program.

So far still no success, so i was wondering if anyone else had found
a way to do this yet?  It's easy to get the icons back on screen,
with all the info they contain, but so far still no way to *position*
them back to where they were at some point.  Note that i want to do
this through a Eu program. If anyone found anything please mention it.


Take care,
Al

And, good luck with your Euphoria programming!

My bumper sticker: "I brake for LED's"

new topic     » topic index » view message » categorize

2. Re: Still cant position Desktop icons (Win)

I don't know much about the window's core for icon positioning but maybee
you could simulate a "right click -> arrange icons -> by type" or trigger
a "right click -> auto arrange".

I have no idea how to do it practicly but theoreticly it would seem to be
the best method.

p.s. Your prog could have some icon recovery setting ie:
     
     arrage icons by:
     [] auto
     [] user - [] type  
             - [] name
             - [] data
               ect ...

new topic     » goto parent     » topic index » view message » categorize

3. Re: Still cant position Desktop icons (Win)

Al Getz wrote:
> 
> Hello again,
> 
> 
> A while back i was talking about how to position desktop icons on
> the desktop in case a virus or other reason the icons were moved
> around or replaced by another program.
> 
> So far still no success, so i was wondering if anyone else had found
> a way to do this yet?  It's easy to get the icons back on screen,
> with all the info they contain, but so far still no way to *position*
> them back to where they were at some point.  Note that i want to do
> this through a Eu program. If anyone found anything please mention it.
> 
> 
> Take care,
> Al
> 
> And, good luck with your Euphoria programming!
> 
> My bumper sticker: "I brake for LED's"

Al:

   First you would have to be sure that auto-arrange icons is
turn-off on the screen context menu.
   Then remember that the desktop is really a window
and the icons are child windows. So you should be able
to get each icon handle by enumerating the child windows.
 From the child handles you should be able to discover the
location of each and create and keep a list.

Bernie

My files in archive:
w32engin.ew mixedlib.e eu_engin.e win32eru.exw

Can be downloaded here:
http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan

new topic     » goto parent     » topic index » view message » categorize

4. Re: Still cant position Desktop icons (Win)

Hayden McKay wrote:
> 
> I don't know much about the window's core for icon positioning but maybee
> you could simulate a "right click -> arrange icons -> by type" or trigger
> a "right click -> auto arrange".
> 
> I have no idea how to do it practicly but theoreticly it would seem to be
> the best method.
> 
> p.s. Your prog could have some icon recovery setting ie:
>      
>      arrage icons by:
>      [] auto
>      [] user - [] type  
>              - [] name
>              - [] data
>                ect ...

Hi there Hayden,

Im not sure what you mean there...


Take care,
Al

And, good luck with your Euphoria programming!

My bumper sticker: "I brake for LED's"

new topic     » goto parent     » topic index » view message » categorize

5. Re: Still cant position Desktop icons (Win)

Bernie Ryan wrote:
> 
> Al Getz wrote:
> > 
> > Hello again,
> > 
> > 
> > A while back i was talking about how to position desktop icons on
> > the desktop in case a virus or other reason the icons were moved
> > around or replaced by another program.
> > 
> > So far still no success, so i was wondering if anyone else had found
> > a way to do this yet?  It's easy to get the icons back on screen,
> > with all the info they contain, but so far still no way to *position*
> > them back to where they were at some point.  Note that i want to do
> > this through a Eu program. If anyone found anything please mention it.
> > 
> > 
> > Take care,
> > Al
> > 
> > And, good luck with your Euphoria programming!
> > 
> > My bumper sticker: "I brake for LED's"
> 
> Al:
> 
>    First you would have to be sure that auto-arrange icons is
> turn-off on the screen context menu.
>    Then remember that the desktop is really a window
> and the icons are child windows. So you should be able
> to get each icon handle by enumerating the child windows.
>  From the child handles you should be able to discover the
> location of each and create and keep a list.
> 
> Bernie
> 
> My files in archive:
> w32engin.ew mixedlib.e eu_engin.e win32eru.exw
> 
> Can be downloaded here:
> <a
> href="http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan">http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan</a>

Hi Bernie,

Well, i dont have any problem 'getting' the locations, the problem is
there is no function i can call to place them where i want them.
For example:
  MoveDesktopIcon(id,100,200)


I can get the (100,200) part just fine, just cant make it move there
or change it to say (200,300) .

I think i've found one possible way so far, but it's not something
i want to have to do.  That is, modify the registry hive that controls
the icon positions so that during bootup it reads them and positions
the icons appropriately.  Unfortunately, this requires changing the
hive from another system such as DOS or bootup in another Win system
in order to make the mods to the hive.  This means i'd have to boot up
in some other system first, then reboot to Win XP.  I was hoping to
avoid this entirely so im looking for another method.



Take care,
Al

And, good luck with your Euphoria programming!

My bumper sticker: "I brake for LED's"

new topic     » goto parent     » topic index » view message » categorize

6. Re: Still cant position Desktop icons (Win)

Al Getz wrote:
SNIP

> Hi Bernie,
> 
> Well, i dont have any problem 'getting' the locations, the problem is
> there is no function i can call to place them where i want them.
> For example:
>   MoveDesktopIcon(id,100,200)
> 
> 
> I can get the (100,200) part just fine, just cant make it move there
> or change it to say (200,300) .
> 
> I think i've found one possible way so far, but it's not something
> i want to have to do.  That is, modify the registry hive that controls
> the icon positions so that during bootup it reads them and positions
> the icons appropriately.  Unfortunately, this requires changing the
> hive from another system such as DOS or bootup in another Win system
> in order to make the mods to the hive.  This means i'd have to boot up
> in some other system first, then reboot to Win XP.  I was hoping to
> avoid this entirely so im looking for another method.
> 
> 
> Take care,
> Al

Hi Al,

Don't know if this will help; found it at MS site:

-----------------------------------------------------------------
DrawIconEx Function

The DrawIconEx function draws an icon or cursor into the specified device
context, performing the specified raster operations, and stretching or
compressing the icon or cursor as specified.

Syntax

BOOL DrawIconEx(      

    HDC hdc,
    int xLeft,
    int yTop,
    HICON hIcon,
    int cxWidth,
    int cyWidth,
    UINT istepIfAniCur,
    HBRUSH hbrFlickerFreeDraw,
    UINT diFlags
);

Parameters

    hdc
[in] Handle to the device context into which the icon or cursor will be
        drawn.
    xLeft
[in] Specifies the logical x-coordinate of the upper-left corner of the
        icon or cursor.
    yTop
[in] Specifies the logical y-coordinate of the upper-left corner of the
        icon or cursor.
    hIcon
[in] Handle to the icon or cursor to be drawn. This parameter can
        identify an animated cursor.
    cxWidth
[in] Specifies the logical width of the icon or cursor. If this
        parameter is zero and the diFlags parameter is DI_DEFAULTSIZE, the function uses
        the SM_CXICON or SM_CXCURSOR system metric value to set the width. If this
        parameter is zero and DI_DEFAULTSIZE is not used, the function uses the actual
        resource width.
    cyWidth
[in] Specifies the logical height of the icon or cursor. If this
        parameter is zero and the diFlags parameter is DI_DEFAULTSIZE, the function uses
        the SM_CYICON or SM_CYCURSOR system metric value to set the width. If this
        parameter is zero and DI_DEFAULTSIZE is not used, the function uses the actual
        resource height.
    istepIfAniCur
[in] Specifies the index of the frame to draw, if hIcon identifies an
        animated cursor. This parameter is ignored if hIcon does not identify an animated
        cursor.
    hbrFlickerFreeDraw
[in] Handle to a brush that the system uses for flicker-free drawing. If
        hbrFlickerFreeDraw is a valid brush handle, the system creates an offscreen
        bitmap using the specified brush for the background color, draws the icon or
        cursor into the bitmap, and then copies the bitmap into the device context
        identified by hdc. If hbrFlickerFreeDraw is NULL, the system draws the icon or
        cursor directly into the device context.
    diFlags
[in] Specifies the drawing flags. This parameter can be one of the
        following values:

        DI_COMPAT
Draws the icon or cursor using the system default image rather than
            the user-specified image. For more information, see About Cursors. Windows NT4.0
            and later: This flag is ignored.
        DI_DEFAULTSIZE
Draws the icon or cursor using the width and height specified by the
            system metric values for cursors or icons, if the cxWidth and cyWidth parameters
            are set to zero. If this flag is not specified and cxWidth and cyWidth are set to
            zero, the function uses the actual resource size.
        DI_IMAGE
            Draws the icon or cursor using the image.
        DI_MASK
            Draws the icon or cursor using the mask.
        DI_NOMIRROR
Windows XP: Draws the icon as an unmirrored icon. By default, the
            icon is drawn as a mirrored icon if hdc is mirrored.
        DI_NORMAL
            Combination of DI_IMAGE and DI_MASK.

Return Value

    If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error
    information, call GetLastError.


Remarks

The DrawIconEx function places the icon's upper-left corner at the location
    specified by the xLeft and yTop parameters. The location is subject to the
    current mapping mode of the device context.

    To duplicate DrawIcon (hDC, X, Y, hIcon), call DrawIconEx as follows:

DrawIconEx (hDC, X, Y, hIcon, 0, 0, 0, NULL, DI_NORMAL | DI_COMPAT |
DI_DEFAULTSIZE);

Function Information

    Minimum DLL Version	user32.dll
    Header	Declared in Winuser.h, include Windows.h
    Import library	User32.lib
    Minimum operating systems	Windows 95, Windows NT 3.5
    Unicode	Implemented as Unicode version.

See Also

    Icons Overview, CopyImage, DrawIcon, LoadImage

----------------------------------

--Quark

new topic     » goto parent     » topic index » view message » categorize

7. Re: Still cant position Desktop icons (Win)

A> A while back i was talking about how to position desktop icons on
A> the desktop in case a virus or other reason the icons were moved
A> around or replaced by another program.

A> So far still no success, so i was wondering if anyone else had found
A> a way to do this yet?  It's easy to get the icons back on screen,
A> with all the info they contain, but so far still no way to *position*
A> them back to where they were at some point.  Note that i want to do
A> this through a Eu program. If anyone found anything please mention it.

Seems that the icon positions are stored here:

HKEY_CURRENT_USER\Software\Microsoft\Windows\Shell\Bags\1\Desktop

See the values at the right pane.

new topic     » goto parent     » topic index » view message » categorize

8. Re: Still cant position Desktop icons (Win)

DB James wrote:
> 
> Al Getz wrote:
> SNIP
> 
> > Hi Bernie,
> > 
> > Well, i dont have any problem 'getting' the locations, the problem is
> > there is no function i can call to place them where i want them.
> > For example:
> >   MoveDesktopIcon(id,100,200)
> > 
> > 
> > I can get the (100,200) part just fine, just cant make it move there
> > or change it to say (200,300) .
> > 
> > I think i've found one possible way so far, but it's not something
> > i want to have to do.  That is, modify the registry hive that controls
> > the icon positions so that during bootup it reads them and positions
> > the icons appropriately.  Unfortunately, this requires changing the
> > hive from another system such as DOS or bootup in another Win system
> > in order to make the mods to the hive.  This means i'd have to boot up
> > in some other system first, then reboot to Win XP.  I was hoping to
> > avoid this entirely so im looking for another method.
> > 
> > 
> > Take care,
> > Al
> 
> Hi Al,
> 
> Don't know if this will help; found it at MS site:
> 
> -----------------------------------------------------------------
> DrawIconEx Function
> 
> The DrawIconEx function draws an icon or cursor into the specified device
> context,
> performing the specified raster operations, and stretching or compressing the
> icon or cursor as specified.
> 
> Syntax
> 
> BOOL DrawIconEx(      
> 
>     HDC hdc,
>     int xLeft,
>     int yTop,
>     HICON hIcon,
>     int cxWidth,
>     int cyWidth,
>     UINT istepIfAniCur,
>     HBRUSH hbrFlickerFreeDraw,
>     UINT diFlags
> );
> 
> Parameters
> 
>     hdc
>         [in] Handle to the device context into which the icon or cursor will
> be drawn. 
>     xLeft
>         [in] Specifies the logical x-coordinate of the upper-left corner of
> the icon or cursor. 
>     yTop
>         [in] Specifies the logical y-coordinate of the upper-left corner of
> the icon or cursor. 
>     hIcon
>         [in] Handle to the icon or cursor to be drawn. This parameter can
>         identify
> an animated cursor. 
>     cxWidth
>         [in] Specifies the logical width of the icon or cursor. If this
>         parameter
> is zero and the diFlags parameter is DI_DEFAULTSIZE, the function uses the
> SM_CXICON
> or SM_CXCURSOR system metric value to set the width. If this parameter is zero
> and DI_DEFAULTSIZE is not used, the function uses the actual resource width.
> 
>     cyWidth
>         [in] Specifies the logical height of the icon or cursor. If this
>         parameter
> is zero and the diFlags parameter is DI_DEFAULTSIZE, the function uses the
> SM_CYICON
> or SM_CYCURSOR system metric value to set the width. If this parameter is zero
> and DI_DEFAULTSIZE is not used, the function uses the actual resource height.
> 
>     istepIfAniCur
>         [in] Specifies the index of the frame to draw, if hIcon identifies an
> animated cursor. This parameter is ignored if hIcon does not identify an
> animated
> cursor. 
>     hbrFlickerFreeDraw
>         [in] Handle to a brush that the system uses for flicker-free drawing.
> If hbrFlickerFreeDraw is a valid brush handle, the system creates an offscreen
> bitmap using the specified brush for the background color, draws the icon or
> cursor into the bitmap, and then copies the bitmap into the device context
> identified
> by hdc. If hbrFlickerFreeDraw is NULL, the system draws the icon or cursor
> directly
> into the device context. 
>     diFlags
>         [in] Specifies the drawing flags. This parameter can be one of the
>         following
> values:
> 
>         DI_COMPAT
>             Draws the icon or cursor using the system default image rather
>             than
> the user-specified image. For more information, see About Cursors. Windows
> NT4.0
> and later: This flag is ignored.
>         DI_DEFAULTSIZE
>             Draws the icon or cursor using the width and height specified by
> the system metric values for cursors or icons, if the cxWidth and cyWidth
> parameters
> are set to zero. If this flag is not specified and cxWidth and cyWidth are set
> to zero, the function uses the actual resource size. 
>         DI_IMAGE
>             Draws the icon or cursor using the image.
>         DI_MASK
>             Draws the icon or cursor using the mask.
>         DI_NOMIRROR
>             Windows XP: Draws the icon as an unmirrored icon. By default, the
> icon is drawn as a mirrored icon if hdc is mirrored.
>         DI_NORMAL
>             Combination of DI_IMAGE and DI_MASK.
> 
> Return Value
> 
>     If the function succeeds, the return value is nonzero.
> 
>     If the function fails, the return value is zero. To get extended error
>     information,
> call GetLastError.
<snip>

Hi Quark,


Thanks for the info, but unfortunately it's not just a matter of drawing
them on the screen, as the op system has to be told where to draw them
or else they will simply be redrawn at various times when the op sys
decides to.  Also, the op sys has to know where they are so it knows
if they have been clicked or whatever too.
Thanks anyway though.



Take care,
Al

And, good luck with your Euphoria programming!

My bumper sticker: "I brake for LED's"

new topic     » goto parent     » topic index » view message » categorize

9. Re: Still cant position Desktop icons (Win)

akusaya wrote:
> 
> A> A while back i was talking about how to position desktop icons on
> A> the desktop in case a virus or other reason the icons were moved
> A> around or replaced by another program.
> 
> A> So far still no success, so i was wondering if anyone else had found
> A> a way to do this yet?  It's easy to get the icons back on screen,
> A> with all the info they contain, but so far still no way to *position*
> A> them back to where they were at some point.  Note that i want to do
> A> this through a Eu program. If anyone found anything please mention it.
> 
> Seems that the icon positions are stored here:
> 
> HKEY_CURRENT_USER\Software\Microsoft\Windows\Shell\Bags\1\Desktop
> 
> See the values at the right pane.
> 
> 

Hello there aku,


Thanks for the info there, but it doesnt seem to help to know that
because even if i change these values it has no effect on the
desktop screen, as the icons stay put.  Unless there is a function
hiding somewhere to make the op sys use the new values such as:
  Registry_Updated()
or something like that, that makes the op sys acknowledge the change.



Take care,
Al

And, good luck with your Euphoria programming!

My bumper sticker: "I brake for LED's"

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu