Desktop Icons Position Using API? 
Author Message
 Desktop Icons Position Using API?

I would like to know how to retreive desktop icons position using API calls.
I tried LVM_GETITEMPOSITION but got a problem when tried to pass the
POINTAPI structure! Looked like this

Private type POINTAPI
    x as long
    y as long
end type

dim ptr as POINTAPI
dim itmIndex&

itmindex = 0    'to get the first icon

Sendmessage(lstviewhwnd, LVM_GETITEMPOSITION, itmIndex, ptr)

either VB returns an error or explorer cause an illegal operation!
can anyone tell me what i'm doing wrong please??

also I would like to now how to retrieve names corresponding to each index
using LVM_GETITEMTEXT

any help would be appriciacted, thank you very much!


gLoBaL-pUnK



Sat, 28 Jul 2001 03:00:00 GMT  
 Desktop Icons Position Using API?
On Tue, 9 Feb 1999 15:32:37 -0800, "gLoBaL-pUnK"

Quote:

>I would like to know how to retreive desktop icons position using API calls.
>I tried LVM_GETITEMPOSITION but got a problem when tried to pass the
>POINTAPI structure! Looked like this

>Private type POINTAPI
>    x as long
>    y as long
>end type

>dim ptr as POINTAPI
>dim itmIndex&

>itmindex = 0    'to get the first icon

>Sendmessage(lstviewhwnd, LVM_GETITEMPOSITION, itmIndex, ptr)

>either VB returns an error or explorer cause an illegal operation!
>can anyone tell me what i'm doing wrong please??

How are you passing the pointapi struct?  VB doesn't allow passing
structures byval to an API function.


Sun, 29 Jul 2001 03:00:00 GMT  
 Desktop Icons Position Using API?

Quote:

>>Sendmessage(lstviewhwnd, LVM_GETITEMPOSITION, itmIndex, ptr)
>How are you passing the pointapi struct?  VB doesn't allow passing
>structures byval to an API function.

There are several different ways to declare and use the same function. A
difference in declaration infers a difference in use in the call also.

I prefer (..., lParam as Any) for SendMessage, as it's the most
universal. This allows passing pointers (UDT's), pointers to strings
(Byval somestring$) and values (Byval somevalue&)

        Bart.



Sun, 29 Jul 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Desktop Icons Position Using API?

2. Desktop Icons Position Using API?

3. Desktop Icons Position Using API?

4. Desktop Icons Position Using API?

5. Hiding all Icons on the Desktop and Using Active Desktop

6. Desktop Icons Position - Help Please

7. Desktop Icons Position - Help Please

8. desktop icon position?

9. Desktop Icon Positions?

10. Get/Set desktop icon positions in WinNT/2K

11. desktop icon positions?

12. desktop-icon position

 

 
Powered by phpBB® Forum Software