ah and.. sure I read all msdn however I'm not native english speaker and I sometimes can't understand especially with things I never dealt with before So if u can tke some of ur time and explain to me you would save my life
note :I'm on VBNet
|
Light Poster
|
|
| 5May2009,03:05 | #51 |
|
Go4Expert Founder
|
![]() |
| 5May2009,08:45 | #52 |
|
Actually yes. There are many Icons and even if you see one there are of many sizes like 16x16, 32x32 and so on. So its always more than one Icon.
Yes it does it one by one based on the Id ( Integer ) you provide and tells you if its a valid resource of the type specified. Quote:
Originally Posted by jambo Its already defined and you do not need to do anything extra to declare it but just use it. I hope I have cleared some of your queries |
|
Light Poster
|
|
| 6May2009,13:31 | #53 |
|
hmm thx for replies Jabbir but I can't succeed in writing this in VB
|
|
Go4Expert Founder
|
![]() |
| 6May2009,16:44 | #54 |
|
Newbie Member
|
|
| 6Jun2009,21:24 | #55 |
|
Hi,
I've found this code, and topic googleing, looking for a good example that will explain how to do the exact thing your example does ![]() I am using Visual Basic, and code is not working for me. I'm having problems with this function FindResource, as it wont find the resource. I opened my source EXE file with a tool and i've seen that my icon names are 30003, 30004, and 30005, so i used "#30004" to find icon. Code:
hRes = FindResource(hSrc, "#30002", RT_ICON) Have two questions: - What could be the cause for function failiure? - Is there any other way to do this? |
|
Newbie Member
|
|
| 6Jun2009,21:52 | #56 |
|
I didn't mention that examples are not working for me. I compiled the example with source code too.
Neither is working. :/ |
|
Newbie Member
|
|
| 7Jun2009,16:36 | #57 |
|
Quote:
Originally Posted by jambo This is my VB code with declarations: //Those are examples where i know my icon name is #1, but it can be #20000 also so you shold loop from 1 to ... 65536 maybe. Just guessing. Code:
This is C++ code: hRes = FindResource(hSrc, MAKEINTRESOURCE(1), RT_ICON); //Works! Code:
LPCTSTR lpName; lpName = "#1" hRes = FindResource(hSrc, lpName, RT_ICON); //Works Code:
Private Declare Function FindResource Lib "kernel32.dll" Alias "FindResourceA" ( _
ByVal hInstance As Long, _
ByVal lpName As String, _
ByVal lpType As String) As Long
Private Const RT_ICON As Long = 3&
Code:
Dim hRes as Long hRes = FindResource(hSrc, "#1", RT_ICON) |
|
Newbie Member
|
|
| 28Sep2009,17:56 | #58 |
|
I can't open the two .zip files given at the end please help
in my computer the file extension is changed to .php after downloading and even if the change the extension to .zip or .rar I can't open it...... what could be the possiible error.......... |
|
Go4Expert Founder
|
![]() |
| 28Sep2009,19:39 | #59 |
|
Dont know why but I checked it once again now and it did download as zip
|
|
Light Poster
|
|
| 26Feb2010,13:01 | #60 |
|
I also want to do this,i m already taking help of this thread but its not working.
t think you done it so please provide me sample to change icon to exe. thanks. |


