473,480 Members | 1,711 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Troubles with SendMessage(WM_GETICON)

Well i'm trying to get the icon of the visibles windows.
i'm using:
EnumWindows, IsWindowVisible, and SendMessage with the "WM_GETICON"
parameter

sometimes then SendMessage function return "IntPtr.Zero", but it souldn't
cause the windows is visible...
here is my main code:

Dim WndIcon_s As System.IntPtr = SendMessage(WindowsHanlde,
WM_GETICON, ICON_SMALL, 0)
Dim WndIcon_l As System.IntPtr = SendMessage(WindowsHanlde,
WM_GETICON, ICON_BIG, 0)

If Not WndIcon_s.Equals(IntPtr.Zero) Then

APP_Icons_s.Images.Add(System.Drawing.Icon.FromHan dle(WndIcon_s))

APP_Icons_l.Images.Add(System.Drawing.Icon.FromHan dle(WndIcon_l))
End If

PS: i've already tryed with long instead of IntPtr, the probleme persist
Of curse i can get the icon of the exe assiosiated to the handle, but it's
not always the right icon!

for exemple I have troubles getting the VisualStudio icon, the trillian
icon, the winamp icon, but it work fine withe the iexplorer, or the explorer
windows...
any help will be appreciated, and excuse my english.
Nov 19 '05 #1
0 2644

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
15634
by: Nidhi | last post by:
Hi, I am trying to write code to retrieve the small icon for an application in C#. I am using SendMessage with WM_GETICON for this purpose but the return value I get is 0. I don't understand...
14
5552
by: Rajko | last post by:
I found possible bug with set icon. I'm not sure but I don't think this is supposed to work like this. Program uses large instead of small icons. Please tell me is it known bug or maybe I missed...
7
2129
by: iwdu15 | last post by:
hi, im attempting to get an applications Icon by using the method Icon.FromHandle() and passing in a windows handle, yet nothing works ive tried two different things and neither work. Ive been...
0
6908
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7087
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6741
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
6944
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4782
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4483
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2995
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
2985
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1300
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.