如何用c语言或java实现改变桌面图标的坐标位置,用到什么api?求大神解答,给出具体可行的代码一
答案:1 悬赏:0 手机版
解决时间 2021-11-20 18:53
- 提问者网友:沉默的哀伤
- 2021-11-20 05:32
如何用c语言或java实现改变桌面图标的坐标位置,用到什么api?求大神解答,给出具体可行的代码一
最佳答案
- 五星知识达人网友:刀戟声无边
- 2021-11-20 06:38
void C***::OnSetDeskIcon()
{
HWND hwndParent = ::FindWindow( "Progman", "Program Manager" );
HWND hwndSHELLDLL_DefView = ::FindWindowEx( hwndParent, NULL, "SHELLDLL_DefView", NULL );
HWND hwndSysListView32 = ::FindWindowEx( hwndSHELLDLL_DefView, NULL, "SysListView32", "FolderView" );
int Nm = ListView_GetItemCount( hwndSysListView32 );
int sNm = 0;
if( Nm >= 10 )
{
sNm = 10;
}else{
sNm = Nm;
}
for( int i = 0; i < sNm; i++ )
{
int x = 400 + 150*cos( i*36*3.1415926/180 );
int y = 400 + 150*sin( i*36*3.1415926/180 );
::SendMessage( hwndSysListView32, LVM_SETITEMPOSITION, i, MAKELPARAM( x,y));
}
ListView_RedrawItems(hwndSysListView32, 0, ListView_GetItemCount(hwndSysListView32) - 1);
::UpdateWindow(hwndSysListView32);
}桌面的图标位置是在SysListView32里保存的, 这个程序就是用来修改的.
虽然没看懂.....不过看起来很麻烦.........
追问具体怎么操作呢………
{
HWND hwndParent = ::FindWindow( "Progman", "Program Manager" );
HWND hwndSHELLDLL_DefView = ::FindWindowEx( hwndParent, NULL, "SHELLDLL_DefView", NULL );
HWND hwndSysListView32 = ::FindWindowEx( hwndSHELLDLL_DefView, NULL, "SysListView32", "FolderView" );
int Nm = ListView_GetItemCount( hwndSysListView32 );
int sNm = 0;
if( Nm >= 10 )
{
sNm = 10;
}else{
sNm = Nm;
}
for( int i = 0; i < sNm; i++ )
{
int x = 400 + 150*cos( i*36*3.1415926/180 );
int y = 400 + 150*sin( i*36*3.1415926/180 );
::SendMessage( hwndSysListView32, LVM_SETITEMPOSITION, i, MAKELPARAM( x,y));
}
ListView_RedrawItems(hwndSysListView32, 0, ListView_GetItemCount(hwndSysListView32) - 1);
::UpdateWindow(hwndSysListView32);
}桌面的图标位置是在SysListView32里保存的, 这个程序就是用来修改的.
虽然没看懂.....不过看起来很麻烦.........
追问具体怎么操作呢………
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯