forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Windows Icon capture? Possible?

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
marty
Professional Member
Professional Member


Joined: 10 May 2001
Posts: 789

PostPosted: Fri Feb 11, 2005 1:37 pm    Post subject: Windows Icon capture? Possible? Reply with quote

Hi,

Wondering if anyone knows how to capture the window icon of any opened window?

For example if I wanted to capture the icon of an opened notepad, internet explorer, ect...

I search the forum, did not find anything about that (Unless I missed it)

Thank you,
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Fri Feb 11, 2005 2:15 pm    Post subject: Reply with quote

use the WM_GETICON API message with @sendmsg().

Code:

%%icon = @sendmsg(@winexists(someWindow), WM_GETICON, 0, 0)


I'mm not sure what the WM_GETICON message number is.

Set the 'wParam' member to zero'0' to get the big icon and one '1' for the
windows small icon.

_________________
Bill Weckel
ShinobiSoft Software

"The way is known to all, but not all know it."
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
PGWARE
Web Host


Joined: 29 Dec 2001
Posts: 1566

PostPosted: Fri Feb 11, 2005 4:42 pm    Post subject: Reply with quote

As noted WM_GETICON is the way to get the icon.

Check the api handbook (www.vdsworld.com > search) as it has the exact numbers and explantion to use for WM_GETICON
Back to top
View user's profile Send private message
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Sat Feb 12, 2005 7:32 am    Post subject: Reply with quote

here you go,

Quote:


WM_GETICON

Windows = (Windows NT, Windows 95, Windows 9Cool

wParam = (WPARAM) fType; // icon-size flag

lParam = 0; // not used, must be zero

Message ID = $031

Description: The WM_GETICON message is sent to a window to retrieve the handle of the big or small icon associated with a window. Windows retrieves the big icon when drawing a minimized window, and retrieves the small icon when drawing a title bar.

Parameters

WPARAM FTYPE VALUES

Value of wParam. Specifies the icon to retrieve.Use the following values.

Value Meaning
0 Retrieves the small icon
1 Retrieves the big icon


Return Value: The return value is the handle of the big or small icon, depending on the value of wparam fType.

Sample Source Code

title TEST

DIALOG CREATE,TEST,-1,0,213,84
DIALOG ADD,BUTTON,BUTTON1,36,64,,,,DEFAULT
DIALOG SHOW
:evloop
wait event
goto @event()
:BUTTON1BUTTON
shell open,@windir()\command.com
repeat
until @winexists(MS-DOS Prompt)
%A = @sendmsg(@win(MS-DOS Prompt),$07F,1,0)
warn %A
rem Warns Big Icon Handle of MS-DOS Prompt window
goto evloop
:CLOSE
exit


_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
marty
Professional Member
Professional Member


Joined: 10 May 2001
Posts: 789

PostPosted: Sat Feb 12, 2005 11:52 am    Post subject: Reply with quote

Excellent! Thank you all!

Very Happy
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Boo
Valued Contributor
Valued Contributor


Joined: 31 Oct 2003
Posts: 599
Location: Gulf Breeze, Florida USA

PostPosted: Mon Feb 14, 2005 3:14 pm    Post subject: Reply with quote

Hi Guys,

After determining the handle, how does one actually "capture" the icon?

Thanks,

- Boo
Back to top
View user's profile Send private message
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Mon Feb 14, 2005 4:05 pm    Post subject: Reply with quote

You can't really capture the icon.
But with this icon handle you can use some of the other APIs like
DrawIcon() and any of the @sendmsg() codes that use an icon handle as
well.

_________________
Bill Weckel
ShinobiSoft Software

"The way is known to all, but not all know it."
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
Boo
Valued Contributor
Valued Contributor


Joined: 31 Oct 2003
Posts: 599
Location: Gulf Breeze, Florida USA

PostPosted: Tue Feb 15, 2005 4:19 am    Post subject: Reply with quote

Yeppers, that's what I meant. Will check out the API documentation...

Thanks,

- Boo
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group