Setting up a framework and loading a PNG icon and changing it into a CURSOR. ( getting a smaller executable size )
A strange thing happened.
In filemanager and taskmanager the Hand cursor shows up as the file icon???
It should be the Palette icon.
What am I doing wrong here?
Can't figure it out. :undecided:
I checked many resource files and everything is numbered over 100,so maybe
IDI_APPLICATION constant =100 or some other windows constant already is 100,so second line redefines IDI_APPLICATION to hand icon
Nah, its just handy but note that some OS functions use resource ID numbers below 100. From memory you can go up to 64k.
Tried higher resource ID numbers, it didn't solve it.
Quote from: Siekmanski on July 26, 2020, 08:18:07 PMIt should be the Palette icon
Your original exe, Win7-64
The mouse pointer is a hand, indeed.
Yes, it shows up correctly with the Palette icon on the taskbar.
But if you look into file manager or task manager it shows the Hand image as the file icon.
Very strange....
Its probably the case that Windows expects the first icon to be an ICO icon and it may just treat a PNG file as another resource rather than the main icon.
What about use loadicon after cursor code part?
AFAIK not the first icon in the resource file but the icon with the lowest id in alpha order is shown as an exe´s icon. So in terms of alpha order "100" comes before "IDI_APPLICATION". I would try to rename "100" to maybe "Hand" (HAND ICON "Res\handpointer64.ico")
JK
Thanks JK.
That did the trick.
Lowest resource ID number is the main Icon. :thumbsup:
Quote from: Siekmanski on July 27, 2020, 02:52:28 AM
Thanks JK.
That did the trick.
Lowest resource ID number is the main Icon. :thumbsup:
Maybe that explains why I see vc uses one ID that's -1 to guarantee it's the lowest
Quote from: Siekmanski on July 27, 2020, 02:52:28 AM
Lowest resource ID number is the main Icon. :thumbsup:
I can't reproduce this behaviour - this code produces the "Eye" icon :sad:
mov wc.hIcon, rv(LoadIcon, eax, IDI_APPLICATION)
mov wc.hIconSm, eax
#include "resource.h"
100 ICON "\\Masm32\\MasmBasic\\icons\\Smiley.ico"
IDI_APPLICATION ICON "\\Masm32\\MasmBasic\\icons\\Eye.ico"
01 RT_MANIFEST "\\Masm32\\MasmBasic\\Res\\XpManifest.xml"
Hi Magnus,
I tried -1 for the file icon but, that didn't work.
Now I have 1000 and 1001 ( the Hand cursor ) as the resource ID's and it works like a charm. :eusa_dance:
Hi Jochen,
Set the eye.ico to 99 101 and it probably works.
EDIT: 99 has to be 101
Another thing,
I created the icons with PNG images.
If I create a PNG cursor, the resource compiler chokes on it. ( only 1 byte is changed -> cursor ID )
That's why I load it as an icon and change it into a cursor in the source code.
Quote from: Siekmanski on July 27, 2020, 08:35:00 AMSet the eye.ico to 99 101 and it probably works.
Try putting
#include "resource.h" on top of the rc file :cool:
I've tried some varieties with my icons, but IDI_APPLICATION always wins:
#include <\masm32\INCLUDE\RESOURCE.H>
; #include "resource.h"
101 ICON "\\Masm32\\MasmBasic\\icons\\Smiley.ico"
IDI_APPLICATION ICON "\\Masm32\\MasmBasic\\icons\\plot.ico"
Note that the resource compiler does not throw errors if it encounters undefined constants such as IDI_APPLICATION :cool:
Besides, Windows is sometimes confused: If the exe has the smiley in Explorer, when running it may still have the previous icon.
It was included before this issue.
It was IDI_APPLICATION that messed things up for me.
here take a look how it uses -1 and MY_ICON 2
it also uses help popup and file menu and shortcuts in .rc file as code style instead of masm messagebox with text macros for caption and text
http://masm32.com/board/index.php?topic=8581.0 (http://masm32.com/board/index.php?topic=8581.0)
Hi Magnus,
Quote/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
This is exactly what JK pointed me at.
ID value: IDI_APPLICATION = 32512 ( was my application icon )
The ID value of the hand pointer icon was lower, hence my problem.
But it is solved now.
wonder what settings you exported your icon files with?
I tried inspired by this thread,but it blows up exe
first attempt is some simple drawing in paint png->ico
second attempt a Blonde.png->ico
They are PNG files.
I want to make it a PROC for cursorchanges,some I seen in games,cursor changes to different things depending on what it points to
must it be a 64x64 to work?
using 101,102,103,104 and I get exclamation mark,question mark and all kinds of default windows icons
trying to set my custom ICON it works as ICON
trying to set it as cursor,it shows circle(busy icon) and keeps going until I stop it with ctrl-alt-delete