| View previous topic :: View next topic |
| Author |
Message |
marty Professional Member


Joined: 10 May 2001 Posts: 789
|
Posted: Fri Feb 11, 2005 1:37 pm Post subject: Windows Icon capture? Possible? |
|
|
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 |
|
 |
ShinobiSoft Professional Member


Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Fri Feb 11, 2005 2:15 pm Post subject: |
|
|
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 |
|
 |
PGWARE Web Host

Joined: 29 Dec 2001 Posts: 1566
|
Posted: Fri Feb 11, 2005 4:42 pm Post subject: |
|
|
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 |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Sat Feb 12, 2005 7:32 am Post subject: |
|
|
here you go,
| Quote: |
WM_GETICON
Windows = (Windows NT, Windows 95, Windows 9
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 |
|
 |
marty Professional Member


Joined: 10 May 2001 Posts: 789
|
Posted: Sat Feb 12, 2005 11:52 am Post subject: |
|
|
Excellent! Thank you all!
 |
|
| Back to top |
|
 |
Boo Valued Contributor


Joined: 31 Oct 2003 Posts: 599 Location: Gulf Breeze, Florida USA
|
Posted: Mon Feb 14, 2005 3:14 pm Post subject: |
|
|
Hi Guys,
After determining the handle, how does one actually "capture" the icon?
Thanks,
- Boo |
|
| Back to top |
|
 |
ShinobiSoft Professional Member


Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Mon Feb 14, 2005 4:05 pm Post subject: |
|
|
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 |
|
 |
Boo Valued Contributor


Joined: 31 Oct 2003 Posts: 599 Location: Gulf Breeze, Florida USA
|
Posted: Tue Feb 15, 2005 4:19 am Post subject: |
|
|
Yeppers, that's what I meant. Will check out the API documentation...
Thanks,
- Boo |
|
| Back to top |
|
 |
|